InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MetaDataTypes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Burbidge
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __MetaDataTypes_h__
25 #define __MetaDataTypes_h__
26 
27 #include "PMString.h"
28 #include "K2Vector.h"
29 #if defined WINDOWS && !defined(WIN_ENV)
30 #define WIN_ENV
31 #elif defined(MACINTOSH) && !defined(MAC_ENV)
32 #define MAC_ENV
33 #endif
34 #include "XMP_Const.h"
35 
36 #if PUBLIC_BUILD
37 #endif
38 
39 /* Standard schema namespace URI constants */
40 
42 extern const char* const kNS_xmp;
43 
45 extern const char* const kNS_xmpRights;
46 
48 extern const char* const kNS_xmpMM;
49 
51 extern const char* const kNS_xmpBJ;
52 
54 extern const char* const kNS_xmpT ;
55 
57 extern const char* const kNS_xmpTPg;
58 
60 extern const char* const kNS_xmpGImg;
61 
63 extern const char* const kNS_xmpIPTCCore;
64 
66 extern const char* const kNS_pdf;
67 
69 extern const char* const kNS_photoshop;
70 
72 extern const char* const kNS_exif;
73 
75 extern const char* const kNS_aux;
76 
78 extern const char* const kNS_tiff;
79 
81 extern const char* const kNS_stockPhoto;
82 
83 /* XML namespace constants from outside Adobe */
85 extern const char* const kNS_dc;
86 
88 extern const char* const kNS_rdf;
89 
91 extern const char* const kNS_xml;
92 
93 
94 /* namespace constants for structured property fields*/
96 extern const char* const kNS_xmpRscRef;
97 
99 extern const char* const kNS_xmpRscEvent;
100 
102 extern const char* const kNS_xmpSTJob;
103 
105 extern const char* const kNS_xmpSTMfs;
106 
107 // other constants
109 extern const char* const kXMP_NoValue;
110 
112 namespace metadata {
113 
115 typedef PMString URI;
116 
119 
122 
123 
125 class Clock
126 {
127 public:
131  virtual void timestamp(XMP_DateTime& dt);
132 
134  virtual ~Clock();
135 
136 private:
137  static long ts_SequenceNumber;
138 };
139 
141 #define kARMName AgentName("AdobeARM", PMString::kEncodingASCII)
142 
144 typedef enum {
146  kUnknown = 0,
147 
150 
153 
156 
159 } LinkForm;
160 
161 // A multiple part reference to a resource.
162 // If the referenced resource doesn't have XMP data, its file URL is used to generate the reference.
163 // Otherwise, its XMP data are used.
164 
167 {
168 public:
171 
185  ResourceRef(const PMString& instanceID = "", const metadata::URI& documentID = "", const metadata::URI& origDocumentID = "", const PMString& versionID = "", const PMString& renditionClass = "", const PMString& renditionParams = "",
186  const PMString& manageTo = "", const PMString& manageUI = "", const PMString& manager = "", const PMString& managerVariant = "", const PMString& fileURL = "") :
187  fInstanceID(instanceID), fDocumentID(documentID), fOrigDocumentID(origDocumentID), fVersionID(versionID), fRenditionClass(renditionClass), fRenditionParams(renditionParams),
188  fManageTo(manageTo), fManageUI(manageUI), fManager(manager), fManagerVariant(managerVariant), fFileURL(fileURL)
189  { }
190 
194  ResourceRef(const ResourceRef& other) :
195  fInstanceID(other.fInstanceID), fDocumentID(other.fDocumentID), fOrigDocumentID(other.fOrigDocumentID), fVersionID(other.fVersionID), fRenditionClass(other.fRenditionClass), fRenditionParams(other.fRenditionParams),
196  fManageTo(other.fManageTo), fManageUI(other.fManageUI), fManager(other.fManager), fManagerVariant(other.fManagerVariant), fFileURL(other.fFileURL)
197  { }
198 
204  {
205  if (this != &other)
206  {
207  fInstanceID = other.fInstanceID;
208  fDocumentID = other.fDocumentID;
209  fOrigDocumentID = other.fOrigDocumentID;
210  fVersionID = other.fVersionID;
211  fRenditionClass = other.fRenditionClass;
212  fRenditionParams = other.fRenditionParams,
213  fManageTo = other.fManageTo;
214  fManageUI = other.fManageUI;
215  fManager = other.fManager;
216  fManagerVariant = other.fManagerVariant;
217  fFileURL = other.fFileURL;
218  }
219 
220  return *this;
221  };
222 
227  bool operator==(const ResourceRef& other)
228  {
229  return fInstanceID == other.fInstanceID && fDocumentID == other.fDocumentID && fOrigDocumentID == other.fOrigDocumentID && fVersionID == other.fVersionID && fRenditionClass == other.fRenditionClass && fRenditionParams == other.fRenditionParams &&
230  fManageTo == other.fManageTo && fManageUI == other.fManageUI && fManager == other.fManager && fManagerVariant == other.fManagerVariant && fFileURL == other.fFileURL;
231  }
232 
238  bool16 HasXMPReference() const
239  {
240  return !fInstanceID.empty() || !fDocumentID.empty() || !fOrigDocumentID.empty() || !fVersionID.empty() || !fRenditionClass.empty() ||
241  !fRenditionParams.empty() || !fManageTo.empty() || !fManageUI.empty() || !fManager.empty() || !fManagerVariant.empty();
242  }
243 
245  void Clear()
246  {
247  fInstanceID.clear();
248  fDocumentID.clear();
249  fOrigDocumentID.clear();
250  fVersionID.clear();
251  fRenditionClass.clear();
252  fRenditionParams.clear();
253  fManageTo.clear();
254  fManageUI.clear();
255  fManager.clear();
256  fManagerVariant.clear();
257  fFileURL.clear();
258  }
259 
263  void SetInstanceID(const PMString& instanceID) { fInstanceID = instanceID; }
264 
268  PMString GetInstanceID() const { return fInstanceID; }
269 
273  void SetDocumentID(const metadata::URI& documentID) { fDocumentID = documentID; }
274 
278  metadata::URI GetDocumentID() const { return fDocumentID; }
279 
283  void SetOrigDocumentID(const metadata::URI& origDocumentID) { fOrigDocumentID = origDocumentID; }
284 
288  metadata::URI GetOrigDocumentID() const { return fOrigDocumentID; }
289 
293  void SetVersionID(const PMString& versionID) { fVersionID = versionID; }
294 
298  PMString GetVersionID() const { return fVersionID; }
299 
303  void SetRenditionClass(const PMString& renditionClass) { fRenditionClass = renditionClass; }
304 
308  PMString GetRenditionClass() const { return fRenditionClass; }
309 
313  void SetRenditionParams(const PMString& renditionParams) { fRenditionParams = renditionParams; }
314 
318  PMString GetRenditionParams() const { return fRenditionParams; }
319 
323  void SetManageTo(const PMString& manageTo) { fManageTo = manageTo; }
324 
328  PMString GetManageTo() const { return fManageTo; }
329 
333  void SetManageUI(const PMString& manageUI) { fManageUI = manageUI; }
334 
338  PMString GetManageUI() const { return fManageUI; }
339 
343  void SetManager(const PMString& manager) { fManager = manager; }
344 
348  PMString GetManager() const { return fManager; }
349 
353  void SetManagerVariant(const PMString& managerVariant) { fManagerVariant = managerVariant; }
354 
358  PMString GetManagerVariant() const { return fManagerVariant; }
359 
363  void SetFileURL(const PMString& fileURL) { fFileURL = fileURL; }
364 
368  PMString GetFileURL() const { return fFileURL; }
369 
370 private:
371  PMString fInstanceID;
372  metadata::URI fDocumentID;
373  metadata::URI fOrigDocumentID;
374  PMString fVersionID;
375  PMString fRenditionClass;
376  PMString fRenditionParams;
377  PMString fManageTo;
378  PMString fManageUI;
379  PMString fManager;
380  PMString fManagerVariant;
381  PMString fFileURL;
382 };
383 
384 
386 enum { /* Values used as special cases. */
393 };
394 
396 typedef int32 PropertyOptions;
397 
399 enum
400 {
402  kNoOptions = 0UL,
403 
404  //--- Option bits returned from the CXMPMeta::GetXyz functions.
405  /* Options relating to the XML string form of the property value. */
407  kPropValueIsXML = 0x00000001UL,
409  kPropValueIsURI = 0x00000002UL,
410 
411  /* Options relating to qualifiers attached to a property. */
413  kPropHasQualifiers = 0x00000010UL,
415  kPropIsQualifier = 0x00000020UL,
417  kPropHasLang = 0x00000040UL,
419  kPropHasType = 0x00000080UL,
420 
421  /* Options relating to the data structure form. */
423  kPropValueIsStruct = 0x00000100UL,
425  kPropValueIsArray = 0x00000200UL,
427  kPropArrayIsOrdered = 0x00000400UL,
429  kPropArrayIsAlternate = 0x00000800UL,
430 
431  /* Additional array options. */
433  kPropArrayIsAltText = 0x00001000UL,
434  /* kInsertBeforeItem = 0x00004000UL, *** Used by SetXyz functions. */
435  /* kInsertAfterItem = 0x00008000UL, *** Used by SetXyz functions. */
436 
437  /* Other miscellaneous options. */
439  kPropIsAlias = 0x00010000UL,
441  kPropHasAliases = 0x00020000UL,
443  kPropIsInternal = 0x00040000UL,
445  kPropIsStable = 0x00100000UL,
447  kPropIsDerived = 0x00200000UL,
449  kPropIsStale = 0x00400000UL,
450 
451  /* kUI_AllowCommas = 0x10000000UL, *** Used by CXMPUtils::CatenateArrayItems and ::SeparateArrayItems. */
452 
454  kSchemaNode = 0x80000000UL, /* Returned by iterators. */
455 
456  /* Masks that are multiple flags. */
462  kImplReservedMask = 0x70000000UL,
463 
464  //--- Option bits for the CXMPMeta::SetXyz functions.
465 
466  /* Options shared with GetXyz functions. */
467  /*
468  kPropValueIsXML = 0x00000001UL,
469  kPropValueIsURI = 0x00000002UL,
470  kPropValueIsStruct = 0x00000100UL,
471  kPropValueIsArray = 0x00000200UL,
472  kPropArrayIsOrdered = 0x00000400UL,
473  kPropArrayIsAlternate = 0x00000800UL,
474  kPropArrayIsAltText = 0x00001000UL,
475  */
476 
477  /* Options for array item location. */
479  kInsertBeforeItem = 0x00004000UL,
481  kInsertAfterItem = 0x00008000UL,
482 
483  /* Masks that are multiple flags. */
488 };
489 
490 }
491 
492 #ifndef TXMP_STRING_TYPE
493 #define TXMP_STRING_TYPE std::string
494 #endif
495 #include "XMP.hpp"
496 
497 
498 #if PUBLIC_BUILD
499 #endif
500 
501 #endif // __MetaDataTypes_h__