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

#include <IOwnedItem.h>

Inheritance diagram for IOwnedItem:
IPMUnknownCOwnedItemHidTxtOwnedItem

Public Types

enum  { kDefaultIID = IID_IOWNEDITEM }
 

Public Member Functions

virtual void SetDiskPage (UID diskPage)=0
 
virtual UID GetDiskPage () const =0
 
virtual TextIndex GetTextIndex () const =0
 
virtual UID GetTextModelUID () const =0
 
virtual ITextModelQueryTextModel () const =0
 
virtual UIDRef GetFrameRef () const =0
 
virtual ITextFrameColumnQueryFrame () const =0
 
virtual PMRect GetInkBounds (void) const =0
 
virtual ICommandQueryRemoveFromDocumentCmd () const =0
 
virtual ITextModelMementoQueryMemento () const =0
 
virtual int32 GetNumSpecialAnchorChars () const =0
 
virtual bool16 GetIsParcelPositionDependent () const =0
 
virtual void CollectStoryRanges (Text::StoryRangeList *rList, TextIndex hIndex=kInvalidTextIndex, Text::HIndexList *hIndexList=nil) const =0
 
virtual void CollectChildren (VisitorHelperList *rList) const =0
 
virtual void CollectChildren (VisitorHelperList *rList, const PMRect *pHitRect, const bool16 useParcelInkBounds) const =0
 
virtual bool16 Moved (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)=0
 
virtual void MovedIntoOverset (IParcelList *pl)=0
 
virtual void Applied (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)=0
 
virtual void StoryThreadChanged (UID newDictUID, uint32 newDictKey)=0
 
virtual void StoryDirectionChanged ()=0
 
virtual IParagraphComposerQueryComposer () const =0
 
virtual void StoryAccessChanged (TextStory_StoryAccess access)=0
 
virtual bool16 GetAreAnchorCharsFindable () const =0
 
virtual bool16 GetHasStandOff () const =0
 
virtual void Rebuilt (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, IWaxRun *waxRun, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)=0
 
virtual void Rebuilt (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, IWaxRun *waxRun, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex, bool16 *damagedBack)=0
 
virtual void LayerChanged (const IDocumentLayer *newDocLayer)=0
 
virtual void VisibilityChanged ()=0
 
virtual void ZOrderChanged ()=0
 
virtual bool16 GetContainsOversetContent () const =0
 
virtual void ParcelMoved ()=0
 
virtual void ParcelResized ()=0
 
virtual ITextStoryThreadQueryStoryThread () const =0
 
virtual IParcelListQueryParcelList () const =0
 
virtual ITextParcelListQueryTextParcelList () const =0
 
virtual bool16 GetCanReturnIScript () const =0
 
virtual IScriptQueryIScript (const ScriptInfo::RequestContext &context) const =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

IOwnedItems are UID based bosses that are anchored to a specific text position in the ITextModel via a call to IItemStrand::SetOwnedUID(). All bosses anchored in this way are required to implement the IOwnedItem interface. This interface allows notification to the IOwnedItem about events within the ITextModel, such as composition, deletion, etc and to provide information to the Text subsytem about the properties of the IOwnedItem that affect the user experience.

Some IOwnedItems, such as Inlines, Footnotes, Tables and Notes have one or more contiguous special characters that they insert which the IOwnedItem is anchored to. Some of these characters are findable though find/change, in the case of Inlines, Notes and Footnotes, and others are not in the case of Tables.

IOwnedItems are not required to have special anchor characters. Hyperlinks simply attach themselves to the two ends of the desired range without inserting any special characters into the ITextModel.

Notifcation of ITextModel events, such as delete, copy, paste, etc is done through the ITextModelMomento interface which the IOwnedItem is required to implement and return via the IOwnedItem::QueryMemento() method. This hooks allows the ITextModel to provide full context of the ITextModel operations and thus give the IOwnedItem flexibility to do what it needs to accomplish its goals.

See Also
COwnedItem
IItemStrand
ITextFrameColumn
ITextModel
ITextStoryThread
ITextModelMomento

Member Function Documentation

virtual void IOwnedItem::Applied (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
pure virtual

Called when the IWaxLine has been applied into the wax. This method is always called BEFORE Rebuilt(). The specified IWaxLine will be undamaged and have a valid ParcelKey.

Parameters
textModelThe ITextModel containing the IOwnedItem
plIParcelList of the TextStoryThread containing the IWaxLine
waxLineThe IWaxLine containing the IOwnedItem
ownedItemTextIndexThe TextIndex of the IOwnedItem
waxLineTextIndexThe TextIndex of the IWaxLine

Implemented in HidTxtOwnedItem, and COwnedItem.

virtual void IOwnedItem::CollectChildren (VisitorHelperListrList) const
pure virtual

Get a list of visitable children of the IOwnedItem.

Parameters
rListVisitorHelperList to fill

Implemented in COwnedItem.

virtual void IOwnedItem::CollectChildren (VisitorHelperListrList,
const PMRectpHitRect,
const bool16 useParcelInkBounds 
) const
pure virtual

Get a list of visitable children of the IOwnedItem based on a hit rectangle in local (not Wax) coordinates.

Parameters
rListVisitorHelperList to fill
pHitRectPointer to PMRect in local coordinates to use as the point clicked
useParcelInkBoundsIf kTrue, find the parcels using their inkbounds rather than their implicit bounding box. Only an issue when the IOwnedItem supports multiple children, for examples Tables or Footnotes.

Implemented in COwnedItem.

virtual void IOwnedItem::CollectStoryRanges (Text::StoryRangeListrList,
TextIndex hIndex = kInvalidTextIndex,
Text::HIndexListhIndexList = nil 
) const
pure virtual

Some IOwnedItems may manage portions of the same ITextModel that the IOwnedItem itself is in. Consider the example of Tables or Notes which create ITextStoryThreads to hold text data. This information is considered independent of composed state because it is model data. This method adds StoryRanges that are associated with this IOwnedItem to the result list. The ranges returned are in logical order (as the user perceives it) rather than in the order it appears in the ITextModel. So the callee is required to search for other IOwnedItems within it's range and call them. Note that adjacent IOwnedItems may simply be elements of a common object, such as in the case of Tables, so it is upto the implementation to decide how to deal with dividing up ownership of the common object between the various IOwnedItems.

See Also
ITextUtils::CollectStoryRanges()
Parameters
rListThe list to add ranges to. See ITextUtils::CollectStoryRanges()
hIndexHierarchy index. See ITextUtils::CollectStoryRanges()
hIndexListHierarchy list. See ITextUtils::CollectStoryRanges()

Implemented in COwnedItem.

virtual bool16 IOwnedItem::GetAreAnchorCharsFindable () const
pure virtual

Some anchor characters are accessible through Find/Change. Table anchors are not, Footnotes and Notes are.

Returns
kTrue if the anchor characters specified above (if non-zero) are accessable through Find/Change.

Implemented in COwnedItem.

virtual bool16 IOwnedItem::GetCanReturnIScript () const
pure virtual

The OwnedItem is asked it supports Scripting - the object itself does not have to have an IScript, just that it will return an object that does if asked.

Returns
kTrue if the OwnedItem can return an object with an IScript interfaces, kFalse otherwise.

Implemented in COwnedItem.

virtual bool16 IOwnedItem::GetContainsOversetContent () const
pure virtual

Returns kTrue if the OwnedItem manages StoryRanges and any of these are overset.

Returns
kTrue if any child StoryRanges are overset, kFalse otherwise.

Implemented in COwnedItem.

virtual UID IOwnedItem::GetDiskPage () const
pure virtual

Get the IVOSDiskPage that the IOwnedItem is mapped to.

Returns
UID of IVOSDiskPage or kInvalidUID if not part of strand

Implemented in COwnedItem.

virtual UIDRef IOwnedItem::GetFrameRef () const
pure virtual

The ITextFrameColumn the IOwnedItem is associated with based on the TextIndex returned by GetTextIndex(). If the anchoring position is in overset then the returned value will be invalid.

Returns
UIDRef of the ITextFrameColumn

Implemented in COwnedItem.

virtual bool16 IOwnedItem::GetHasStandOff () const
pure virtual

IOwnedItems that affect composition, such as Inlines with TextWrap, are considered to have a standoff.

Returns
kTrue if the the IOwnedItem will cause TextWrap on other IWaxLines in the same ITextStoryThread.

Implemented in COwnedItem.

virtual PMRect IOwnedItem::GetInkBounds (void ) const
pure virtual

Returns the ink bounds of this IOwnedItem in Wax coordinates. Implementations that need any support for hittesting or cursors may simply return kZeroRect.

Returns
bounds in local coords

Implemented in COwnedItem.

virtual bool16 IOwnedItem::GetIsParcelPositionDependent () const
pure virtual

IOwnedItems which manage other composed Text, such as Tables, or those that maintain links to the ISpread, such as Inlines, need to be informed when the IParcel that IOwnedItem is composed into has moved relative to the Pasteboard. Notification is done through the IOwnedItem::Moved() method. Note that IOwnedItems that return kFalse from this method may still get notified on occasion, but are not guaranteed to be in all circumstances.

Returns
kTrue if the IOwnedItem requires notification, kFalse otherwise.

Implemented in COwnedItem.

virtual int32 IOwnedItem::GetNumSpecialAnchorChars () const
pure virtual

Special anchor characters are used by some IOwnedItems to anchor themselves into the ITextModel. The value returned by this method allows others to skip over the correct number of anchor characters when processing text containing the IOwnedItem. For example, Notes and Footnotes use one special anchor, Tables have a variable number and Hyperlinks and Indexes have no special anchors.

Implemented in HidTxtOwnedItem.

virtual TextIndex IOwnedItem::GetTextIndex () const
pure virtual

Returns the TextIndex where the IOwnedItem is anchored in. If the IOwnedItem is not registered, that is it has kInvalidUID for the disk page, then the returned value will be kInvalidTextIndex.

Returns
TextIndex in the ITextModel where the IOwnedItem is anchored.

Implemented in COwnedItem.

virtual UID IOwnedItem::GetTextModelUID () const
pure virtual

Returns the ITextModel the IOwnedItem is anchored in. If the IOwnedItem is not registered, that is it has kInvalidUID for the disk page, then the returned value will be kInvalidUID.

Returns
UID of ITextModel that IOwnedItem is anchored in.

Implemented in COwnedItem.

virtual void IOwnedItem::LayerChanged (const IDocumentLayernewDocLayer)
pure virtual

Called when the Parcel containing the IOwnedItem has changed its Layer.

Implemented in COwnedItem.

virtual bool16 IOwnedItem::Moved (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
pure virtual

Called when the IWaxLine containing the IOwnedItem is re-composed by shuffling rather than being re-created and Applied. The specified IWaxLine will be undamaged and have a valid ParcelKey.

Parameters
textModelThe ITextModel containing the IOwnedItem
plIParcelList of the TextStoryThread containing the IWaxLine
waxLineThe IWaxLine containing the IOwnedItem
ownedItemTextIndexThe TextIndex of the IOwnedItem
waxLineTextIndexThe TextIndex of the IWaxLine
Returns
kTrue if the implementation affects WaxRun composition and it believes that it's composition may have changed, kFalse otherwise. Most implementations will return kFalse for this.

Implemented in HidTxtOwnedItem, and COwnedItem.

virtual void IOwnedItem::MovedIntoOverset (IParcelListpl)
pure virtual

Called when the IOwnedItem has been moved into overset. This may be called more than one during composition of the IWaxLine containing the IOwnedItem due to the need to handle ripple between IParcels.

Parameters
plIParcelList of the ITextStoryThread containing the IWaxLine

Implemented in HidTxtOwnedItem, and COwnedItem.

virtual void IOwnedItem::ParcelMoved ()
pure virtual

Called when the Parcel containing the IOwnedItem has moved relative to the spread. Implementations must return kTrue for IOwnedItem::GetIsParcelPositionDependent() to guarantee that they will be called, although they should be prepared to be called even though they did not return kTrue. This is because the WaxLine that the IOwnedItem is composed into will notify all IOwnedItems on the same WaxLine if any of the IOwnedItems returned kTrue.

Implemented in HidTxtOwnedItem, and COwnedItem.

virtual void IOwnedItem::ParcelResized ()
pure virtual

Called when the Parcel containing the IOwnedItem has been resized. This will only occur if the Parcel thinks there is position dependent content and that state will be cleared if the Parcel is moved, for example. Thus do not rely on this notification separate from a move. Implementations must return kTrue for IOwnedItem::GetIsParcelPositionDependent() to guarantee that they will be called, although they should be prepared to be called even though they did not return kTrue.

Implemented in COwnedItem.

virtual IParagraphComposer* IOwnedItem::QueryComposer () const
pure virtual

This method is the trigger that allows an IOwnedItem to override the default IParagraphComposer of the IWaxLine that contains it. This method will be called if the IOwnedItem is a the first TextIndex of a damaged line, or is preceeded by zero or more occurances of kTextChar_ZeroSpaceNoBreak. Note that there are quite a few restrictions to this. For example, if the IParagraphComposer which owns the paragraph containing the IOwnedItem decides to compose the character the IOwnedItem is mapped to the IOwnedItem will never get called. Some work arounds to this problem are to either make sure your IOwnedItem is preceeded by a kTextChar_CR or kTextChar_SoftCR. In practice the only implementation supporting this is kWaxAnchorComposerImpl which supports the IWaxAnchorPt interface on the boss of the IOwnedItem. Tables rely on this mechanism.

Implemented in COwnedItem.

virtual ITextFrameColumn* IOwnedItem::QueryFrame () const
pure virtual

The ITextFrameColumn the IOwnedItem is associated with based on the TextIndex returned by GetTextIndex(). If the anchoring position is in ovrset then the returned value will be invalid.

Returns
Pointer to ITextFrameColumn

Implemented in COwnedItem.

virtual IScript* IOwnedItem::QueryIScript (const ScriptInfo::RequestContextcontext) const
pure virtual

The OwnedItem is asked to return an object associated with it that supports scripting. The OwnedItem does not necessarily have to have an IScript to do this - just that it returns something. asked.

Returns
Pointer to boss with IScript interface

Implemented in COwnedItem.

virtual ITextModelMemento* IOwnedItem::QueryMemento () const
pure virtual

The ITextModelMomento provides a mechanism for the ITextModel to notify the IOwnedItem about changes to the model that affect the IOwnedItem.

Returns
Pointer to Memento for this IOwnedItem.

Implemented in HidTxtOwnedItem.

virtual IParcelList* IOwnedItem::QueryParcelList () const
pure virtual

Returns the IParcelList associated with the ITextStoryThread the IOwnedItem is mapped to. May be nil.

Implemented in COwnedItem.

virtual ICommand* IOwnedItem::QueryRemoveFromDocumentCmd () const
pure virtual

When the ITextModel the IOwnedItem is anchored in is being deleted it will query the IOwnedItems via this method for Command to remove it from the document. At the time the returned command is executed the ITextModel will be in an indeterminate state and so it must not access it in any way. This includes calling IOwnedItem::GetDiskPage(), IOwnedItem::GetTextIndex(), IOwnedItem::QueryTextModel(), IOwnedItem::GetFrameRef() and IOwnedItem::QueryFrame(). Further, this command should NOT remove any Text (ITextStoryThreads, etc) in the same ITextModel as a result of this operation - the entire ITextModel is processed at this time and anything in those ITextStoryThreads will be found. In addition, callees are NOT required to return a command if the IOwnedItem will be removed by another IOwnedItem in the same ITextModel.

Returns
Pointer to remove from document command

Implemented in HidTxtOwnedItem.

virtual ITextStoryThread* IOwnedItem::QueryStoryThread () const
pure virtual

Returns the ITextStoryThread the IOwnedItem is mapped to.

Returns
Pointer to ITextStoryThread.

Implemented in COwnedItem.

virtual ITextModel* IOwnedItem::QueryTextModel () const
pure virtual

Returns the ITextModel the IOwnedItem is anchored in. If the IOwnedItem is not registered, that is it has kInvalidUID for the disk page, then the returned value will be kInvalidUID.

Returns
Pointer to ITextModel that IOwnedItem is anchored in.

Implemented in COwnedItem.

virtual ITextParcelList* IOwnedItem::QueryTextParcelList () const
pure virtual

Returns the ITextParcelList associated with the ITextStoryThread the IOwnedItem is mapped to. May be nil. To determine the ParcelKey of the Parcel the IOwnedItem is composed into get the TextIndex of the IOwnedItem and pass it into ITextParcelList::GetParcelContaining().

Implemented in COwnedItem.

virtual void IOwnedItem::Rebuilt (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
IWaxRunwaxRun,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
pure virtual

Called when the IWaxRuns of the IWaxLine containing the IOwnedItem are re-built. Note that because during composition Rebuilt() will always be called before Moved(), Rebuilt() should not assume that the current position of the IWaxLine is the same as it was before.

Parameters
textModelThe ITextModel containing the IOwnedItem
plIParcelList of the TextStoryThread containing the IWaxLine
waxLineThe IWaxLine containing the IOwnedItem
waxRunThe IWaxRun containing the IOwnedItem
glyphIndexThe index of the IOwnedItem within the IWaxRun
ownedItemTextIndexThe TextIndex of the IOwnedItem
waxLineTextIndexThe TextIndex of the IWaxLine

Implemented in HidTxtOwnedItem, and COwnedItem.

virtual void IOwnedItem::Rebuilt (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
IWaxRunwaxRun,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex,
bool16 * damagedBack 
)
pure virtual

Overloaded funtion Not necessary to implement, it will call virtual void Rebuilt(ITextModel* textModel, IParcelList* pl, const IWaxLine* waxLine, IWaxRun* waxRun, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex) = 0; if implementation is not provided.

Called when the IWaxRuns of the IWaxLine containing the IOwnedItem are re-built. Note that because during composition Rebuilt() will always be called before Moved(), Rebuilt() should not assume that the current position of the IWaxLine is the same as it was before.

Parameters
textModelThe ITextModel containing the IOwnedItem
plIParcelList of the TextStoryThread containing the IWaxLine
waxLineThe IWaxLine containing the IOwnedItem
waxRunThe IWaxRun containing the IOwnedItem
glyphIndexThe index of the IOwnedItem within the IWaxRun
ownedItemTextIndexThe TextIndex of the IOwnedItem
waxLineTextIndexThe TextIndex of the IWaxLine
damagedBackIt is used to detect if owned item has damaged back something, if yes then composition will come back again to build. while rebuilding

Implemented in COwnedItem.

virtual void IOwnedItem::SetDiskPage (UID diskPage)
pure virtual

The IItemStrand will maintain the UID of the IVOSDiskPage that holds onto this IOwnedItem while is it part of the strand. This information is used by the IOwnedItem::GetTextIndex() method to efficiently determine the TextIndex within the ITextModel where this IOwnedItem is anchored.

Parameters
diskPageUID of IVOSDiskPage that the IOwned

Implemented in COwnedItem.

virtual void IOwnedItem::StoryAccessChanged (TextStory_StoryAccess access)
pure virtual

This method is called when the containg story has its story access changed. Callees with nested Stories, such as Inline TextFrames, must change the story access of their nested Stories to match.

Parameters
accessNew TextStory_StoryAccess of the containing ITextModel.

Implemented in COwnedItem.

virtual void IOwnedItem::StoryDirectionChanged ()
pure virtual

This method is called when the story direction of the owning ITextStoryThread is changed. Implementations that compose their own text are expected to something appropriate for their situation to ensure that their composition appropriately reflects the new direction.

Implemented in COwnedItem.

virtual void IOwnedItem::StoryThreadChanged (UID newDictUID,
uint32 newDictKey 
)
pure virtual

This method is called when the ITextStoryThread managing the range of Text containing the IOwnedItem is changed.

See Also
ITextStoryThread
Parameters
newDictUIDUID of managing ITextStoryThreadDict
newDictKeyKey assigned my managing ITextStoryThreadDict

Implemented in COwnedItem.

virtual void IOwnedItem::VisibilityChanged ()
pure virtual

Called when the Container of the Parcel containing the IOwnedItem changes its visibility.

Implemented in COwnedItem.

virtual void IOwnedItem::ZOrderChanged ()
pure virtual

Called when the Parcel containing the IOwnedItem may have changed its ZOrder.

Implemented in COwnedItem.