InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
iuicolorutils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
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 __IUIColorUtils__
25 #define __IUIColorUtils__
26 
27 #include "AppFrameworkID.h"
28 #include "IPMUnknown.h"
29 #include "Utils.h"
30 
31 #include "IColorData.h"
32 
33 #include "PMString.h"
34 
35 class IScript;
36 class IScriptRequestData;
38 class IDocument;
39 
40 // Constant used to adjust ui colors for handle shape drawing.
41 // Used in AdjustUIColorValue.
42 const PMReal kDefaultUIColorAdjust = 0.5;
43 
52 class IUIColorUtils : public IPMUnknown
53 {
54 public:
55  enum { kDefaultIID = IID_IUICOLORUTILS };
56 
59  enum {
64  kFirstUIColor = kStockUILightBlue,
65  kStockUIRed,
66  kStockUIGreen,
67  kStockUIBlue,
68  kStockUIYellow,
69  kStockUIMagenta,
70  kStockUICyan,
71  kStockUIGray,
72  kStockUIBlack,
73  kStockUIOrange,
74  kStockUIDarkGreen,
75  kStockUITeal,
76  kStockUITan,
77  kStockUIBrown,
78  kStockUIViolet,
79  kStockUIGold,
80  kStockUIDarkBlue,
81  kStockUIPink,
82  kStockUILavender,
83  kStockUIBrickRed,
84  kStockUIOlive,
85  kStockUIPeach,
86  kStockUIBurgundy,
87  kStockUIGrassGreen,
88  kStockUIOchre,
89  kStockUIPurple,
90  kStockUILightGray,
91 
92  kLastRomanUIColor = kStockUILightGray,
93 
97  kFirstJUIColor = kStockUICharcoal,
98  kStockUIGridBlue,
99  kStockUIGridOrange,
100  kStockUIFiesta,
101  kStockUILightOlive,
102  kStockUILipstick,
103  kStockUICuteTeal,
104  kStockUISulfur,
105  kStockUIGridGreen,
106  kStockUIWhite,
107 
108  kLastJUIColor = kStockUIWhite,
109  kLastUIColor = kStockUIWhite,
110 
114  kStockMarginGuide = kStockUIMagenta,
115  kStockRulerGuide = kStockUICyan,
116  kStockColumnGuide = kStockUIViolet,
117  kStockDocumentGrid = kStockUILightGray,
118  kStockFloor = kStockUILightGray,
119  kStockDynamicSpell = kStockUIRed,
120  kStockDynamicSpellGrammar = kStockUIGreen,
121  kStockJBaselineGrid = kStockUILightBlue,
122  kStockJMarginGuide = kStockUILipstick,
123  kStockJColumnGuide = kStockUILavender,
124  kStockLayoutGrid = kStockUIGridGreen,
125  kStockReferencePoint = kStockUITeal,
126  kStockPasteboard = kStockUIWhite,
127  kStockXMLTag = kStockUIGray,
128  kStockPreviewBackground = kStockUILightGray
129 
130  };
131 
134  enum {
135  kNumUIColors = kLastUIColor - kFirstUIColor + 1
136  };
137 
138 
139  enum
140  {
141  kRed = 0,
142  kGreen,
143  kBlue
144  };
145 
146 
154  virtual void BuildUIColorNameList(IStringListControlData *stringData, bool16 bAddOther = kTrue) = 0;
155 
161  virtual int32 GetUIColorNum( ) = 0;
162 
168  virtual PMString GetUIColorName(int32 index) = 0;
169 
180  virtual UIDRef GetUIColor(int32 stockColor, IDocument* doc) = 0;
181 
191  virtual int32 GetUIColorIndex(UID stockColorUID, IDocument* doc) = 0;
192 
199  virtual ColorArray GetStockUIColorRGBValue( int32 stockColor ) = 0;
200 
214  virtual ColorArray GetRGBColorValue( IDataBase* db, UID colorUID ) = 0;
215 
227  virtual ColorArray GetAdjustedUIColorValue(ColorArray& color, PMReal adjustFactor) = 0;
228 
229  //FOR SCRIPTING -----------------------------------------------------------------------
230 
241  virtual int32 GetUIColor( IScriptRequestData* data, IScript* script, const ScriptID& propID, UID colorUID = kInvalidUID, int32 colorIndex = -1 ) = 0 ;
248  virtual int32 SetUIColor( IScriptRequestData* data, IScript* script, const ScriptID& propID, UID* colorUID ) = 0 ;
249 
250 #if MACINTOSH
251  // FOR INTERNAL USE ONLY
252  virtual uchar* QueryPNGImageBuffer(IPMStream* stream, size_t& outLength) = 0;
253 #endif
254 };
255 
256 
257 #endif // __IUIColorUtils__