InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDocumentPresentation Class Referenceabstract

#include <IDocumentPresentation.h>

Inheritance diagram for IDocumentPresentation:
IPMUnknown

Classes

class  SamePresentationContent
 
class  SamePresentationKind
 

Public Types

enum  { kDefaultIID = IID_IDOCUMENTPRESENTATION }
 
enum  {
  kDefaultParentingPref = 0, kCreateNewFloatingDock = 1, kCreateNewFloatingDock_ObscureRelative = 2, kCreateNewFloatingDock_DontObscureRelative = 3,
  kAsSiblingOfRelative = 4, kInNewTabGroupFromRelative = 5, kInNewPaneFromRelative = 6, kAsSiblingToLeftOfRelative = 7,
  kAsRightmostChildOfParent = 8, kLastParentRelativePref = kAsRightmostChildOfParent, kParentingRelatedPrefMask = 255, kDontMakeVisible = 512,
  kDontBringToFront = 1024, kLastParentingFlag = kDontBringToFront
}
 
enum  SchedulingBehavior { kProcessCommandBehavior = 0, kScheduleCommandBehavior = 1 }
 
typedef uint16 CreationParentingPrefs
 

Public Member Functions

virtual IDocumentGetDocument () const =0
 
virtual UIDRef GetDocumentUIDRef () const =0
 
virtual bool16 IsVisible () const =0
 
virtual bool16 IsFloating () const =0
 
virtual void Float ()=0
 
virtual bool16 IsMinimized () const =0
 
virtual void Minimize ()=0
 
virtual bool16 IsMaximized () const =0
 
virtual void Maximize ()=0
 
virtual bool16 IsActive () const =0
 
virtual void MakeActive ()=0
 
virtual bool16 IsFrontmostInTabGroup () const =0
 
virtual void MakeFrontmostInTabGroup ()=0
 
virtual SysRect GetPresentationBounds () const =0
 
virtual SysRect GetPresentationPlatformBounds () const =0
 
virtual SysSize GetPreferredSize () const =0
 
virtual void ChangePreferredSize (const SysSize &)=0
 
virtual SysSize GetPreferredConstrainedSize () const =0
 
virtual void ChangePreferredConstrainedSize (const SysSize &)=0
 
virtual void GetWidthRange (float *min, float *max) const =0
 
virtual void ChangeWidthRange (float min, float max)=0
 
virtual void GetHeightRange (float *min, float *max) const =0
 
virtual void ChangeHeightRange (float min, float max)=0
 
virtual bool16 GetDocumentModifiedState () const =0
 
virtual void ChangeDocumentModifiedState (bool16)=0
 
virtual IDocumentPresentationCreateNewPresentation (IDocument *doc, IPMUnknown *targetBossContentToSelect, CreationParentingPrefs parentPref=kCreateNewFloatingDock_ObscureRelative) const =0
 
virtual IDocumentPresentationViewInNewPresentation (GSysRect withinBounds, CreationParentingPrefs parentPref=kDefaultParentingPref) const =0
 
virtual ICommandCreateCloseCommand (bool16 allowCancel=kTrue)=0
 
virtual ErrorCode ClosePresentation (SchedulingBehavior when=kProcessCommandBehavior, bool16 allowCancel=kFalse)=0
 
virtual bool16 IsAutonomous ()=0
 
virtual void GetPresentationLabels (PMString &titleLabel, PMString &extendedTitleLabel, PMString &toolTipLabel) const =0
 
virtual void SetPresentationLabels (const PMString &titleLabel, const PMString &extendedTitleLabel, const PMString &toolTipLabel=kNullString)=0
 
virtual K2Vector
< IDocumentPresentation * >
::iterator 
UpdatePresentationLabels (K2Vector< IDocumentPresentation * >::iterator begin, K2Vector< IDocumentPresentation * >::iterator end)=0
 
virtual bool16 Helper_InstallPresentationContent (IDocument *doc, IPMUnknown *commandData, IControlView *mimicView=nil)=0
 
virtual SamePresentationKindGetPresentationKind ()=0
 
virtual SamePresentationContentGetPresentationContent ()=0
 
virtual ErrorCode SelectScriptObjects (const ScriptID &action, ScriptList &objectList, const ScriptInfo::RequestContext &context)=0
 
virtual IControlViewQuerySelectableView (ISelectionManager *iSelectionManager)=0
 
virtual bool16 SetupTarget (IPMUnknown *selectedContent)=0
 
virtual bool16 EditTarget (PMString *menuString, IPMUnknown *selectedContent)=0
 
virtual void RegisterSelectableView (IControlView *)=0
 
virtual void UnregisterSelectableView (IControlView *)=0
 
virtual void GetSelectableViews (K2Vector< IControlView * > &views)=0
 
virtual bool16 IsPresentationActiveInTouchWorkspace ()=0
 
virtual void SetPresentationActiveInTouchWorkspace (bool16 bFlag)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface represents a view onto a document, and exists on the document presentation boss, along with IActiveContext, to designate an InDesign document presentation. IDocumentPresentation replaces the IWindow and IDocumentWindow interfaces with methods more appropriate to the new world of OWL hosted document views.

Note: In CS4 the IWindow interface on the presentation boss must not be used to manipulate the document view.

The document presentation boss bridges the gap between InDesign document views, and the OWL Palette world.

Member Enumeration Documentation

anonymous enum

CreationParentingPrefs allow a caller to specify how and where a new presentation will be created, optionally in relation to an existing presentation

Fire the command used to close this presentation. If closing this presentation would result in closing the document, don't hold a reference to the document when calling this method.

Parameters
whenwhether to process the close command immediately or schedule it.
allowCancelif closing the presentation would result in closing the document, can the close be cancelled.
Returns
the result of processing the command to close this presentation.

Member Function Documentation

virtual void IDocumentPresentation::ChangeDocumentModifiedState (bool16 )
pure virtual

Change the document's modified state as cached, and displayed, by the presentation.

virtual void IDocumentPresentation::ChangeHeightRange (float min,
float max 
)
pure virtual

Change allowable height range for this presentation

virtual void IDocumentPresentation::ChangePreferredConstrainedSize (const SysSize)
pure virtual

Change the preferred size, when constrained to fit within the application container, for this presentation.

virtual void IDocumentPresentation::ChangeWidthRange (float min,
float max 
)
pure virtual

Change allowable width range for this presentation

virtual ICommand* IDocumentPresentation::CreateCloseCommand (bool16 allowCancel = kTrue)
pure virtual

Create the command needed to close this presentation. If closing this presentation would result in closing the document, don't hold a reference to the document when processing the returned command.

Parameters
allowCancelwhether the command may be canceled
Returns
a command which, when executed, will close this presentation
virtual IDocumentPresentation* IDocumentPresentation::CreateNewPresentation (IDocumentdoc,
IPMUnknowntargetBossContentToSelect,
CreationParentingPrefs parentPref = kCreateNewFloatingDock_ObscureRelative 
) const
pure virtual

Create a new document container like this one that views the specified document content.

Parameters
docThe document to view
targetBossContentToSelectThe content to view and select.
parentPrefwas: Either kOffsetFromCurrentWindow or kDirectlyOverCurrentWindow.
Returns
the new presentation or nil if it failed. Caller is not responsible for releasing the returned presentation.
virtual bool16 IDocumentPresentation::EditTarget (PMStringmenuString,
IPMUnknownselectedContent 
)
pure virtual

if this presentation cannot select any of the content on any of the targeting interfaces of selectedContent then return kFalse. Otherwise, remove the content the presentation can select from the targeting boss selectedContent and return kTrue. Further if menuString is nil, bring this presentation to the front, restoring itself from a minimized state if necessary, and select the specified content. If menuString is non-nil, then simply fill in an appropriate menu string without selecting the content.

Parameters
menuStringThe menu string used to invoke this action.
selectedContentA boss containing the targets to be selected.
virtual void IDocumentPresentation::Float ()
pure virtual

If this presentation is not contained in a floating container, create a new floating document dock and reparent the presentation to it.

virtual IDocument* IDocumentPresentation::GetDocument () const
pure virtual

Get the document being viewed by this presentation.

virtual bool16 IDocumentPresentation::GetDocumentModifiedState () const
pure virtual

Get the document's modified state as cached, and displayed, by the presentation.

virtual UIDRef IDocumentPresentation::GetDocumentUIDRef () const
pure virtual

Get the document being viewed by this presentation.

virtual void IDocumentPresentation::GetHeightRange (float * min,
float * max 
) const
pure virtual

Get allowable height range for this presentation

virtual SysSize IDocumentPresentation::GetPreferredConstrainedSize () const
pure virtual

Set the preferred size, when constrained to fit within the application container, for this presentation.

virtual SysSize IDocumentPresentation::GetPreferredSize () const
pure virtual

Set/Change the preferred size, when floating, for this presentation.

virtual SysRect IDocumentPresentation::GetPresentationBounds () const
pure virtual

Get the semantic bounds of this presentation. The semantic bounds may not match the current physical bounds if a layout in pending or in progress.

virtual SamePresentationContent* IDocumentPresentation::GetPresentationContent ()
pure virtual
Returns
a function that can be used to check if other document presentation are the same kind as this one and view the same document and document's content as this one. The caller is responsible for deleting the result
virtual SamePresentationKind* IDocumentPresentation::GetPresentationKind ()
pure virtual
Returns
a function that can be used to check if other document presentationa are the same kind as this one. The caller is responsible for deleting the result
virtual void IDocumentPresentation::GetPresentationLabels (PMStringtitleLabel,
PMStringextendedTitleLabel,
PMStringtoolTipLabel 
) const
pure virtual

Presentation titles/labels. There are three labels for every presentation. titleLabel - the essential unshortenable form of the title extendedTitleLabel - an extended form of the title, which may include magnification, and other document state information. toolTipLabel - the label used for the presentation's tab's tooltip

For example: titleLabel: "MyDocument.indd" extendedTitleLabel: "MyDocument.indd @ 100% [Converted]" toolTipLabel: "C:\Users\joe\Documents\MyDocument.indd"Get the labels for this presentation.

Parameters
titleLabelthe essential unshortenable form of the title
extendedTitleLabelan extended form of the title, which may include magnification, and other document state information.
toolTipLabelthe label used for the presentation's tab's tooltip
virtual SysRect IDocumentPresentation::GetPresentationPlatformBounds () const
pure virtual

Get the current physical bounds of this presentation.

virtual void IDocumentPresentation::GetSelectableViews (K2Vector< IControlView * > & views)
pure virtual

Internal use only

virtual void IDocumentPresentation::GetWidthRange (float * min,
float * max 
) const
pure virtual

Get allowable width range for this presentation

virtual bool16 IDocumentPresentation::Helper_InstallPresentationContent (IDocumentdoc,
IPMUnknowncommandData,
IControlViewmimicView = nil 
)
pure virtual

Helper called during construction of a new presentation instance. Presentation subclasses should override this call to create and install their content view(s). For example the LayoutPresentation class creates the LayoutWidget boss, installs it into the presentation, and makes it ready to go. Any additional hookups at creation time can be performed by the creation command, or by the code that processes the creation command.

Parameters
docThe document to view
Returns
whether or not installation was successful.
virtual bool16 IDocumentPresentation::IsActive () const
pure virtual

Is this the active/target presentation

virtual bool16 IDocumentPresentation::IsAutonomous ()
pure virtual

Can this presentation be the only presentation on a document? In other words, can this presentation "stand alone" for the document, if no such presentations are open the document must close.

Returns
whether this presentation can be the only presentation open on the document.
virtual bool16 IDocumentPresentation::IsFloating () const
pure virtual

Is this presentation contained in a floating container (as opposed to being embedded inside the ApplicationContainer)

virtual bool16 IDocumentPresentation::IsFrontmostInTabGroup () const
pure virtual

Is this presentation active amongst it's siblings (same tab group) ActiveInContext maps to "frontmost in it's tab group" - so the document is visible (if not obscured by something floating above it)

virtual bool16 IDocumentPresentation::IsMaximized () const
pure virtual

Is this presentation contained in a floating container that is maximized. (presentations embedded inside the ApplicationContainer can't be maximized)

virtual bool16 IDocumentPresentation::IsMinimized () const
pure virtual

Is this presentation contained in a floating container that is minimized (presentations embedded inside the ApplicationContainer can't be minimized)

virtual bool16 IDocumentPresentation::IsPresentationActiveInTouchWorkspace ()
pure virtual

Internal use only

virtual bool16 IDocumentPresentation::IsVisible () const
pure virtual

Get the PaletteRef corresponding to this document presentation. This should return an object of type kDocumentPresentationType.

See Also
PaletteRefUtils.h for tips on manipulating/traversing the PaletteRef object hierarchy.
PaletteRefUtils::GetDocumentPresentationFromPaletteRef, also related to IPanelMgr::GetPaletteRefContainingPanel.Is the presentation visible. Notes: Even though a presentation is obscured by a window floating above it, it is still considered visible. If a presentation is in a tabgroup, it is considered visible only if it is the front tab in the group.
virtual void IDocumentPresentation::MakeActive ()
pure virtual

Make this the active/target presentation

virtual void IDocumentPresentation::MakeFrontmostInTabGroup ()
pure virtual

Make this presentation frontmost amongst it's siblings

virtual void IDocumentPresentation::Maximize ()
pure virtual

If this presentation is contained in a floating container, toggle it's maximized state. (presentations embedded inside the ApplicationContainer can't be maximized)

virtual void IDocumentPresentation::Minimize ()
pure virtual

If this presentation is contained in a floating container, toggle it's minimized state. (presentations embedded inside the ApplicationContainer can't be minimized)

virtual IControlView* IDocumentPresentation::QuerySelectableView (ISelectionManageriSelectionManager)
pure virtual

Return the control view that owns an ASB subsystem

Parameters
iSelectionManagerA reference to a ASB sub system
Returns
the iControlView that owns the ASB
virtual void IDocumentPresentation::RegisterSelectableView (IControlView)
pure virtual

Internal use only

virtual ErrorCode IDocumentPresentation::SelectScriptObjects (const ScriptIDaction,
ScriptList & objectList,
const ScriptInfo::RequestContextcontext 
)
pure virtual

Miscellaneous other methods (formerly found in IDocumentWindow Select the objects in the scriptList in the correct ASB of this window

Parameters
actionHow to extend the selection (valid values: en_Replace, en_AddTo, en_RemoveFrom, en_Nothing, en_All)
scriptListThe scripting objects to select
contextThe context for the scripting request
Returns
the errorcode for the action
virtual void IDocumentPresentation::SetPresentationActiveInTouchWorkspace (bool16 bFlag)
pure virtual

Internal use only

virtual void IDocumentPresentation::SetPresentationLabels (const PMStringtitleLabel,
const PMStringextendedTitleLabel,
const PMStringtoolTipLabel = kNullString 
)
pure virtual

Set the labels for this presentation.

Parameters
titleLabelthe essential unshortenable form of the title
extendedTitleLabelan extended form of the title, which may include magnification, and other document state information.
toolTipLabelthe label used for the presentation's tab's tooltip
virtual bool16 IDocumentPresentation::SetupTarget (IPMUnknownselectedContent)
pure virtual

populate the targeting boss selectedContent with whatever is currently selected in the presentation.

Parameters
selectedContentA boss containing all the available targeting interfaces.
Returns
kTrue on success, kFalse on failure.
virtual void IDocumentPresentation::UnregisterSelectableView (IControlView)
pure virtual

Internal use only

virtual K2Vector<IDocumentPresentation*>::iterator IDocumentPresentation::UpdatePresentationLabels (K2Vector< IDocumentPresentation * >::iterator begin,
K2Vector< IDocumentPresentation * >::iterator end 
)
pure virtual

Update process for presentation titles/labels:

Seems simple enough, but the subtlety is that some of the titles are numbered, based on how many presentations of each type are open on the document. So for instance: StoryA 1, StoryA 2, StoryB 1, DocA 1, GalleyA 2, DocA 3, etc.

Steps: 1) Update the labels (title, tooltip label, etc.) of any presentations from *begin to *end that this implementation can handle. 2) Move the presentations that were updated to the front of the list 3) Return an iterator to the first presentations yet to have its title updated.

Parameters
beginthe first presentation in the list needing its labels updated.
endone past the last container in the list needing its labels updated.
Returns
the first container in the rearranged list that still needs its labels updated.
virtual IDocumentPresentation* IDocumentPresentation::ViewInNewPresentation (GSysRect withinBounds,
CreationParentingPrefs parentPref = kDefaultParentingPref 
) const
pure virtual

Create a new document container like this one that views the specified document content.

Parameters
withinBoundsConstrains the extent of the new container. // FIXME_OWL2: are these bounds still used/relevant?
Returns
a new container just like this one–same size, same document, same selection. Caller is not responsible for releasing the returned presentation.