Public Member Functions

IBrushPreset Class Reference

Search for all occurrences

Detailed Description

The interface to a brush preset object, holding parameters for the PainterInterface and other brush tools.

The interface to Brush Preset objects. A brush preset corresponds to a button on the brush preset toolbar, or a row listed in the brush preset manager dialog. A preset holds one set of parameters for each brush preset context registered with the manager. Applying or fetching a preset will apply or fetch parameters for each currently active context. The context and parameter objects are implemented by plug-ins, but the presets holding the parameter objects are implemented by the system.

#include <IBrushPresets.h>

Inheritance diagram for IBrushPreset:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~IBrushPreset ()
  Destructor.
virtual int  PresetID ()=0
  Returns an ID which uniquely identifies this preset.
virtual void  Apply ()=0
  Applies parameters from the preset into the UI, as per activating its toolbar button.
virtual void  Fetch ()=0
  Fetches parameters from the UI into the preset, as per deactivating its toolbar button.
virtual IBrushPresetParams GetParams (Class_ID contextID)=0
  Returns the parameter set held by the brush preset for a given context.
virtual int  GetNumContexts ()=0
  Returns the number of contexts for which this preset is holding parameters.
virtual Class_ID  GetContextID (int contextIndex)=0
  Translates the index number of a parameter set into the corresponding context ID.
virtual int  GetContextIndex (Class_ID contextID)=0
  Translates the context ID for a parameter set into the corresponding index number.

Constructor & Destructor Documentation

virtual ~IBrushPreset ( ) [inline, virtual]

Destructor.

{;}

Member Function Documentation

virtual int PresetID ( ) [pure virtual]

Returns an ID which uniquely identifies this preset.

Presets have an ID number unique from other presets at any given time; however if a preset is deleted, its ID number may be reassigned to other presets created later.

virtual void Apply ( ) [pure virtual]

Applies parameters from the preset into the UI, as per activating its toolbar button.

For each active brush preset context, the corresponding set of parameters held by the preset is applied via ApplyParams().

virtual void Fetch ( ) [pure virtual]

Fetches parameters from the UI into the preset, as per deactivating its toolbar button.

For each active brush preset context, the corresponding set of parameters held by the preset is fetched via FetchParams().

virtual IBrushPresetParams* GetParams ( Class_ID  contextID ) [pure virtual]

Returns the parameter set held by the brush preset for a given context.

Parameters:
[in] contextID The ID of the context
virtual int GetNumContexts ( ) [pure virtual]

Returns the number of contexts for which this preset is holding parameters.

virtual Class_ID GetContextID ( int  contextIndex ) [pure virtual]

Translates the index number of a parameter set into the corresponding context ID.

Parameters:
[in] contextIndex The index of the parameter set
Returns:
The context ID for the parameter set, or Class_ID(0,0) if the index is out of range
virtual int GetContextIndex ( Class_ID  contextID ) [pure virtual]

Translates the context ID for a parameter set into the corresponding index number.

Parameters:
[in] contextID The ID of the context
Returns:
The index of the parameter set, or -1 if the preset has no parameters for the given context

IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset
IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset IBrushPreset