InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IUIColorUtils Class Referenceabstract

#include <iuicolorutils.h>

Inheritance diagram for IUIColorUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IUICOLORUTILS }
 
enum  {
  kStockUILightBlue, kFirstUIColor = kStockUILightBlue, kStockUIRed, kStockUIGreen,
  kStockUIBlue, kStockUIYellow, kStockUIMagenta, kStockUICyan,
  kStockUIGray, kStockUIBlack, kStockUIOrange, kStockUIDarkGreen,
  kStockUITeal, kStockUITan, kStockUIBrown, kStockUIViolet,
  kStockUIGold, kStockUIDarkBlue, kStockUIPink, kStockUILavender,
  kStockUIBrickRed, kStockUIOlive, kStockUIPeach, kStockUIBurgundy,
  kStockUIGrassGreen, kStockUIOchre, kStockUIPurple, kStockUILightGray,
  kLastRomanUIColor = kStockUILightGray, kStockUICharcoal, kFirstJUIColor = kStockUICharcoal, kStockUIGridBlue,
  kStockUIGridOrange, kStockUIFiesta, kStockUILightOlive, kStockUILipstick,
  kStockUICuteTeal, kStockUISulfur, kStockUIGridGreen, kStockUIWhite,
  kLastJUIColor = kStockUIWhite, kLastUIColor = kStockUIWhite, kStockBaselineGrid = kStockUILightBlue, kStockMarginGuide = kStockUIMagenta,
  kStockRulerGuide = kStockUICyan, kStockColumnGuide = kStockUIViolet, kStockDocumentGrid = kStockUILightGray, kStockFloor = kStockUILightGray,
  kStockDynamicSpell = kStockUIRed, kStockDynamicSpellGrammar = kStockUIGreen, kStockJBaselineGrid = kStockUILightBlue, kStockJMarginGuide = kStockUILipstick,
  kStockJColumnGuide = kStockUILavender, kStockLayoutGrid = kStockUIGridGreen, kStockReferencePoint = kStockUITeal, kStockPasteboard = kStockUIWhite,
  kStockXMLTag = kStockUIGray, kStockPreviewBackground = kStockUILightGray
}
 
enum  { kNumUIColors = kLastUIColor - kFirstUIColor + 1 }
 
enum  { kRed = 0, kGreen, kBlue }
 

Public Member Functions

virtual void BuildUIColorNameList (IStringListControlData *stringData, bool16 bAddOther=kTrue)=0
 
virtual int32 GetUIColorNum ()=0
 
virtual PMString GetUIColorName (int32 index)=0
 
virtual UIDRef GetUIColor (int32 stockColor, IDocument *doc)=0
 
virtual int32 GetUIColorIndex (UID stockColorUID, IDocument *doc)=0
 
virtual ColorArray GetStockUIColorRGBValue (int32 stockColor)=0
 
virtual ColorArray GetRGBColorValue (IDataBase *db, UID colorUID)=0
 
virtual ColorArray GetAdjustedUIColorValue (ColorArray &color, PMReal adjustFactor)=0
 
virtual int32 GetUIColor (IScriptRequestData *data, IScript *script, const ScriptID &propID, UID colorUID=kInvalidUID, int32 colorIndex=-1)=0
 
virtual int32 SetUIColor (IScriptRequestData *data, IScript *script, const ScriptID &propID, UID *colorUID)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Utility interface for dealing with UI colors.

Note: This interface should be accessed through the Utils boss, eg., Utils<IUIColorUtils>()->CopyObjects( ... )

See Also
Utils

Member Enumeration Documentation

anonymous enum

For doc UI colors
Enumerator
kStockUILightBlue 

The following 27 layer colors are all colors in the IID_IUICOLORLIST. This list can be added to, but these are the default colors for items in the Preferences dialogs for these items.

kStockUICharcoal 

The following are CJK specific colors — (as of InDesign 2, these colors are in both feature sets).

kStockBaselineGrid 

These colors are surrogates for special ui colors defined above

anonymous enum

For the operations of dropdown list and color widgets

Member Function Documentation

virtual void IUIColorUtils::BuildUIColorNameList (IStringListControlDatastringData,
bool16 bAddOther = kTrue 
)
pure virtual

Fills in the string list data with the UI color names. Will optionally add "Other" at the end.

Parameters
stringDataOUT The string list control data to populate
bAddOtherIN If kTrue, the method will add an entry for "Other" at the end
virtual ColorArray IUIColorUtils::GetAdjustedUIColorValue (ColorArraycolor,
PMReal adjustFactor 
)
pure virtual

Gets a UI color adjusted by moving its RGB values closer to white (1.0). Used for standoff handle shape color, frame thread lines, and document grid subgridlines.

Note: adjustFactor must be a percent value from 0.0 (0%) to 1.0 (100%)

Parameters
colorIN The color to adjust (RGB)
adjustFactorIN The percentage by which RGB values are adjusted
Returns
The adjusted RGB color values
virtual ColorArray IUIColorUtils::GetRGBColorValue (IDataBasedb,
UID colorUID 
)
pure virtual

Gets the RGB value for a UI color from the given database. The color definition must already be in RGB color space. Otherwise, it will return the RGB value for Black.

Use this when drawing document UI related colors such as guides, layer, etc.

DO NOT use this to render any document color from the color list.

Parameters
dbIN The database for the UI color
colorUIDIN The UID for the UI color
Returns
The RGB value for the specified UI color, or the RGB value for black if the requested color is not already RGB
virtual ColorArray IUIColorUtils::GetStockUIColorRGBValue (int32 stockColor)
pure virtual

Gets the RGB value for a global UI color (from the application workspace).

Parameters
stockColorIN The index of the stock color in the global color list
Returns
The RGB value for the specified UI color
virtual UIDRef IUIColorUtils::GetUIColor (int32 stockColor,
IDocumentdoc 
)
pure virtual

Gets the stock color from the given document's UI color list (which resides in the document's workspace). If the document is nil, will default to the app UI color list.

Parameters
stockColorIN The index of the stock color to return
docIN The document in which to find the color
Returns
UIDRef for the UI color (a swatch)
See Also
IColorData
virtual int32 IUIColorUtils::GetUIColor (IScriptRequestDatadata,
IScriptscript,
const ScriptIDpropID,
UID colorUID = kInvalidUID,
int32 colorIndex = -1 
)
pure virtual

Gets the UI color for scripting. GetUIColor needs both the uid of the ui color as well as its index. However, the caller need only supply one or the other. A valid UID and an index of -1 or a kInvalidUI and a valid index.

Parameters
datais the script event data from which the data is retrieved.
scriptis the script object.
propIDis the property ID of the script object.
colorUIDis the color UID of the object.
colorIndexis the color index of the object.
virtual int32 IUIColorUtils::GetUIColorIndex (UID stockColorUID,
IDocumentdoc 
)
pure virtual

Gets the index of the specified stock color from a document's UI color list (which resides in the document's workspace). If the document is nil, will default to the app UI color list.

Parameters
stockColorUIDIN The stock color's UID
docIN The document in which to find the color
Returns
The index of the specified stock color, or -1 if it cannot be found
virtual PMString IUIColorUtils::GetUIColorName (int32 index)
pure virtual

Returns the name of the UI color at the given index.

Returns
The name of the UI color at index
virtual int32 IUIColorUtils::GetUIColorNum ()
pure virtual

Returns the number of available UI Colors.

Returns
The number of UI colors
virtual int32 IUIColorUtils::SetUIColor (IScriptRequestDatadata,
IScriptscript,
const ScriptIDpropID,
UIDcolorUID 
)
pure virtual

Sets a UI color for scripting.

Parameters
datais the script event data from which the data is retrieved.
scriptis the script object.
propIDis the property ID of the script object.
colorUIDis the new color UID to set.