Public Member Functions

IBrushPresetContext Class Reference

Search for all occurrences

Detailed Description

Interface to a brush preset context.

A context represents a specific brush-based feature, defining a set of parameters used by the features and a UI. Context objects are responsible for creating and deleting the parameter set objects held by a brush preset, and for providing general information about the parameters. Contexts are required to communicate with the manager in the following ways: 1) Contexts should register themselves with the manager as soon as they loaded into memory, using IBrushPresetMgr::RegisterContext(). If the context plug-in is loaded before the manager plug-in, then the context can use a notification handler to register with the manager after system startup. 2) When a context is active, meaning its UI is displayed and ready to begin painting, the context should call IBrushPresetMgr::BeginContext(), and EndContext() when the context is deactivated. 3) When the user changes any parameter in the context's UI, the context should call IBrushPresetMgr::OnContextUpdated().
Implemented by the plug-in.

#include <IBrushPresets.h>

Inheritance diagram for IBrushPresetContext:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~IBrushPresetContext ()
  Destructor.
virtual Class_ID  ContextID ()=0
  Returns the unique ID for the context. These ID numbers should be random, as per standard class IDs.
virtual MCHAR *  GetContextName ()=0
  Returns a name for the context. This is for UI display and may be localized.
virtual IBrushPresetParams CreateParams ()=0
  Creates and returns a parameter set object of appropriate type for this context.
virtual void  DeleteParams (IBrushPresetParams *params)=0
  Deletes a parameter set object created by this context.
virtual int  GetNumParams ()=0
  Returns the number of individual parameters in a parameter set of this context.
virtual int  GetParamID (int paramIndex)=0
  Translates the index number of a parameter value into the corresponding parameter ID.
virtual int  GetParamIndex (int paramID)=0
  Translates the ID of a parameter value into the corresponding parameter index number.
virtual MCHAR *  GetParamName (int paramID)=0
  Returns the name of a parameter value.
virtual ParamType2  GetParamType (int paramID)=0
  Returns the type of a parameter value.
virtual int  GetNumDisplayParams ()
  Returns the number of parameters that should be displayed in the brush preset manager dialog.
virtual int  GetDisplayParamID (int displayIndex)
  Translates the index number of a display parameter into the corresponding parameter ID.
virtual int  GetDisplayParamIndex (int paramID)
  Translates the ID of a parameter value into the corresponding display parameter index number.
virtual MCHAR *  GetDisplayParamName (int paramID)
  Returns the name of a display parameter.
virtual BOOL  IsDisplayParam (int paramID)
  Returns whether the given parameter should be displayed in the brush preset manager dialog.
virtual BOOL  IsTransientParam (int paramID)
  Returns whether the given parameter is transient.
virtual Class_ID  PluginClassID ()=0
  Returns the class ID of a plug-in implemented in the same module as this context.
virtual SClass_ID  PluginSuperClassID ()=0
  Returns the superclass ID of a plug-in implemented in the same module as this context.

Constructor & Destructor Documentation

virtual ~IBrushPresetContext ( ) [inline, virtual]

Destructor.

{;}

Member Function Documentation

virtual Class_ID ContextID ( ) [pure virtual]

Returns the unique ID for the context. These ID numbers should be random, as per standard class IDs.

virtual MCHAR* GetContextName ( ) [pure virtual]

Returns a name for the context. This is for UI display and may be localized.

virtual IBrushPresetParams* CreateParams ( ) [pure virtual]

Creates and returns a parameter set object of appropriate type for this context.

virtual void DeleteParams ( IBrushPresetParams params ) [pure virtual]

Deletes a parameter set object created by this context.

This is called by the system when the user deletes a preset or at shutdown; the object passed is always a parameter set created previously by the context.

virtual int GetNumParams ( ) [pure virtual]

Returns the number of individual parameters in a parameter set of this context.

virtual int GetParamID ( int  paramIndex ) [pure virtual]

Translates the index number of a parameter value into the corresponding parameter ID.

Parameters:
[in] paramIndex The index of the parameter value
Returns:
The parameter ID for the value, or zero if the index is out of range
virtual int GetParamIndex ( int  paramID ) [pure virtual]

Translates the ID of a parameter value into the corresponding parameter index number.

Parameters:
[in] paramID The ID of the parameter value
Returns:
The index of the parameter value, or -1 if there is no parameter with the given ID
virtual MCHAR* GetParamName ( int  paramID ) [pure virtual]

Returns the name of a parameter value.

Parameters:
[in] paramID The ID of the parameter value
virtual ParamType2 GetParamType ( int  paramID ) [pure virtual]

Returns the type of a parameter value.

Parameters:
[in] paramID The ID of the parameter value
virtual int GetNumDisplayParams ( ) [inline, virtual]

Returns the number of parameters that should be displayed in the brush preset manager dialog.

{return GetNumParams();}
virtual int GetDisplayParamID ( int  displayIndex ) [inline, virtual]

Translates the index number of a display parameter into the corresponding parameter ID.

Parameters:
[in] displayIndex The index of the display parameter
Returns:
The parameter ID for the value, or zero if the index is out of range
{return GetParamID(displayIndex);}
virtual int GetDisplayParamIndex ( int  paramID ) [inline, virtual]

Translates the ID of a parameter value into the corresponding display parameter index number.

Parameters:
[in] paramID The ID of the parameter value
Returns:
The index of the parameter value, or -1 if there is no display parameter with the given ID
{return GetParamIndex(paramID);}
virtual MCHAR* GetDisplayParamName ( int  paramID ) [inline, virtual]

Returns the name of a display parameter.

Parameters:
[in] paramID The ID of the display parameter
{return GetParamName(paramID);}
virtual BOOL IsDisplayParam ( int  paramID ) [inline, virtual]

Returns whether the given parameter should be displayed in the brush preset manager dialog.

Parameters:
[in] paramID The ID of the parameter
Returns:
TRUE if the parameter should be displayed, FALSE otherwise
{ UNUSED_PARAM(paramID); return TRUE;}
virtual BOOL IsTransientParam ( int  paramID ) [inline, virtual]

Returns whether the given parameter is transient.

Transient parameters are not stored to disk. This can be useful, for example, with display-only parameters, whose value is a user-friendly string built from other non-display parameters.

Parameters:
[in] paramID The ID of the parameter
Returns:
TRUE if the parameter is transient, FALSE otherwise
{ UNUSED_PARAM(paramID); return FALSE; }
virtual Class_ID PluginClassID ( ) [pure virtual]

Returns the class ID of a plug-in implemented in the same module as this context.

The class ID is used to support deferred plug-in loading. When the brush preset manager needs to ensure that a context implementation is loaded into memory, it will load the module using this ID. The manager calls this method when a context is first registered, and then stores the value in the brush preset file for later use.

virtual SClass_ID PluginSuperClassID ( ) [pure virtual]

Returns the superclass ID of a plug-in implemented in the same module as this context.

The superclass ID is used to support deferred plug-in loading. When the brush preset manager needs to ensure that a context implementation is loaded into memory, it will load the module using this ID. The manager calls this method when a context is first registered, and then stores the value in the brush preset file for later use.


IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext
IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext IBrushPresetContext