InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
COwnedItem Class Reference
Inheritance diagram for COwnedItem:
IOwnedItemIPMUnknownHidTxtOwnedItem

Public Member Functions

 COwnedItem (IPMUnknown *boss)
 
virtual void SetDiskPage (UID diskPage)
 
virtual UID GetDiskPage () const
 
virtual TextIndex GetTextIndex () const
 
virtual UID GetTextModelUID () const
 
virtual ITextModelQueryTextModel () const
 
virtual UIDRef GetFrameRef () const
 
virtual ITextFrameColumnQueryFrame () const
 
virtual PMRect GetInkBounds (void) const
 
virtual bool16 GetIsParcelPositionDependent () const
 
virtual void CollectStoryRanges (Text::StoryRangeList *rList, TextIndex hIndex, Text::HIndexList *hIndexList) const
 
virtual void CollectChildren (VisitorHelperList *rList, const PMRect *pHitRect, const bool16 useParcelInkBounds) const
 
virtual void CollectChildren (VisitorHelperList *rList) const
 
virtual bool16 Moved (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)
 
virtual void MovedIntoOverset (IParcelList *pl)
 
virtual void Applied (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)
 
virtual void StoryThreadChanged (UID newDictUID, uint32 newDictKey)
 
virtual void StoryDirectionChanged ()
 
virtual IParagraphComposerQueryComposer () const
 
virtual void StoryAccessChanged (TextStory_StoryAccess)
 
virtual bool16 GetAreAnchorCharsFindable () const
 
virtual bool16 GetHasStandOff () const
 
virtual void Rebuilt (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, IWaxRun *waxRun, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex)
 
virtual void Rebuilt (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, IWaxRun *waxRun, TextIndex ownedItemTextIndex, TextIndex waxLineTextIndex, bool16 *damagedBack)
 
virtual void LayerChanged (const IDocumentLayer *newDocLayer)
 
virtual void VisibilityChanged ()
 
virtual void ZOrderChanged ()
 
virtual bool16 GetContainsOversetContent () const
 
virtual void ParcelMoved ()
 
virtual void ParcelResized ()
 
virtual ITextStoryThreadQueryStoryThread () const
 
virtual IParcelListQueryParcelList () const
 
virtual ITextParcelListQueryTextParcelList () const
 
bool16 GetCanReturnIScript () const
 
IScriptQueryIScript (const ScriptInfo::RequestContext &context) const
 
void ReadWrite (IPMStream *s, ImplementationID i)
 
- Public Member Functions inherited from IOwnedItem
virtual ICommandQueryRemoveFromDocumentCmd () const =0
 
virtual ITextModelMementoQueryMemento () const =0
 
virtual int32 GetNumSpecialAnchorChars () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Protected Attributes

UID fDiskPage
 

Additional Inherited Members

- Public Types inherited from IOwnedItem
enum  { kDefaultIID = IID_IOWNEDITEM }
 

Member Function Documentation

virtual void COwnedItem::Applied (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
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

Implements IOwnedItem.

Reimplemented in HidTxtOwnedItem.

virtual void COwnedItem::CollectChildren (VisitorHelperListrList,
const PMRectpHitRect,
const bool16 useParcelInkBounds 
) const
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.

Implements IOwnedItem.

virtual void COwnedItem::CollectChildren (VisitorHelperListrList) const
virtual

Get a list of visitable children of the IOwnedItem.

Parameters
rListVisitorHelperList to fill

Implements IOwnedItem.

virtual void COwnedItem::CollectStoryRanges (Text::StoryRangeListrList,
TextIndex hIndex,
Text::HIndexListhIndexList 
) const
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()

Implements IOwnedItem.

virtual bool16 COwnedItem::GetAreAnchorCharsFindable () const
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.

Implements IOwnedItem.

bool16 COwnedItem::GetCanReturnIScript () const
virtual

In general, no, the exception being if the OwnedItem boss has an IScript.

Implements IOwnedItem.

virtual bool16 COwnedItem::GetContainsOversetContent () const
virtual

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

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

Implements IOwnedItem.

virtual UID COwnedItem::GetDiskPage () const
virtual

Get the IVOSDiskPage that the IOwnedItem is mapped to.

Returns
UID of IVOSDiskPage or kInvalidUID if not part of strand

Implements IOwnedItem.

virtual UIDRef COwnedItem::GetFrameRef () const
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

Implements IOwnedItem.

virtual bool16 COwnedItem::GetHasStandOff () const
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.

Implements IOwnedItem.

virtual PMRect COwnedItem::GetInkBounds (void ) const
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

Implements IOwnedItem.

virtual bool16 COwnedItem::GetIsParcelPositionDependent () const
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.

Implements IOwnedItem.

virtual TextIndex COwnedItem::GetTextIndex () const
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.

Implements IOwnedItem.

virtual UID COwnedItem::GetTextModelUID () const
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.

Implements IOwnedItem.

virtual void COwnedItem::LayerChanged (const IDocumentLayernewDocLayer)
virtual

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

Implements IOwnedItem.

virtual bool16 COwnedItem::Moved (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
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.

Implements IOwnedItem.

Reimplemented in HidTxtOwnedItem.

virtual void COwnedItem::MovedIntoOverset (IParcelListpl)
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

Implements IOwnedItem.

Reimplemented in HidTxtOwnedItem.

virtual void COwnedItem::ParcelMoved ()
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.

Implements IOwnedItem.

Reimplemented in HidTxtOwnedItem.

virtual void COwnedItem::ParcelResized ()
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.

Implements IOwnedItem.

virtual IParagraphComposer* COwnedItem::QueryComposer () const
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.

Implements IOwnedItem.

virtual ITextFrameColumn* COwnedItem::QueryFrame () const
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

Implements IOwnedItem.

IScript* COwnedItem::QueryIScript (const ScriptInfo::RequestContextcontext) const
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

Implements IOwnedItem.

virtual IParcelList* COwnedItem::QueryParcelList () const
virtual

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

Implements IOwnedItem.

virtual ITextStoryThread* COwnedItem::QueryStoryThread () const
virtual

Returns the ITextStoryThread the IOwnedItem is mapped to.

Returns
Pointer to ITextStoryThread.

Implements IOwnedItem.

virtual ITextModel* COwnedItem::QueryTextModel () const
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.

Implements IOwnedItem.

virtual ITextParcelList* COwnedItem::QueryTextParcelList () const
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().

Implements IOwnedItem.

virtual void COwnedItem::Rebuilt (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
IWaxRunwaxRun,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex 
)
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

Implements IOwnedItem.

Reimplemented in HidTxtOwnedItem.

virtual void COwnedItem::Rebuilt (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
IWaxRunwaxRun,
TextIndex ownedItemTextIndex,
TextIndex waxLineTextIndex,
bool16 * damagedBack 
)
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

Implements IOwnedItem.

virtual void COwnedItem::SetDiskPage (UID diskPage)
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

Implements IOwnedItem.

virtual void COwnedItem::StoryAccessChanged (TextStory_StoryAccess access)
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.

Implements IOwnedItem.

virtual void COwnedItem::StoryDirectionChanged ()
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.

Implements IOwnedItem.

virtual void COwnedItem::StoryThreadChanged (UID newDictUID,
uint32 newDictKey 
)
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

Implements IOwnedItem.

virtual void COwnedItem::VisibilityChanged ()
virtual

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

Implements IOwnedItem.

virtual void COwnedItem::ZOrderChanged ()
virtual

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

Implements IOwnedItem.