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

#include <IXMLTagSuite.h>

Inheritance diagram for IXMLTagSuite:
IPMUnknown

Public Types

enum  AddOrRetagState {
  kAddEnabled, kRetagEnabled, kAddDisabled, kRetagDisabled,
  kNeitherDisabled
}
 
enum  { kDefaultIID = IID_IXMLTAGSUITE }
 
enum  MenuType { kInsertChildMenu, kInsertSiblingAfterMenu }
 

Public Member Functions

virtual UIDList GetTags ()=0
 
virtual ErrorCode SetTag (const UIDRef &tag, bool16 retag, bool16 allowPresetUI=kTrue)=0
 
virtual AddOrRetagState GetAddOrRetagState ()=0
 
virtual bool16 CanTag ()=0
 
virtual bool16 CanAutoTag ()=0
 
virtual ErrorCode AutoTag (bool16 allowPresetUI=kTrue)=0
 
virtual bool16 CanUnTag ()=0
 
virtual ErrorCode UnTag ()=0
 
virtual void GetUnTagString (PMString *untagStr)=0
 
virtual void GetMenuNamesForTags (K2Vector< PMString > *menuList, ActionID whichAction) const =0
 
virtual bool16 CanAddComment ()=0
 
virtual ErrorCode AddComment (const PMString &comment)=0
 
virtual ErrorCode ChangeComment (const PMString &comment)=0
 
virtual bool16 CanAddProcessingInstruction ()=0
 
virtual ErrorCode AddProcessingInstruction (const PMString &target, const PMString &data)=0
 
virtual ErrorCode ChangeProcessingInstruction (const PMString &target, const PMString &data)=0
 
virtual int32 FillInsertDynamicMenu (IXMLDTDInsertElementListData *insertElementListData, const K2Vector< PMString > &menuList, MenuType menuType)=0
 
virtual int32 FillReplaceDynamicMenu (IXMLDTDReplaceElementListData *ReplaceElementListData, const K2Vector< PMString > &menuList)=0
 
virtual bool16 CanMapSelectedStoriesStyles () const =0
 
virtual ErrorCode MapSelectedStoriesStyles () 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

Suite to manipulate tag (IXMLTag) properties in active selection; Provides clean, high level API to use from client code to access and change markup properties of selection. Aggregated on concrete selection bosses for selection formats such as text, layout and 'structure' (selections in the structure view).

Member Enumeration Documentation

States in which selection can be.

Which type of dynamic menu will be added
Enumerator
kInsertChildMenu 

Element will be a child of the selection

kInsertSiblingAfterMenu 

Element will be an after sibling of the selection

Member Function Documentation

virtual ErrorCode IXMLTagSuite::AddComment (const PMStringcomment)
pure virtual

Create a comment element for the selection

Parameters
commentspecifies the text to use for the comment
Returns
kSuccess if comment could be added successfully, kFailure otherwise
virtual ErrorCode IXMLTagSuite::AddProcessingInstruction (const PMStringtarget,
const PMStringdata 
)
pure virtual

Create a processing instruction for the selection

Parameters
targetspecifies the text to use for the target of the PI
dataspecifies the text to use for the data of the PI
Returns
kSuccess if processing instruction could be added successfully, kFailure otherwise
virtual ErrorCode IXMLTagSuite::AutoTag (bool16 allowPresetUI = kTrue)
pure virtual

Autotag the selected objects.

In the Tables case we would chose a default tag for story, table, cells. and the clients text selection would not be tagged.

Parameters
allowPresetUI- kTrue if the client doesn't mind if UI pops up during this action
Returns
whether or not this action succeeded.
virtual bool16 IXMLTagSuite::CanAddComment ()
pure virtual

Determine if abstract selection supports the capability to add a comment.

Returns
kTrue if selection can have a comment, kFalse otherwise
virtual bool16 IXMLTagSuite::CanAddProcessingInstruction ()
pure virtual

Determine if abstract selection supports the capability to add a processing instruction

Returns
kTrue if selection can have a processing instruction, kFalse otherwise
virtual bool16 IXMLTagSuite::CanAutoTag ()
pure virtual

Determine whether or not the current selection can be autotagged. Autotagging means that default tags are chosen for the selection rather than the user picking a specfic tag to use.

Returns
kTrue if selection can be autotagged (only if there are presets available.
virtual bool16 IXMLTagSuite::CanMapSelectedStoriesStyles () const
pure virtual

Can the current selection be tagged via Style to Tag Mapping? return – kTrue - The selection can be tagged, kFalse - The selection cannot be tagged

virtual bool16 IXMLTagSuite::CanTag ()
pure virtual

Determine whether or not the current selection can have a tag applied regular elements can but Comments, PIs and DTDs cannot..

Returns
kTrue if selection contains elements - kFalse if not
virtual bool16 IXMLTagSuite::CanUnTag ()
pure virtual

Determine if abstract selection supports the capability to Untag it.

Returns
kTrue if selection can be untagged, kFalse otherwise
virtual ErrorCode IXMLTagSuite::ChangeComment (const PMStringcomment)
pure virtual

Modify the selected comment to use the new string

Parameters
commentspecifies the text to use for the comment
Returns
kSuccess if comment could be added successfully, kFailure otherwise
virtual ErrorCode IXMLTagSuite::ChangeProcessingInstruction (const PMStringtarget,
const PMStringdata 
)
pure virtual

Modify the selected PI to use the new string

Parameters
targetspecifies the text to use for the target of the PI
dataspecifies the text to use for the data of the PI
Returns
kSuccess if PI could be added successfully, kFailure otherwise
virtual int32 IXMLTagSuite::FillInsertDynamicMenu (IXMLDTDInsertElementListData * insertElementListData,
const K2Vector< PMString > & menuList,
MenuType menuType 
)
pure virtual

Fill an insert dynamic menu with tag names based on the current selection

Parameters
insertElementListData- A list used to store elements referenced by menu items
menuList- The list of menus to be filled. A menu is denoted by its name (InsertChildTagPopup)
menuType- The type of menu we are building (child or sibling) #return - The number of items added to the menu
virtual int32 IXMLTagSuite::FillReplaceDynamicMenu (IXMLDTDReplaceElementListData * ReplaceElementListData,
const K2Vector< PMString > & menuList 
)
pure virtual

Fill a replace dynamic menu with tag names based on the current selection

Parameters
replaceElementListData- A list used to store elements referenced by menu items
menuList- The list of menus to be filled. A menu is denoted by its name (InsertChildTagPopup) #return - The number of items added to the menu
virtual AddOrRetagState IXMLTagSuite::GetAddOrRetagState ()
pure virtual

Determine state of the selection; if something's tagged already, then kRetagEnabled would be returned, or if it could be tagged, kAddEnabled.

Returns
AddOrRetagState specifying state of selection
virtual void IXMLTagSuite::GetMenuNamesForTags (K2Vector< PMString > * menuList,
ActionID whichAction 
) const
pure virtual

Get a list of menus that should have tags added to them. This allows the CSB to determine which menus get tag actions added to them rather than letting the client code try to figure out who to add tags for.

Parameters
*menuList- This is filled with a list of menus that need entries added to them
whichAction- The action for which we are adding new menu items
virtual UIDList IXMLTagSuite::GetTags ()
pure virtual

Returns a list of tags in the selection; ask each of the enabled CSBs for the XML Tags used, so can return a fairly lengthy list of tags depending on the selection itself.

Returns
UIDList containing tags used in the active selection
virtual void IXMLTagSuite::GetUnTagString (PMStringuntagStr)
pure virtual

This is what would appear in the context sensitive menu (once translated) for instance, Untag Text

Parameters
untagStr[OUT] parameter holding what would get translated for the end-user to see
virtual ErrorCode IXMLTagSuite::MapSelectedStoriesStyles () const
pure virtual

Tag the current selection be tagged via Style to Tag Mapping return – kSuccess - the tagging succeeded

virtual ErrorCode IXMLTagSuite::SetTag (const UIDReftag,
bool16 retag,
bool16 allowPresetUI = kTrue 
)
pure virtual

Applies a tag to the selection; will process e.g. IXMLElementCommands::CreateElement or a low-level command to change the tag associated with an element (kXMLSetElementTagCmdBoss).

You should check the AddOrRetagState first, to determine whether retag makes sense, to determine what to set for this parameter. If there's a text selection in an untagged frame, then the frame itself would need a tag, and a dialog will appear soliciting a tag for the frame.

Selections in the structure-view are simpler to understand; the subtree of nodes selected get the tag applied (through kXMLSetElementTagCmdBoss).

Parameters
tagspecifies tag (IXMLTag) to apply to current selection
retagkTrue if retag intended outcome
allowPresetUIkTrue if the client doesn't mind if UI pops up during this action.
Returns
kSuccess if operation could be completed successfully, kFailure otherwise
virtual ErrorCode IXMLTagSuite::UnTag ()
pure virtual

Remove tag(s) associated with active selection; can take out a whole chunk of the structure tree, as IXMLElementCommands::DeleteElement may be processed by this method call.

Returns
kSuccess if un-tagging operation could be completed successfully, kFailure otherwise