InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DebugClassUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: lance bushore
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 // Provides some debug-only utilities to get a prefix name from an id.
24 //
25 // Third party prefixes are in DeveloperPrefix.h
26 //
27 //========================================================================================
28 
29 #ifndef _DebugClassUtils_H
30 #define _DebugClassUtils_H
31 
32 #ifdef ID_ENABLE_DEBUGGING
33 
34 #include "OMTypes.h"
35 #include "ShuksanID.h"
36 
37 enum kDebugClassUtilsBufferSizeEnum {kDebugClassUtilsBufferSize = 512} ;
38 typedef char DebugClassUtilsBuffer[kDebugClassUtilsBufferSize];
39 
40 class ModelThreadLocal_DebugClassUtilsBuffer
41  {
42  public:
43  DebugClassUtilsBuffer* Get()
44  {
45  return &fThreadLocalBuffer.Get()->fBuffer;
46  }
47  private:
48  struct DebugClassUtilsBufferWrapper
49  {
50  DebugClassUtilsBuffer fBuffer;
51  };
52 
54  };
55 
70  class DebugClassUtils
71  {
72  public:
73 
80  static const char* GetPluginName( DebugClassUtilsBuffer *pName, PluginID id );
81 
89  static const char* GetPluginName( DebugClassUtilsBuffer *pName, int32 id );
90 
91 
97  static int32 GetPrefix(int32 id);
98 
104  static int32 GetOffset(int32 id);
105 
106 
116  static bool16 IsPrefixReserved(int32 prefix);
117 
118 
125  static const char * GetIDSpaceName( DebugClassUtilsBuffer *pName, int32 idspace );
126 
139  static const char * GetIDName( DebugClassUtilsBuffer *pName, int32 id, int32 idspace = kClassIDSpace, bool16 appendGetIDString = kFalse );
140 
153  static const char *GetIDName( DebugClassUtilsBuffer *pName, ClassID id, bool16 appendGetIDString = kFalse ) ;
166  static const char *GetIDName( DebugClassUtilsBuffer *pName, PMIID id, bool16 appendGetIDString = kFalse );
167 
180  static const char *GetIDName( DebugClassUtilsBuffer *pName, ImplementationID id, bool16 appendGetIDString = kFalse );
181 
194  static const char *GetIDName( DebugClassUtilsBuffer *pName, WidgetID id, bool16 appendGetIDString = kFalse );
195 
208  static const char *GetIDName( DebugClassUtilsBuffer *pName, ActionID id, bool16 appendGetIDString = kFalse );
209 
222  static const char *GetIDName( DebugClassUtilsBuffer *pName, ServiceID id, bool16 appendGetIDString = kFalse );
223 
236  static const char *GetIDName( DebugClassUtilsBuffer *pName, PluginID id, bool16 appendGetIDString = kFalse );
237 
250  static const char *GetIDName( DebugClassUtilsBuffer *pName, ScriptElementID id, bool16 appendGetIDString = kFalse );
251 
257  static void ValidateOMId(int32 idSpace, int32 id);
258 
262  static void ValidateAllClassIds();
263 
264  private:
267  static const char* GetIDString( DebugClassUtilsBuffer *pName, int32 id);
268  };
269 
270 #endif
271 
272 
273 #endif /* _DebugClassUtils_H */