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

#include <ISnippetExport.h>

Inheritance diagram for ISnippetExport:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISNIPPETEXPORT }
 
enum  PreferenceOperation { kInclude, kExclude }
 

Public Member Functions

virtual ErrorCode ExportXMLElements (IPMStream *stream, const K2Vector< XMLReference > &elementRefList)=0
 
virtual ErrorCode ExportPageitems (IPMStream *s, const UIDList &uidList)=0
 
virtual ErrorCode ExportInCopyInterchange (IPMStream *s, const UIDList &uidList)=0
 
virtual ErrorCode ExportAppPrefs (IPMStream *stream, PreferenceOperation operation=kExclude, const K2Vector< ScriptID > &preferenceIDs=K2Vector< ScriptID >(), IAppPrefsExportDelegate *delegate=nil)=0
 
virtual bool16 GetSelectedPageItemsToExport (UIDList &pageItems)=0
 
virtual ErrorCode ExportSelectedPageItems (IPMStream *s)=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 is the API for using the Snippets plug-in to generate (export) XML in INX format. You can use this to write objects out to INX, and you can use ISnippetImport to read them in from INX. These functions will write out the specified objects, as well as whatever dependent objects they rely on. So, for instance, if it writes out a page item, it will also write out any swatches used in the page item.

Access this interface via the Utils<> helper.

See Also
ISnippetImport
Utils

Member Enumeration Documentation

Export the application preferences to a stream. You can specify which elements you want exported by passing the appropriate ScriptIDs in the preferenceIDs parameter.

Script IDs can be found in ScriptingDefs.h. In ScriptingDefs.h, most list style elements will have a singular identifier and a plural identifier, such as c_DocumentStyle and c_DocumentStyles. In all cases, you should pass in the singular version, i.e. c_DocumentStyle.

Many preferences can have dependencies on other preferences. i.e. Character and Paragraph styles have references to colors in them. If you are exporting Character and Paragraph styles, you should also export colors, swatches, gradients, etc. or use extreme caution.

Parameters
stream- XML will be written to this output stream
operation- indicates whether the ScriptIDs in 'preferenceIDs' should be the only ScriptIDs included in the export, by specifying PreferenceOperation::kInclude, or whether the ScriptIDs in 'preferenceIDs' should be excluded, by specifying PreferenceOperation::kExclude, from the standard list of preferences that get exported i.e. if we wanted to export only the list of document presets and the Margin preferences, we would add c_MarginPref and c_DocumentStyle to our preferenceIDs and set operation to kInclude. If we wanted to write out all the prefs except Object Styles, we would add c_ObjectStyle to our preferenceIDs and set operation to kExclude.
preferenceIDs-
Returns
ErrorCode kSuccess if it worked

Member Function Documentation

virtual ErrorCode ISnippetExport::ExportInCopyInterchange (IPMStreams,
const UIDListuidList 
)
pure virtual

Export a single page item or story to a stream as we can export only one incx in one go. Does not support exporting the XML backing store, if the backing store is the only item in the uidList, returns kFailure

Parameters
stream- XML will be written to this output stream
uidList- Only supports single item in list, item in list must provide IDOMElement and IXMLFragment interfaces
Returns
ErrorCode kSuccess if it worked
virtual ErrorCode ISnippetExport::ExportPageitems (IPMStreams,
const UIDListuidList 
)
pure virtual

Export a list of either page items to snippet

Parameters
stream- XML will be written to this output stream
pgItem- list of page items, all items in list must provide IDOMElement interfaces
Returns
ErrorCode kSuccess if it worked
virtual ErrorCode ISnippetExport::ExportSelectedPageItems (IPMStreams)
pure virtual
Export the currently selected page items to snippet

Parameters
s- XML will be written to this output stream
Returns
ErrorCode kSuccess if it worked
virtual ErrorCode ISnippetExport::ExportXMLElements (IPMStreamstream,
const K2Vector< XMLReference > & elementRefList 
)
pure virtual

Export XML elements to snippet

Parameters
stream- XML will be written to this output stream
elementRefList- which elements in the structure view to export (clients required to removed child elements if the list also contains the parent element)
Returns
ErrorCode kSuccess if it worked
virtual bool16 ISnippetExport::GetSelectedPageItemsToExport (UIDListpageItems)
pure virtual
Return the list of selected page items

Parameters
pageItems- [OUT] - UIDs of selected page items will be returned in this.
Returns
bool16 kTrue if the list of selected page items could be obtained.