VCOM:VectorWorks:UI:IColorServices

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks::UI

Interface

static const VWIID IID_ColorServices = { 0x1798db00, 0xf7fe, 0x11db, { 0x83, 0x14, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } };
class IColorServices : public IVWUnknown
{
public:	
  // ReducePalette accepts a set of colors and then finds a smaller set of colors which is a good fit.
  virtual VCOMError VCOM_CALLTYPE ReducePalette( const TGSColorV2 *fullPalette, Uint32 fullPaletteSize, TGSColorV2 *reducedPalette, Uint32 &ioReducedPaletteSize ) = 0;																						

  // These functions allow one to manipulate color palette files.
  virtual VCOMError VCOM_CALLTYPE CreatePalette( const SColorRecord *inColorRecords, const Uint32 inCColors, const TXString &inPaletteFilename ) = 0;																						
  virtual VCOMError VCOM_CALLTYPE GetColorsForPalette( const TXString &inPaletteFilename, IColorRecordReceiver *colorReceiver ) = 0;	
  virtual VCOMError VCOM_CALLTYPE PaletteExists( const TXString &inPaletteFilename, bool &outExists ) = 0;																						
  virtual VCOMError VCOM_CALLTYPE DuplicatePalette( const TXString &inPaletteFilename, TXString &outName ) = 0;																						
  virtual VCOMError VCOM_CALLTYPE RenamePalette( const TXString &inPaletteFilename, const TXString &inNewName ) = 0;																						
  virtual VCOMError VCOM_CALLTYPE DeletePalette( const TXString &inPaletteFilename ) = 0;	

  // These functions obtains information about the activated color palettes
  virtual VCOMError VCOM_CALLTYPE GetNumberOfActivatedPalettes( Uint32 &outNActivatedPalettes ) = 0;	
  virtual VCOMError VCOM_CALLTYPE GetPaletteFilename( Uint32 paletteIndex, TXString &outName ) = 0;	
  virtual VCOMError VCOM_CALLTYPE GetPaletteName( Uint32 paletteIndex, TXString &outName ) = 0;	
  virtual VCOMError VCOM_CALLTYPE IsDocumentColorPaletteActive( bool &isActive, TXString &outPaletteName ) = 0;																																														

  // These functions get/set the preferences for how the color menu is to appear
  virtual VCOMError VCOM_CALLTYPE GetViewAsPreference( EViewAsPreference &outViewAs ) = 0;	
  virtual VCOMError VCOM_CALLTYPE SetViewAsPreference( EViewAsPreference inViewAs ) = 0;	

  virtual VCOMError VCOM_CALLTYPE GetSortOrderPreference( ESortOrder &outSortOrder ) = 0;	
  virtual VCOMError VCOM_CALLTYPE SetSortOrderPreference( ESortOrder inSortOrder ) = 0;	

  virtual VCOMError VCOM_CALLTYPE GetPlacementPreference( EPlacement &outPlacement ) = 0;	
  virtual VCOMError VCOM_CALLTYPE SetPlacementPreference( EPlacement inPlacement ) = 0;	

  virtual VCOMError VCOM_CALLTYPE GetShrinkToFitPreference( bool &outShrinkToFit) = 0;	
  virtual VCOMError VCOM_CALLTYPE SetShrinkToFitPreference( bool inShrinkToFit ) = 0;	

  virtual VCOMError VCOM_CALLTYPE GetCurrentPaletteName( TXString &outName ) = 0;	
  virtual VCOMError VCOM_CALLTYPE SetCurrentPaletteName( const TXString &inName ) = 0;

  virtual VCOMError VCOM_CALLTYPE RunPickColorFromPaletteDialog(ColorRef& colorRef) = 0;
  virtual VCOMError VCOM_CALLTYPE RunColorPaletteManagerDialog() = 0;
			
  // This function is used to obtain localized strings related to the menu
  virtual VCOMError VCOM_CALLTYPE GetString( EStringSelector whichString, TXString &outString ) = 0; 

  // This function is used to obtain strings used for color tooltips
  virtual VCOMError VCOM_CALLTYPE GetTooltipStrings( const SColorRecord &inColorRecord, TXString &outRGBString, TXString &outHSVString, TXString &outCMYKString, TXString &outUnnamedString ) = 0;

  // This function is used to compare colors in the document color table.
  virtual VCOMError VCOM_CALLTYPE CompareColors( ColorRef inA, ColorRef inB, ESortOrder inSortOrder, int &outCompareResult ) = 0;
};

Members

ReducePalette no info
CreatePalette no info
GetColorsForPalette no info
PaletteExists no info
DuplicatePalette no info
RenamePalette no info
DeletePalette no info
GetNumberOfActivatedPalettes no info
GetPaletteFilename no info
GetPaletteName no info
IsDocumentColorPaletteActive no info
GetViewAsPreference no info
SetViewAsPreference no info
GetSortOrderPreference no info
SetSortOrderPreference no info
GetPlacementPreference no info
SetPlacementPreference no info
GetShrinkToFitPreference no info
SetShrinkToFitPreference no info
GetCurrentPaletteName no info
SetCurrentPaletteName no info
RunPickColorFromPaletteDialog no info
RunColorPaletteManagerDialog no info
GetString no info
GetTooltipStrings no info
CompareColors no info

Remarks

There is predefined type for smart VCOM pointer VCOMPtr to IColorServices interface:

typedef VCOMPtr<IColorServices>  IColorServicesPtr;
enum EViewAsPreference {		
  eViewAsPreference_Grid  = 0,
  eViewAsPreference_List  = 1,
};
enum ESortOrder {		
  eSortOrder_Manual                = 0,
  eSortOrder_HSV                   = 1,
  eSortOrder_AscendingAlphabetical = 2,
  eSortOrder_DecendingAlphabetical = 3,
};
enum EPlacement {		
	ePlacement_Top    = 0,
	ePlacement_Bottom = 1,
};
enum EStringSelector {
  eStringSelector_Measured                          = 1,
  eStringSelector_StandardColorPickerHelpShort      = 2,
  eStringSelector_StandardColorPickerHelpExpanded   = 3,
  eStringSelector_PickColorHelpShort                = 4,
  eStringSelector_PickColorHelpExpanded             = 5,
  eStringSelector_ColorPaletteManagerHelpShort      = 6,
  eStringSelector_ColorPaletteManagerHelpExpanded   = 7,
  eStringSelector_ByClassHelpShort                  = 8,
  eStringSelector_ByClassHelpExpanded               = 9,
  eStringSelector_TextAreaHelpShort                 = 10,
  eStringSelector_TextAreaHelpExpanded              = 11,
  eStringSelector_PaletteButtonPrefixHelpShort      = 12,
  eStringSelector_PaletteButtonPrefixHelpExpanded   = 13,
  eStringSelector_MenuPreferencesHelpShort          = 14,
  eStringSelector_MenuPreferencesHelpExpanded       = 15,
  eStringSelector_ByClass              	            = 16,
  eStringSelector_Color                	            = 17,
  eStringSelector_ColorName                         = 18,
  eStringSelector_Grid                              = 19,
  eStringSelector_List                              = 20,
  eStringSelector_Manual               	            = 21,
  eStringSelector_ByColor              	            = 22,
  eStringSelector_AscendingAlphabetical             = 23,
  eStringSelector_DecendingAlphabetical             = 24,
  eStringSelector_TopOfMenu                         = 25,
  eStringSelector_BottomOfMenu                      = 26,
  eStringSelector_ViewColorPaletteAs                = 27,
  eStringSelector_SortColorPaletteBy                = 28,
  eStringSelector_PlaceColorPalettesAt              = 29,
  eStringSelector_ShrinkToFit                       = 30,
  eStringSelector_PaletteReadError                  = 31,
  eStringSelector_PaletteReadErrorAdvicePrefix      = 32,
  eStringSelector_PaletteReadErrorAdviceSuffix      = 33,
  eStringSelector_ActiveDocument                    = 34,
};

Version

Available from: VectorWorks 12

See Also

VCOM:VCOMPtr

[[VCOM:VCOMPtr]]