![]() | InDesign SDK 20.5 |
#include <SnpXMLSampleHelper.h>

Public Member Functions | |
| SnpXMLSampleHelper () | |
| virtual | ~SnpXMLSampleHelper () |
| UIDRef | AcquireParaStyle (const UIDRef &documentUIDRef, const PMString &name) |
| UIDRef | AcquireCharStyle (const UIDRef &documentUIDRef, const PMString &name) |
| UIDRef | AcquireStyle (const UIDRef &documentUIDRef, const PMString &name, const PMIID &styleIID, const ClassID &createCmdClassID) |
| UIDRef | CreateRectangleFrame (const UIDRef &documentUIDRef, const PMRect &rect, int32 spreadNum, int32 pageNum) |
| ErrorCode | CreateSampleDTD (const IDFile &file) |
| ErrorCode | CreateSampleTaggedStory (const UIDRef &textModelUIDRef, bool16 noOptionalContent=kFalse) |
| ErrorCode | CreateSampleXML (const IDFile &file, bool16 extendedElements=kFalse) |
| UIDRef | CreateStoryThroughFrame (const UIDRef &documentUIDRef, const PMRect &rect, int32 spreadNum, int32 pageNum) |
| ErrorCode | CreateTableThroughFrame (const UIDRef &documentUIDRef, const PMRect &rect, UIDRef &outTableUIDRef, UIDRef &outTextModelUIDRef, int32 nRows=2, int32 nCols=2) |
| void | GetNextRect (PMRect &outRect) |
| IDFile | GetSampleFile (const PMString &extension) |
| ErrorCode | InsertStyledLine (const UIDRef &textModelUIDRef, const PMString &lineText, const TextIndex &insertionPoint, const UIDRef &styleUIDRef, TextIndex &outNextTextIndex) |
| void | ResetRectCounts () |
| void | SaveLineToStream (const PMString &str, IPMStream *stream) |
Public Member Functions inherited from SnpXMLHelper | |
| SnpXMLHelper () | |
| virtual | ~SnpXMLHelper () |
| UIDRef | AcquireTag (const UIDRef &documentUIDRef, const PMString &tagName) |
| ErrorCode | AssociateDTD (const UIDRef &documentUIDRef, const IDFile &dtdFile) |
| PMString | AsString (const UIDRef &tagUIDRef) |
| PMString | AsString (const XMLReference &xmlReference) |
| ErrorCode | ChangeTagName (const UIDRef &tagUIDRef, const PMString &newTagName) |
| PMString | GetClassFrom (const ClassID &classID) |
| PMString | GetClassFrom (const UIDRef &objUIDRef) |
| XMLReference | GetRootXMLReference (const UIDRef &documentUIDRef) |
| TextIndex | InsertTaggedText (const UIDRef &textModelUIDRef, const PMString &pstr, TextIndex startIndex, const PMString &tagName) |
| ErrorCode | PlaceElement (const XMLReference &xmlRef, const UIDRef &graphicFrameUIDRef) |
| ErrorCode | SetExportFromSelected (const UIDRef &workspaceUIDRef, bool16 state) |
| ErrorCode | SetImportIntoSelected (const UIDRef &workspaceUIDRef, bool16 state) |
| ErrorCode | SetRootTag (const UIDRef &documentUIDRef, const PMString &tagName) |
| ErrorCode | ShowHideTaggedFrames (bool16 setVisible) |
| ErrorCode | TagStory (const UIDRef &textModelUIDRef, const PMString &tagName) |
| ErrorCode | TagTable (const UIDRef &tableModelUIDRef, const PMString &tableTagName, const PMString &cellTagName, XMLReference &outCreatedXMLReference) |
| ErrorCode | TagTextRange (const UIDRef &textModelUIDRef, const PMString &tagName, TextIndex startIndex, TextIndex endIndex) |
Additional Inherited Members | |
Protected Member Functions inherited from SnpXMLHelper | |
| ErrorCode | InsertText (const UIDRef &textModelUIDRef, const PMString &data, const TextIndex &position) |
Creates sample XML/DTD content, and implements non-XML related features used by the snippet samples involving XML.
| inline |
Constructor
| inlinevirtual |
Destructor
Obtain reference to a character style by name; create if it doesn't already exist
| documentUIDRef | specifies document of interest |
| name | specifies name of style we're looking for |
Obtain reference to a paragraph style by name; create if it doesn't already exist
| documentUIDRef | specifies document of interest |
| name | specifies name of style we're looking for |
| UIDRef SnpXMLSampleHelper::AcquireStyle | ( | const UIDRef & | documentUIDRef, |
| const PMString & | name, | ||
| const PMIID & | styleIID, | ||
| const ClassID & | createCmdClassID | ||
| ) |
Obtain reference to style (kStyleBoss)
| documentUIDRef | document of interest |
| name | specifies name of style we're looking for |
| styleIID | PMIID for name table with styles in it: for instance IID_IPARASTYLEGROUPMANAGER |
| createCmdClassID | for instance kCreateParaStyleCmdBoss |
| UIDRef SnpXMLSampleHelper::CreateRectangleFrame | ( | const UIDRef & | documentUIDRef, |
| const PMRect & | rect, | ||
| int32 | spreadNum, | ||
| int32 | pageNum | ||
| ) |
Create a rectangle page item (empty graphic frame)
| documentUIDRef | document of interest |
| rect | The rectangle to create |
| spreadNum | Index of the target spread |
| pageNum | Index of the target page |
| ErrorCode SnpXMLSampleHelper::CreateSampleDTD | ( | const IDFile & | file | ) |
Create an instance of a DTD that is used in some of these mini-snippets
| file[in] | The file to write to. |
| ErrorCode SnpXMLSampleHelper::CreateSampleTaggedStory | ( | const UIDRef & | textModelUIDRef, |
| bool16 | noOptionalContent = kFalse | ||
| ) |
Create a story with some sample contet and tagged.
| textModelUIDRef | The story to tag |
| noOptionalContent | If kFalse optional content will be added |
| ErrorCode SnpXMLSampleHelper::CreateSampleXML | ( | const IDFile & | file, |
| bool16 | extendedElements = kFalse | ||
| ) |
Create instance of XML file for import samples.
| file | The file to write to. |
| extendedElements | If kTrue a copyright line will be added. |
| UIDRef SnpXMLSampleHelper::CreateStoryThroughFrame | ( | const UIDRef & | documentUIDRef, |
| const PMRect & | rect, | ||
| int32 | spreadNum, | ||
| int32 | pageNum | ||
| ) |
Create a text frame, and return reference to the new story associated.
| documentUIDRef | document in which objects should be created |
| rect | bounding box for frame |
| spreadNum | specifies spread index that should be ancestor for content |
| pageNum | which page on given spread |
| ErrorCode SnpXMLSampleHelper::CreateTableThroughFrame | ( | const UIDRef & | documentUIDRef, |
| const PMRect & | rect, | ||
| UIDRef & | outTableUIDRef, | ||
| UIDRef & | outTextModelUIDRef, | ||
| int32 | nRows = 2, | ||
| int32 | nCols = 2 | ||
| ) |
Create a text frame, and in it a table
| documentUIDRef | document in which objects should be created |
| rect | bounding box for frame |
| outTableUIDRef | reference to table (kTableModelBoss) created, from which ITableModel can be instantiated |
| outTextModelUIDRef | reference to story (kTextStoryBoss) created, from which ITextModel can be instantiated |
| nRows | number of rows in table to create |
| nCols | number of columns to create |
| void SnpXMLSampleHelper::GetNextRect | ( | PMRect & | outRect | ) |
Get a new rect for shape's position on the page; these don't overlap until there are more than about 10 page items
| [out] | outRect | The rectangle |
Return a filename to be used for these mini-snippets, with variable ending.
| extension | specifies the last part of the filename to create, could be a short extension or a longer part of the filename |
| ErrorCode SnpXMLSampleHelper::InsertStyledLine | ( | const UIDRef & | textModelUIDRef, |
| const PMString & | lineText, | ||
| const TextIndex & | insertionPoint, | ||
| const UIDRef & | styleUIDRef, | ||
| TextIndex & | outNextTextIndex | ||
| ) |
Insert some text as a CR terminated line and apply a style to it
| textModelUIDRef | identifies story (kTextStoryBoss) into which we're inserting text |
| lineText | specifies text to insert |
| insertionPoint | where in the story to insert the text |
| styleUIDRef | specifies run-style to apply to the text inserted |
| void SnpXMLSampleHelper::ResetRectCounts | ( | ) |
Reset the rect counts to zero, to start positioning shapes from the page origin again. Rect-counts are just used to avoid overlapping created page items.