InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDocumentPresentation.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IDOCUMENTPRESENTATION__
25 #define __IDOCUMENTPRESENTATION__
26 
27 #include "IPMUnknown.h"
28 #include "PMTypes.h" //GSysRect
29 #include "AppUIID.h"
30 #include "ISelectionMessages.h"
31 #include "ScriptData.h"
32 #include "IWindow.h"
33 
34 class IDocument;
35 class IControlView;
36 class ISelectionManager;
37 
48 {
49 public:
50  enum {kDefaultIID = IID_IDOCUMENTPRESENTATION};
51 
54  virtual IDocument* GetDocument() const = 0;
55 
58  virtual UIDRef GetDocumentUIDRef() const = 0;
59 
66  // virtual PaletteRef GetPaletteRef() const = 0; // use PaletteRefUtils::GetPaletteRefFromDocumentPresentation(this) instead.
67 
68 
75  virtual bool16 IsVisible() const = 0;
76 
80  virtual bool16 IsFloating() const = 0;
81 
85  virtual void Float() = 0;
86 
90  virtual bool16 IsMinimized() const = 0;
91 
95  virtual void Minimize() = 0;
96 
100  virtual bool16 IsMaximized() const = 0;
101 
105  virtual void Maximize() = 0;
106 
108  virtual bool16 IsActive() const = 0;
109 
111  virtual void MakeActive() = 0;
112 
117  virtual bool16 IsFrontmostInTabGroup() const = 0;
118 
121  virtual void MakeFrontmostInTabGroup() = 0;
122 
126  virtual SysRect GetPresentationBounds() const = 0;
127 
130  virtual SysRect GetPresentationPlatformBounds() const = 0;
131 
134  virtual SysSize GetPreferredSize() const = 0;
135  virtual void ChangePreferredSize(const SysSize&) = 0;
136 
139  virtual SysSize GetPreferredConstrainedSize() const = 0;
140 
143  virtual void ChangePreferredConstrainedSize(const SysSize&) = 0;
144 
145  // Get/Change allowable size ranges associated with a document window
146  // (Prior to CS3, this was done with calls to IWindow::Get/SetLimits)
147 
149  virtual void GetWidthRange(float* min, float* max) const = 0;
151  virtual void ChangeWidthRange(float min, float max) = 0;
152 
154  virtual void GetHeightRange(float* min, float* max) const = 0;
156  virtual void ChangeHeightRange(float min, float max) = 0;
157 
159  virtual bool16 GetDocumentModifiedState() const = 0;
160 
162  virtual void ChangeDocumentModifiedState(bool16) = 0;
163 
167  enum { kDefaultParentingPref = 0,
168  kCreateNewFloatingDock = 1,
169  kCreateNewFloatingDock_ObscureRelative = 2,
170  kCreateNewFloatingDock_DontObscureRelative = 3,
171  kAsSiblingOfRelative = 4, // add at end of same group as sibling
172  kInNewTabGroupFromRelative = 5,
173  kInNewPaneFromRelative = 6,
174  kAsSiblingToLeftOfRelative = 7,
175  kAsRightmostChildOfParent = 8,
176 
177  kLastParentRelativePref = kAsRightmostChildOfParent,
178  kParentingRelatedPrefMask = 255, // use this mask when comparing parent related prefs
179 
180  kDontMakeVisible = 512, // by default the new presentation is made visible, set this bit to keep document hidden
181  kDontBringToFront = 1024, // by default the new presentation is also brought to the front, set this bit to put the document behing the current front document
182 
183  kLastParentingFlag = kDontBringToFront,
184  };
185  typedef uint16 CreationParentingPrefs;
186 
193  virtual IDocumentPresentation* CreateNewPresentation( IDocument* doc, IPMUnknown* targetBossContentToSelect, CreationParentingPrefs parentPref = kCreateNewFloatingDock_ObscureRelative) const = 0;
194 
199  virtual IDocumentPresentation* ViewInNewPresentation( GSysRect withinBounds, CreationParentingPrefs parentPref = kDefaultParentingPref) const = 0;
200 
207  virtual ICommand* CreateCloseCommand(bool16 allowCancel = kTrue) = 0;
208 
216  enum SchedulingBehavior {kProcessCommandBehavior = 0, kScheduleCommandBehavior = 1};
217  virtual ErrorCode ClosePresentation(SchedulingBehavior when = kProcessCommandBehavior, bool16 allowCancel = kFalse) = 0;
218 
223  virtual bool16 IsAutonomous() = 0;
224 
241  virtual void GetPresentationLabels(PMString& titleLabel, PMString& extendedTitleLabel, PMString& toolTipLabel) const = 0;
242 
248  virtual void SetPresentationLabels(const PMString& titleLabel, const PMString& extendedTitleLabel, const PMString& toolTipLabel = kNullString) = 0;
249 
264  virtual K2Vector<IDocumentPresentation*>::iterator UpdatePresentationLabels( K2Vector<IDocumentPresentation*>::iterator begin, K2Vector<IDocumentPresentation*>::iterator end) = 0;
265 
274  virtual bool16 Helper_InstallPresentationContent( IDocument* doc, IPMUnknown* commandData, IControlView* mimicView = nil) = 0;
275 
281  {
282  public:
283  virtual ~SamePresentationKind(){}
284  virtual bool16 operator()(IDocumentPresentation* other) = 0;
285  };
286 
290  {
291  public:
292  virtual ~SamePresentationContent(){}
293  virtual bool16 operator()(IDocumentPresentation* other) = 0;
294  };
295 
300 
301 
307 
316  virtual ErrorCode SelectScriptObjects (const ScriptID& action, ScriptList& objectList, const ScriptInfo::RequestContext& context) = 0;
317 
322  virtual IControlView* QuerySelectableView (ISelectionManager* iSelectionManager) = 0;
323 
329  virtual bool16 SetupTarget( IPMUnknown* selectedContent) = 0;
330 
341  virtual bool16 EditTarget( PMString* menuString, IPMUnknown* selectedContent) = 0;
342 
345  virtual void RegisterSelectableView (IControlView*) = 0;
346 
349  virtual void UnregisterSelectableView (IControlView*) = 0;
350 
353  virtual void GetSelectableViews (K2Vector<IControlView*>& views) = 0;
354 
357  virtual bool16 IsPresentationActiveInTouchWorkspace() = 0;
358 
361  virtual void SetPresentationActiveInTouchWorkspace(bool16 bFlag) = 0;
362 };
363 
364 typedef bool (unary_presentation_predicate)(IDocumentPresentation*);
365 typedef bool (binary_presentation_predicate)(IDocumentPresentation*, IDocumentPresentation*);
366 
367 
368 
369 #endif