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

Public Types | |
| enum | { kDefaultIID = IID_IIDMLCOMPONENTNAME } |
Public Member Functions | |
| virtual void | Get (WideString &name)=0 |
| virtual ErrorCode | Set (const WideString &newName)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
An interface on PerInstance objects (defined by the m_INXPackageSubFile_PerInstance metadata) in an IDML package. For this kind of objects, each instance is exported as a separate sub file inside an IDML package. Currently these objects include MasterSpread, Spread, and Story.
During export, an object's IDMLComponent name is used as the base file name (appended by ".xml") of the corresponding sub file in an IDML package. It also apperas in the reference to the sub file in the main file designmap.xml.
If no IDMLComponentName has been specified for an object, a default name is used during export. Since the default name contains an object's UID, it could change after a document is exported and re-imported.
The file name and the reference to a sub file in an IDML package can be modified externally. During import, the modified name will be used to update the object's IDMLComponentName, if the name is valid and unique.
| pure virtual |
Determines if a name already exists, if not a default name will be generated by appending the object UID to the scripting object type (e.g. Spread_UID or Story_UID).
| name | OUT A unique name for the component. |
| pure virtual |
Tests to see whether the new name is valid and unique among the same type of objects in the current document. If the name is valid and unique the new name will be stored and the interface will be dirtied. If it is not valid or not unique, the name will not be changed.
A name is invalid if it contains these reserved characters for file names: '/', '\', '?', '', '*', ':', '|', '"', '<', '>', '.' In order to avoid conflict with default names, a name that starts with the script object name, followed by '_', followed by a 'u' or 'U', followed by one or more hex digits, and followed by nothing, is INVALID. e.g. Spread_u10f is not a valid component name for a spread but Spread_u10f_Transformed is valid.
| newName | IN The new name. Pass an empty newName to use the default name. |