InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IClassInfo.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Robin_Briggs
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 //========================================================================================
26 
27 #ifndef __ICLASSINFO__
28 #define __ICLASSINFO__
29 
30 #include "ShuksanID.h"
31 #include "IControllingUnknown.h"
32 #include <utility>
33 
34 // Forward declare
35 class InterfaceInfo;
36 
45 public:
49  virtual int32 CountInterfaces() const = 0;
50 
57  virtual PMIID GetInterface(int32 index) const = 0;
58 
63  virtual ImplementationID GetImplementation(PMIID whichInterface) const = 0;
64 
69  virtual ImplementationID GetImplementationByIndex(int32 interfaceIndex) const = 0;
70 
75  virtual PMIID GetIID(ImplementationID whichInterface) const = 0;
76 
80  virtual ClassID GetClass() const = 0;
81 
86  virtual ClassID GetParentClass() const = 0;
87 
92  virtual PluginID GetOwnerComponent(PMIID forWhat = IID_IUNKNOWN) const = 0;
93 
94 
95 
97  // For Internal Use Only
99 
100 #ifdef USE_ALLOCATE_WITH_BOSS
101  // Return the size in bytes to allocate for the boss.
102  virtual int32 LengthInBytes() const = 0;
103 #endif
104 
105  // Create a new instance of the interface. The instance is
106  // completely blank, and will require initialization by the
107  // caller (for instance, to specify the boss).
108  virtual IPMUnknown *CreateInterface(InterfaceInfo const* interfaceInfo, IControllingUnknown *boss) const = 0;
109 
110  // Delete the interface/
111  virtual void DestructInterface(int32 index, IPMUnknown *obj) const = 0;
112 
113  // Return the index where PMIID is found, or -1 if there is none.
114  virtual int32 GetIndex(PMIID interfaceID) const = 0;
115 
116 #ifdef USE_ALLOCATE_WITH_BOSS
117  // Return the offset within the boss block of the n'th interface, or 0 if the
118  // interface is indepenedently allocated.
119  virtual int32 GetOffset(int32 i) const = 0;
120 
121  // Return true if all interfaces are allocated in the same memory block as the boss.
122  virtual bool16 IsAtomic() const = 0;
123 #endif
124 
125  virtual void Init(ClassID clsID) = 0;
126 
127  // Set the UID of the object model that owns this class info.
128  //virtual void SetObjectModel(UID objectModel) = 0;
129 
130  // Set the ClassID of the class that this classinfo represents. Invalid if
131  // the class already has a ClassID.
132  //virtual void SetClass(ClassID clsID) = 0;
133 
134  // Set the parent (base) class. Does nothing if the owner or parent has
135  // already been set.
136  virtual void SetParentClass(ClassID parentClass) = 0;
137 
138  // Sets the owner as specified. Does nothing if the owner has already been set.
139  virtual void SetOwnerComponent(PluginID owner) = 0;
140 
141  // Add a new interface to the class. The interface is identified
142  // by the interfaceID, and instances of it can be created
143  // with the factory.
144  virtual void AddInterface(PMIID interfaceID, ImplementationID faceID, PluginID owner, bool16 asAddin = kFalse) = 0;
145 
151  virtual std::pair<InterfaceInfo const*, int32> FindInterfaceInfo(PMIID interfaceID) const = 0;
152 
156  virtual void FinalizeClassInfo() = 0;
157 
158  virtual void Unregister(PluginID owner) = 0;
159 
160  // Keep track of how many bosses are currently instantiated for this class
161 #ifdef DEBUG
162 public:
163  virtual void ConstructedBoss() const = 0;
164  virtual void DestructedBoss() const = 0;
165  virtual int32 CurrentInstanceCount() const = 0;
166  virtual int32 InstanceCount() const = 0;
167  virtual int32 HighWaterMark() const = 0;
168 #endif
169 
170 #ifdef DEBUG
171  virtual void QueriedInterface(int32 index) = 0;
172 #endif
173 
174  virtual IPMUnknown *ConstructBoss() const = 0;
175 };
176 
177 
178 #endif // __ICLASSINFO__