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

Public Types | |
| enum | { kDefaultIID = IID_IMETADATAACCESS } |
| enum | IteratorOptions { kIterJustChildren = 0x0100UL, kIterJustLeafNodes = 0x0200UL, kIterJustLeafName = 0x0400UL, kIterOmitQualifiers = 0x0800UL } |
| enum | SkipOptions { kIterSkipSubtree = 0x0001UL, kIterSkipSiblings = 0x0002UL } |
Public Member Functions | |
| virtual void | Package (const bool16 &package=kTrue)=0 |
| virtual bool16 | IsPackaged () const =0 |
| virtual void | AllowInPlaceModification (const bool16 &inPlaceModification=kTrue)=0 |
| virtual bool16 | CanModifyInPlace () const =0 |
| virtual void | Expandable (const bool16 &expandable=kTrue)=0 |
| virtual bool16 | IsExpandable () const =0 |
| virtual bool16 | LoadFromStream (IPMStream *stream, int32 numOfBytes=-1)=0 |
| virtual bool16 | SaveToStream (IPMStream *stream, const bool16 &package=kTrue, const bool16 &allowInPlaceModification=kTrue, const bool16 &expandable=kTrue, const bool16 &packetDisabled=kFalse) const =0 |
| virtual bool16 | AppendFromStream (IPMStream *stream, const bool16 replaceOld, const bool16 treatAllAsExternal=kFalse)=0 |
| virtual IMetaDataIterator * | Enumerate (const PMString &ns, const PMString &subPath, const IMetaDataAccess::IteratorOptions &options=IMetaDataAccess::kIterJustChildren) const =0 |
| virtual IMetaDataIterator * | Enumerate () const =0 |
| virtual bool16 | Get (const PMString &ns, const PMString &path, PMString &value, metadata::PropertyOptions *options=0) const =0 |
| virtual void | Set (const PMString &ns, const PMString &path, const PMString &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual void | Remove (const PMString &ns, const PMString &path)=0 |
| virtual size_t | Count (const PMString &ns, const PMString &path) const =0 |
| virtual bool16 | PropertyExists (const PMString &ns, const PMString &path) const =0 |
| virtual void | AppendArrayItem (const PMString &ns, const PMString &arrayName, const PMString &value, const MetaDataStructContainerType type, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual void | SetArrayItem (const PMString &ns, const PMString &arrayName, int32 index, const PMString &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual bool16 | GetArrayItem (const PMString &ns, const PMString &arrayName, int32 index, PMString &value, metadata::PropertyOptions *options=0) const =0 |
| virtual void | DeleteArrayItem (const PMString &ns, const PMString &arrayName, int32 index)=0 |
| virtual void | SetStructField (const PMString &ns, const PMString &structName, const PMString &fieldNs, const PMString &fieldName, const PMString &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual bool16 | GetStructField (const PMString &ns, const PMString &structName, const PMString &fieldNs, const PMString &fieldName, PMString &value, const metadata::PropertyOptions *options=0) const =0 |
| virtual void | DeleteStructField (const PMString &ns, const PMString &structName, const PMString &fieldNs, const PMString &fieldName)=0 |
| virtual void | SetLocalizedText (const PMString &ns, const PMString &arrayName, const PMString &genericLang, const PMString &specificLang, const PMString &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual bool16 | GetLocalizedText (const PMString &ns, const PMString &arrayName, const PMString &genericLang, const PMString &specificLang, PMString &actualLang, PMString &value, const metadata::PropertyOptions *options=0) const =0 |
| virtual void | ComposeArrayItemPath (const PMString &schemaNs, const PMString &arrayName, int32 index, PMString &path) const =0 |
| virtual void | ComposeStructFieldPath (const PMString &schemaNs, const PMString &structName, const PMString &fieldNs, const PMString &fieldName, PMString &path) const =0 |
| virtual void | ComposeLangSelector (const PMString &schemaNs, const PMString &arrayName, const PMString &langName, PMString &path) const =0 |
| virtual void | SetBoolean (const PMString &ns, const PMString &path, const bool16 &value)=0 |
| virtual bool16 | GetBoolean (const PMString &ns, const PMString &path, bool16 &value) const =0 |
| virtual void | SetDateTime (const PMString &ns, const PMString &path, const XMP_DateTime &value)=0 |
| virtual bool16 | GetDateTime (const PMString &ns, const PMString &path, XMP_DateTime &value) const =0 |
| virtual void | SetResourceRef (const PMString &ns, const PMString &path, const metadata::ResourceRef &resource)=0 |
| virtual bool16 | GetResourceRef (const PMString &ns, const PMString &path, metadata::ResourceRef &resource) const =0 |
| virtual void | SetInstanceID (const PMString &instanceID)=0 |
| virtual PMString | GetInstanceID () const =0 |
| virtual PMString | GenerateUniqueID () const =0 |
| virtual bool16 | RegisterNamespace (const PMString &ns, const PMString &suggestedPrefix, PMString ®isteredPrefix)=0 |
| virtual bool16 | GetNamespacePrefix (const PMString &ns, PMString &prefix) const =0 |
| virtual bool16 | GetNamespace (const PMString &prefix, PMString &ns) const =0 |
| virtual void | DeleteNamespace (const PMString &ns)=0 |
| virtual void | ClearAllProperties ()=0 |
| virtual bool16 | DuplicateSubtree (PMString const &srcNS, PMString const &srcPath, PMString const &destNS, PMString const &destPath)=0 |
| virtual void | NewXMP ()=0 |
| virtual void | PrepareForSave (bool16 bIncludePantry=kFalse)=0 |
| virtual void | NoteChange (PMString const &changeStr)=0 |
| virtual void | NoteMetaDataChanged ()=0 |
| virtual void | OpenXMP ()=0 |
| virtual void | BranchXMP ()=0 |
| virtual bool16 | XMPDocOpsReady ()=0 |
| virtual void | AddIngredientXMP (std::string *filepath, const PMString &in_toPart, const PMString &in_fromPart, const PMString &in_linkForm, const PMString &in_linkCategory, const PMString &in_filePath, const PMString &in_alternatePaths, const PMString &in_fileModTime, const PMString &in_placedXResolution, const PMString &in_placedYResolution, const PMString &in_placedResolutionUnit)=0 |
| virtual void | RemoveIngredientXMP (int nth)=0 |
| virtual void | ClearIngredientsXMP ()=0 |
| virtual void | SetStructField (const PMString &ns, const PMString &structName, const PMString &fieldNs, const PMString &fieldName, const std::string &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual bool16 | GetStructField (const PMString &ns, const PMString &structName, const PMString &fieldNs, const PMString &fieldName, std::string &value, const metadata::PropertyOptions *options=0) const =0 |
| virtual void | Set (const PMString &ns, const PMString &path, const std::string &value, const metadata::PropertyOptions options=metadata::kNoOptions)=0 |
| virtual bool16 | Get (const PMString &ns, const PMString &path, std::string &value, metadata::PropertyOptions *options=0) const =0 |
| virtual PMString | GenerateDocumentID () const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This interface is a low level API that encapsulates routines of the XMPToolkit.
Skip options. These are used by IMetaDataIterator::Skip method
| Enumerator | |
|---|---|
| kIterSkipSubtree | Skip the subtree below the current node |
| kIterSkipSiblings | Skip the subtree below and remaining siblings of the current node. |
| pure virtual |
Set the MetaData block's in place modification attribute. If in place modification is allowed it means that external software can modify the MetaData block. Next time the publication is opened we will keep changes made externally to any external property. The MetaData package mechanism will also indicate that this block can be modified in place.
| inPlaceModification | IN The in place modification attribute. |
| pure virtual |
Array item access Append a new item to an array. The array will be automatically created if it doesn't exist.
| ns | IN The namespace of the array. Must not be an empty string. |
| arrayName | IN The name of the array. |
| value | IN The value of the array item. |
| type | IN The type of the array. |
| options | IN Bit flags that describe the array item. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
Appends external properties from the stream.
| stream | IN The stream that contains the metadata (in UTF8 format) to be appended. |
| replaceOld | IN If kFalse, a property that exists in current metadata will not be replace by the same property in the stream. |
| treatAllAsExternal | IN Optional. If kTrue, all properties are treated as external. |
| pure virtual |
Query the MetaData block's in place modification attribute.
| pure virtual |
Some other useful methods. Set the MetaData block back to being empty.
| pure virtual |
XPath composition utilities Compose the XPath expression for an item in an array.
| schemaNs | IN The namespace of the stream. Must not be empty. |
| arrayName | IN The name of the array. Must not be empty. May be a general XPath expression. |
| index | IN The index of the array item. Arrays in XMP are indexed from 1. Use metadata::kArrayLastItem for the last item in the array. |
| path | OUT The composed path. This will be of the from "arrayName/ *[i]". If index is metadata::kArrayLastItem, the path will be "arrayName/ *[last()]". |
| pure virtual |
Compose the XPath expression for a qualifier.
| schemaNs | IN The namespace of the stream. Must not be empty. |
| arrayName | IN The name of the array. Must not be empty. May be a general XPath expression. |
| langName | IN The name of the language. Must not be empty. |
| path | OUT The composed path. This will be of the from "arrayName/ *[@xml:lang='langName']". |
| pure virtual |
Compose the XPath expression for a field in a struct.
| schemaNs | IN The namespace of the stream. Must not be empty. |
| structName | IN The name of the struct. Must not be empty. May be a general XPath expression. |
| fieldNs | IN The namespace of the field. May be empty. |
| fieldName | IN The name of the field. Must not be empty. |
| path | OUT The composed path. This will be of the from "structName\fNS:fieldName", where "fNS is the prefix for fieldNs. |
| pure virtual |
Get the number of items in the structured container specified by ns and path.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| pure virtual |
Delete an array item.
| ns | IN The namespace of the array. Must not be an empty string. |
| arrayName | IN The name of the array. |
| index | IN The index of the array item. Arrays are indexed from 1. Use metadata::kArrayLastItem for the last item in the array. |
| pure virtual |
Delete a namespace. Does nothing if the namespace is not registered.
| ns | IN The URI of the namespace. |
| pure virtual |
Delete a field within a structure.
| ns | IN The namespace of the structure. Must not be an empty string. |
| structName | IN The name of the structure. |
| fieldNs | IN The namespace of the field. Maybe be an empty string. |
| fieldName | IN The name of the field. |
| pure virtual |
Duplicates a subtree in the metadata block.
Note: As written, this utility does not perform any merging between the source and destination subtrees. If the destination subtree exists, it will be deleted before the subtree is duplicated.
| srcNS | IN The namespace for the source subtree |
| srcPath | IN The path for the source subtree |
| destNS | IN The namespace for the destination subtree |
| destPath | IN The path for the destination subtree |
| pure virtual |
Wrappers on the XMPToolkit library Return an IMetaDataIterator interface which must be released by the caller. IMetaDataIterator enables one to iterate all the paths in this MetaData block.
| ns | IN The namespace to enumerate. |
| subPath | IN Specifies the scope of the enumeration. |
| options | IN The available option flags are: kXMP_IterJustChildren - Just visit the immediate children of the root, default is subtree. kXMP_IterJustLeafNodes - Just visit the leaf nodes, default visits all nodes. kXMP_IterJustLeafName - Return just the leaf part of the path, default is the full path. kXMP_IterOmitQualifiers - Omit all qualifiers. |
| pure virtual |
Return an IMetaDataIterator interface which must be released by the caller. IMetaDataIterator enables one to iterate all the paths in this MetaData block.
| pure virtual |
Set the MetaData block's expandable attribute. If expandable is kTrue then when the package is written out pad bytes will be included so that external entities can add MetaData properties to the packet.
| expandable | IN The expandable attribute. |
| pure virtual |
Generate a document ID.
| pure virtual |
Generate a unique ID.
| pure virtual |
General property access Get the value at the property specified by ns and path.
| ns | IN The namespace of the property. |
| path | IN The path of the property.. |
| value | OUT The value of the property. |
| options | OUT Bit flags that describe the property. Default to 0 if the flags are not wanted. |
| pure virtual |
General property access Get the value at the property specified by ns and path.
| ns | IN The namespace of the property. |
| path | IN The path of the property.. |
| value | OUT The value of the property. |
| options | OUT Bit flags that describe the property. Default to 0 if the flags are not wanted. |
| pure virtual |
Get the value of an array item.
| ns | IN The namespace of the array. Must not be an empty string. |
| arrayName | IN The name of the array. |
| index | IN The index of the array item. Arrays are indexed from 1. Use metadata::kArrayLastItem for the last item in the array. |
| value | OUT The value of the array item. |
| options | OUT Bit flags that describe the array item. Default to 0 if the flags are not wanted. |
| pure virtual |
Get the boolean value of the specified property.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | OUT The value of the property. |
| pure virtual |
Get the DateTime value of the specified property.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | OUT The value of the property. |
| pure virtual |
Get the instance ID of the document.
| pure virtual |
Get the value of an item within an alt-text array.
| ns | IN The namespace of the structure. Must not be an empty string. |
| arrayName | IN The name of the structure. May be a general XPath expression. Must not be empty. |
| genericLang | IN The name of the generic language as an RFC 1766 string. May be an empty string if no generic language is wanted |
| specificLang | IN The name of the specific language as an RFC 1766 string. Must not be empty. Maybe "x-default". |
| actualLang | OUT The language of the selected array item, if an appropriate array item is found. |
| value | OUT The value of the field. |
| options | OUT Bit flags that describe the property. Default to 0 if the flags are not wanted. |
| pure virtual |
Get the prefix of a registered namespacename.
| ns | IN The URI of the namespace. |
| prefix | OUT The prefix of the namespace. |
| pure virtual |
Get ResourceRef specified by ns and path.
| ns | IN The namespace of the property. |
| path | IN The path of the property.. |
| resource | OUT The value of the property. |
| pure virtual |
Get a field within a structure.
| ns | IN The namespace of the structure. Must not be an empty string. |
| structName | IN The name of the structure. |
| fieldNs | IN The namespace of the field. Maybe be an empty string. |
| fieldName | IN The name of the field. |
| value | OUT The value of the field. |
| options | OUT Bit flags that describe the property. Default to 0 if the flags are not wanted. |
| pure virtual |
Get a field within a structure.
| ns | IN The namespace of the structure. Must not be an empty string. |
| structName | IN The name of the structure. |
| fieldNs | IN The namespace of the field. Maybe be an empty string. |
| fieldName | IN The name of the field. |
| value | OUT The value of the field. |
| options | OUT Bit flags that describe the property. Default to 0 if the flags are not wanted. |
| pure virtual |
Query the MetaData block's expandable attribute.
| pure virtual |
Query the MetaData block's packaged attribute.
| pure virtual |
Persistance operations Load this MetaData block from the given stream.
| stream | IN The stream that contains medadata (in UTF8 format). |
| numOfBytes | IN Length of the metadata block. Pass -1 if the length is unknown. |
| pure virtual |
MetaData attributes Set the MetaData block's packaged attribute. If packaged is kTrue then whenever this MetaData block is saved to a stream it will be packaged in a MetaData package. In addition when the data for this interface is saved to the database, if packaged is kTrue then the data will be streamed to the contiguous block section of the database, otherwise it will be written into a regular database stream.
| package | IN The packaged attribute. |
| pure virtual |
Check if a property exists.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| pure virtual |
Namespaces Register a namespacename (which should be a URI) and a suggested prefix for composing qualified names.
| ns | IN The namespace to be registered. |
| suggestedPrefix | IN The suggested prefix to be used if the URI is not yet registered. Must be a valid XML name. |
| registeredPrefix | OUT The prefix actually registered for this URI. |
Remove the specifed property and all of its sub-properties.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| pure virtual |
Save this MetaData block to the given stream.
| stream | IN The stream where the metadata will be written. The data will be in UTF8 format. |
| package | IN If kTrue, the MetaData block is streamed out in a MetaData package. |
| allowInPlaceModification | IN If kTrue, the writable attribute in the package header is set. |
| expandable | IN if kTrue, padding is added. |
| packetDisabled | IN If kTrue, a disabled packet id is generated instead of the standard one. This is used internally. |
| pure virtual |
Set the specified value at the end of the specified path, with the optionally specified features.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | IN The value of the property. |
| options | IN Bit flags that describe the property. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
Set the specified value at the end of the specified path, with the optionally specified features.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | IN The value of the property. |
| options | IN Bit flags that describe the property. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
Modify an array item.
| ns | IN The namespace of the array. Must not be an empty string. |
| arrayName | IN The name of the array. |
| index | IN The index of the array item. Arrays are indexed from 1. Use metadata::kArrayLastItem for the last item in the array. |
| value | IN The value of the array item. |
| options | IN Bit flags that describe the array item. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
The following set and get properties from common data types. Set the boolean value of the specified property.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | IN The value of the property. |
| pure virtual |
Set the DateTime value of the specified property.
| ns | IN The namespace of the property. |
| path | IN The path of the property. |
| value | IN The value of the property. |
| pure virtual |
Set the instance ID of the document.
| instanceID | IN The instance ID. |
| pure virtual |
Localized text in alt-text array Set the value of an item within an alt-text array.
| ns | IN The namespace of the structure. Must not be an empty string. |
| arrayName | IN The name of the structure. May be a general XPath expression. Must not be empty. |
| genericLang | IN The name of the generic language as an RFC 1766 string. May be an empty string if no generic language is wanted |
| specificLang | IN The name of the specific language as an RFC 1766 string. Must not be empty. Maybe "x-default". |
| value | IN The value of the item. |
| options | IN Bit flags that describe the property. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
Set the specified ResourceRef at the end of the specified path, with the optionally specified features.
| ns | IN The namespace of the properties. |
| path | IN The path of the properties. |
| resource | IN The ResourceRef to be set. |
| pure virtual |
Structure field access Set a field within a structure.
| ns | IN The namespace of the structure. Must not be an empty string. |
| structName | IN The name of the structure. |
| fieldNs | IN The namespace of the field. Maybe be an empty string. |
| fieldName | IN The name of the field. |
| value | IN The value of the field. |
| options | IN Bit flags that describe the property. Default to metadata::kNoOptions if the flags are not needed. |
| pure virtual |
Structure field access Set a field within a structure.
| ns | IN The namespace of the structure. Must not be an empty string. |
| structName | IN The name of the structure. |
| fieldNs | IN The namespace of the field. Maybe be an empty string. |
| fieldName | IN The name of the field. |
| value | IN The value of the field. |
| options | IN Bit flags that describe the property. Default to metadata::kNoOptions if the flags are not needed. |