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

#include <IXMLTagCommands.h>

Inheritance diagram for IXMLTagCommands:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IXMLTAGCOMMANDS }
 

Public Member Functions

virtual ErrorCode CreateTag (const UIDRef &tagList, const WideString &tagName, UID tagColor=kInvalidUID, UID *createdTag=nil)=0
 
virtual ErrorCode DeleteTag (const UIDRef &tagList, UID tag, UID tagReplaceWith)=0
 
virtual ErrorCode DeleteTags (const UIDRef &tagList, const UIDList &tagsToDelete, UID tagReplaceWith)=0
 
virtual ErrorCode DeleteUnusedTags (const UIDRef &tagList)=0
 
virtual ErrorCode SetTagName (IDataBase *db, UID tag, const WideString &tagName)=0
 
virtual ErrorCode SetTagColor (IDataBase *db, UID tag, UID color)=0
 
virtual ErrorCode SaveTagList (const UIDRef &tagList, const IDFile &theFile)=0
 
virtual ErrorCode LoadTagList (const UIDRef &tagList, const IDFile &theFile)=0
 
virtual ErrorCode LoadTagList (const UIDRef &tagList, const std::string &assetRef)=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

Encapsulates commands to change the properties of tags (IXMLTag) and the tag collection (IXMLTagList).

Member Function Documentation

virtual ErrorCode IXMLTagCommands::CreateTag (const UIDReftagList,
const WideStringtagName,
UID tagColor = kInvalidUID,
UIDcreatedTag = nil 
)
pure virtual

Method for creating an XML tag. Returns the UID of the newly created tag or the UID of an existing tag if a tag by that name already exists. Will return an error if the tag name specified is not valid. This and related methods may process a command of type kXMLCreateTagCmdBoss behind the facade

Parameters
tagListthe tag list (IXMLTagList) to which the tag is to be added
tagNamespecifes the name for the tag (without begin/end markers), see IXMLTag
createdTag[OUT] ptr to UID for created tag
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::DeleteTag (const UIDReftagList,
UID tag,
UID tagReplaceWith 
)
pure virtual

Delete a tag. Requires a tag that can be used to replace the deleted tag with. This and related methods may process a command of type kXMLDeleteTagCmdBoss behind the facade

Parameters
tagListtag list (IXMLTagList) from which tag should be deleted
tagspecifies to the tag to be deleted
tagReplaceWithspecifies the tag to replace the one being deleted with
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::DeleteTags (const UIDReftagList,
const UIDListtagsToDelete,
UID tagReplaceWith 
)
pure virtual

Delete a set of tags. Requires a tag that can be used to replace the deleted tag with. This and related methods may process a command of type kXMLDeleteTagCmdBoss behind the facade

Parameters
tagList(IXMLTagList) from which tags should be deleted
tagsToDeleteUIDList of tags to remove
tagReplaceWithspecifies one tag to replace all those in deleted list by
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::DeleteUnusedTags (const UIDReftagList)
pure virtual

Find the set of tags that are not referenced by any element and delete them. This and related methods may process a command of type kXMLDeleteUnusedTagsCmdBoss behind the facade

Parameters
tagListspecifies tag-list (IXMLTagList) from which tags should be deleted
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::LoadTagList (const UIDReftagList,
const IDFiletheFile 
)
pure virtual

Load the tag list from another InDesign document or an xml file. This and related methods may process a command of type kLoadTagListCmdBoss behind the facade

Parameters
tagListtag-list (IXMLTagList) into which the tags are to be loaded
theFiletarget file from which tag-list is to be loaded
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::LoadTagList (const UIDReftagList,
const std::string & assetRef 
)
pure virtual

Load the tag list from cloud document represented by assetRef.

Parameters
tagListtag-list (IXMLTagList) into which the tags are to be loaded
assetRefasset reference of the targeted cloud document from which tag-list is to be loaded
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::SaveTagList (const UIDReftagList,
const IDFiletheFile 
)
pure virtual

Save the list of tags to the specified file. This and related methods may process a command of type kSaveTagListCmdBoss behind the facade

Parameters
tagList(IXMLTagList) specifies tag-list to be saved out
theFilespecifies destination file
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::SetTagColor (IDataBasedb,
UID tag,
UID color 
)
pure virtual

Method to change the color of a tag. This and related methods may process a command of type kXMLSetTagColorCmdBoss behind the facade

Parameters
dbdatabase containing the tag-list (IXMLTagList)
tagspecifies the tag whose color is to be changed
colorspecifies the new color for the tag
Returns
kSuccess if the operation succeeded, kFailure otherwise
virtual ErrorCode IXMLTagCommands::SetTagName (IDataBasedb,
UID tag,
const WideStringtagName 
)
pure virtual

Method to change the name of a tag. This and related methods may process a command of type kXMLSetTagNameCmdBoss behind the facade

Parameters
dbdatabase containing the tag-list (IXMLTagList)
tagspecifies the tag to be renamed
tagNamespecifies the new name for the tag (see IXMLTag)
Returns
kSuccess if the operation succeeded, kFailure otherwise