InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGraphicMetaConverter.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael_Martz
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 // Review Date:
24 //
25 // Purpose: Common interface for all rendering object providers for
26 // creation of meta data object, conversion of meta data objec to
27 // rendering object, and comparison of meta data and rendering objects.
28 //
29 //========================================================================================
30 
31 #ifndef _IGraphicMetaConverter_
32 #define _IGraphicMetaConverter_
33 //===================================================================================
34 //___________________________________________________________________________________
35 // INCLUDES
36 //___________________________________________________________________________________
37  #include "GraphicStylesID.h"
38  #include "IPMUnknown.h"
39 //___________________________________________________________________________________
40 // CLASS FORWARDS
41 //___________________________________________________________________________________
42  class IWorkspace;
43  class ICommand;
44  class IRenderingObject;
45  class UIDList;
46 //===================================================================================
47 //___________________________________________________________________________________
48 // CLASS DECLARATION
49 //___________________________________________________________________________________
56  {
57  public:
58  enum preserveReference {kPreserveNone = 0, kPreserveGlobals, kPreserveAll};
59 
60  //___________________________________________________________________________
61  // Utilities
62  //___________________________________________________________________________
63  public:
64  virtual ClassID GetRenderObjectClassID (void) = 0;
65  virtual ClassID GetMetaObjectClassID (void) = 0;
66  virtual ClassID GetRenderObjectDeleteCommandClassID (void) = 0;
67 
68  // This method is only called once when the graphic state intializes for
69  // the first time. It should not be called from anywhere else.
70  virtual IPMUnknown* CreateInitialMetaData (IWorkspace*) = 0;
71 
72  // This method fills in default values for a rendering object.
73  virtual void InitializeRenderObject (IPMUnknown*, IWorkspace*) = 0;
74 
75  //___________________________________________________________________________
76  // Conversion Utilities
77  //___________________________________________________________________________
78  public:
79  virtual IPMUnknown* CreateDuplicateMetaData (IPMUnknown*, bool16) = 0;
80 
81  virtual IPMUnknown* CreateMetaData (IPMUnknown*, IGraphicMetaConverter::preserveReference) = 0;
82  virtual IPMUnknown* CreateMetaData (IPMUnknown*, bool16 ) = 0;
83  virtual IPMUnknown* CreateMetaData (void) = 0;
84 
85  virtual UID GetRenderObjectUID (const IPMUnknown*, IWorkspace*) = 0;
86 
87  virtual UIDList* CreateRenderObjectUIDList (const IPMUnknown*, ClassID, const UIDList*, IWorkspace*) = 0;
88 
89  // This method creates a new rendering object matching the meta data object in the
90  // given workspace. The attributes/data that are used to create the new render
91  // object should be completely described by the meta data object.
92  // It returns the new UID of the render object
93  virtual UID CreateNewRenderObject (IPMUnknown*, IWorkspace*) = 0;
94 
95  // This method creates a new rendering object matching the meta data object and the
96  // current attributes in the graphic state. The render object is created in the
97  // current active workspace.
98  // It returns a list of relevant UIDs for the new objects created.
99  // For most render objects, the UIDList contains one item. An example where
100  // a render object might returns more than one UID in the list is the color
101  // render object. In this case, depending on the current graphic state, it might
102  // returns two UIDs - one is a new base color UID and the other is a tinted color
103  // of the base color. In this case, the base color is hidden and the tinted color
104  // is visible.
105  virtual UIDList CreateNewRenderObject (IPMUnknown*) = 0;
106 
107  //___________________________________________________________________________
108  // Copmare Utilities
109  //___________________________________________________________________________
110  public:
111  virtual bool16 RenderingObjectsEqual (IRenderingObject*, IRenderingObject*) = 0;
112  virtual bool16 MetaDataObjectsEqual (IPMUnknown*, IPMUnknown*) = 0;
113 
114  };
115 
116 #endif // _IGraphicMetaConverter_