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

#include <IOwnedItemIcons.h>

Inheritance diagram for IOwnedItemIcons:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IOWNEDITEMICONS }
 
enum  ItemType {
  kTable = 0, kInlineFrame, kHyperlink, kIndexMarker,
  kTextPageNum, kXMLBeginTag, kXMLEndTag, kNoteTag,
  kOtherType, kXMLStoryTag, kFootnoteTag, kFootnoteCharacter,
  kEndnoteCharacter, kAutoText, kHiddenText
}
 

Public Member Functions

virtual ItemType GetItemType (UIDRef textModelRef, UTF32TextChar character, TextIndex position, UID storyThreadUID=kInvalidUID)=0
 
virtual PMReal GetIconWidth (ItemType type, UIDRef textModelRef, TextIndex position, UID storyThreadUID=kInvalidUID)=0
 
virtual void Draw (ItemType type, const PMRect &itemRect, PMReal textYPosition, IGraphicsPort *gPort, UIDRef textModelRef, TextIndex position, int32 lineIndex, UID storyThreadUID=kInvalidUID)=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 inteface is used for the detection, drawing and measurement of icons display in story type views for items that have a character in the text stream with an associated owned item. Items like xml tags page numbers and other things are displayed using this interface.

Member Enumeration Documentation

Type of owned item icons supported are defined in this enum
Enumerator
kTable 

Table

kInlineFrame 

Inline text frame or picture frame

kHyperlink 

Hyperlink destination

kIndexMarker 

Index marker

kTextPageNum 

Page number character

kXMLBeginTag 

xml begin tag

kXMLEndTag 

xml end tag

kNoteTag 

note indicator, used in track change deleted text only

kOtherType 

means no icon

kXMLStoryTag 

story xml tag

kFootnoteTag 

footnote indicator, used in track change deleted text only

kFootnoteCharacter 

footnote reference number

kEndnoteCharacter 

used to denote endnotes anchor and text range

kAutoText 

Auto Text character

kHiddenText 

hidden text marker

Member Function Documentation

virtual void IOwnedItemIcons::Draw (ItemType type,
const PMRectitemRect,
PMReal textYPosition,
IGraphicsPortgPort,
UIDRef textModelRef,
TextIndex position,
int32 lineIndex,
UID storyThreadUID = kInvalidUID 
)
pure virtual

Draw an owned item at the given itemRect location. The itemRect width is same as return by GetIconWidth and is the height of the line of text the owned item resides in. The draw routine will draw. You may assume, the background has already been filled with the current galley background color.

Parameters
type- type of owned item icon to draw
itemRect- rectangle bounds to draw icon in
textYPosition- yPosition where text is drawn (used for icons that have text draw in combination with them like xml tags)
gPort- port to draw the icon into.
textModelRef- uid ref of the text model
position- text index the icon is associated with
lineIndex- index of the line the icon is being drawn in
storyThreadUID- if the text index is within track change deleted text should pass in a UID for the story thread of the deleted text.
Returns
width of the icon to be drawn
virtual PMReal IOwnedItemIcons::GetIconWidth (ItemType type,
UIDRef textModelRef,
TextIndex position,
UID storyThreadUID = kInvalidUID 
)
pure virtual

Return the width of an icon of ItemType. Should include any extra border space need for the icon. This is the. amount of space that will be inserted in the text to draw the icon. It's expected that the caller of this routine has already called GetItemType above and knows that an owned item is at the text index provided to this method.

Parameters
type- type of owned item icon to get width of
textModelRef- uid ref of the text model
position- text index the icon is associated with
storyThreadUID- if the text index is within track change deleted text should pass in a UID for the story thread of the deleted text.
Returns
width of the icon to be drawn
virtual ItemType IOwnedItemIcons::GetItemType (UIDRef textModelRef,
UTF32TextChar character,
TextIndex position,
UID storyThreadUID = kInvalidUID 
)
pure virtual

Figure out if the character is a supported owned item and return it's type if so otherwise return kOtherType. for kOtherType there may or may not be an owned item character associated with the character or not. Either way, this interface doesn't support icon display for it.

Parameters
textModelRef- uid ref of the text model
character- character code at the passed in TextIndex (next param). This is mostly to make it quicker to calculate since we typically know the character code already
position- text index to check for an owned item at
storyThreadUID- if the text index is within track change deleted text should pass in a UID for the story thread of the deleted text.
Returns
the type of item at the text index