1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 
14 
15 
16 #ifndef _DecoratorStyle_h_
17 #define _DecoratorStyle_h_
18 
19 #include "Base.h"
20 #include "SymbolManager.h"
21 #include <X11/Intrinsic.h>
22 
23 
24 #define ClassDecoratorStyle	"DecoratorStyle"
25 
26 class Dictionary;
27 class Decorator;
28 
29 typedef Decorator*
30 (*DecoratorAllocator)(boolean developerStyle);
31 
32 extern void BuildtheDecoratorStyleDictionary(void);
33 
34 class DecoratorStyle : public Base {
35   private:
36 
37     Symbol		name;
38     DecoratorAllocator	allocateDecorator;
39     boolean		isDefault;
40     char *		key;
41     boolean		useInVPE;
42 
43   public:
44 
45     enum DecoratorStyleEnum {
46 	    UnknownStyle     = 0,
47 	    DefaultStyle     = 1,
48 	    LabelStyle       = 2,
49 	    SeparatorStyle   = 3,
50 	    PostItStyle      = 4
51     };
52 
53   protected:
54     DecoratorStyleEnum style;
55 
56   public:
57     //
58     // Added supported style/name/decoratorbuild group to the list
59     // of supported styles for the given named decorator (node name).
60     //
61     static boolean AddSupportedStyle(const char *decorator,
62 		    DecoratorStyleEnum style,
63 		    const char *stylename,
64 		    boolean useInVPE,
65 		    DecoratorAllocator ia);
66 
67     static void BuildDictionary(void);
68     //
69     // Get the DecoratorStyle entry associated with the give decorator
70     // (node name) and the give style or style name.
71     //
72     static DecoratorStyle *GetDecoratorStyle(const char* decorator,
73 			    DecoratorStyleEnum style);
74     static DecoratorStyle *GetDecoratorStyle(const char* decorator,
75 			    const char *stylname);
76     static void 	   SetDefaultStyle(const char* decorator,
77 			    DecoratorStyleEnum style);
78 
79     //
80     // Return the list of DecoratorStyles for the give decorator (node name).
81     //
82     static Dictionary *GetDecoratorStyleDictionary(const char* decorator);
83     static Dictionary *GetDecoratorStyleDictionary();
84 
85 
86     DecoratorStyle(DecoratorStyleEnum s, const char *n, boolean useInVPE,
87 				DecoratorAllocator ia, const char *key);
88 
89     ~DecoratorStyle();
90 
91     Decorator *createDecorator(boolean developerStyle);
92 
allowedInVPE()93     boolean allowedInVPE() { return this->useInVPE; }
94 
getKeyString()95     const char *getKeyString()
96 	{ return this->key; }
getNameString()97     const char *getNameString()
98 	{ return theSymbolManager->getSymbolString(this->name); }
getStyleEnum()99     DecoratorStyleEnum getStyleEnum() { return this->style; }
100 
getClassName()101     const char *getClassName()
102 		{ return ClassDecoratorStyle; }
103 
104 };
105 
106 
107 #endif	// _DecoratorStyle_h_
108