HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DT_ParmDef Class Referenceabstract

#include <DT_Plugin.h>

+ Inheritance diagram for DT_ParmDef:

Public Types

enum  Type {
  T_TOGGLE, T_INTEGER, T_FLOAT, T_COLOR,
  T_STRING, T_MENU, T_PATH, T_BUTTON,
  T_GROUPED
}
 
enum  OptionType { OT_OPTION_ONLY, OT_OPTION_AND_TOOLBAR, OT_TOOLBAR_ONLY }
 

Public Member Functions

virtual ~DT_ParmDef ()
 
int id () const
 
Type type () const
 
const char * typeName () const
 
DT_ParmDefsetName (const UT_StringHolder &name)
 Set a name for this parameter definition. More...
 
const UT_StringHoldername () const
 Returns the name of the parameter definition. More...
 
DT_ParmDefsetIcon (const UT_StringHolder &icon)
 Show an icon, instead of a headet text / label. More...
 
const UT_StringHoldericon () const
 
DT_ParmDefsetTooltip (const UT_StringHolder &str)
 
const UT_StringHoldertooltip () const
 
DT_ParmDefsetReadOnly ()
 
bool readOnly () const
 
DT_ParmDefsetOptionType (OptionType opt_type)
 
OptionType optionType () const
 
DT_ParmDefsetToolbarName (const UT_StringHolder &toolbar_name)
 
const UT_StringHoldertoolbarName () const
 
DT_ParmDefsetCanBeIndeterminate ()
 The parameter can be in an indeterminate state. Ignored for options. More...
 
bool canBeIndeterminate () const
 
virtual bool allowsMultiValueSet () const
 
virtual bool operator== (const DT_ParmDef &other) const =0
 

Static Public Member Functions

static DT_ParmDefcreateFromTemplate (int id, const PRM_Template &tpl)
 
static bool getMenuItemsFromTemplate (const PRM_Template &tpl, PRM_Parm &parm, DT_MenuItemList &items)
 

Protected Member Functions

 DT_ParmDef (int id, const UT_StringHolder &name, Type parm_type)
 
- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Protected Attributes

int myId
 
UT_StringHolder myName
 
UT_StringHolder myIcon
 
Type myType
 
UT_StringHolder myTooltip
 
OptionType myOptionType
 
UT_StringHolder myToolbarName
 
bool myReadOnly
 
bool myCanBeIndeterminate
 

Detailed Description

The base class for a parameter definition. Parameter definitions are used to construct parameters for either tree values or plugin options.

Note
This class cannot be instantiated directly, use the derived types to create specific parameter types.
See Also
DT_ParmDefToggle, DT_ParmDefInteger, DT_ParmDefFloat, DT_ParmDefColor, DT_ParmDefString, DT_ParmDefMenu, DT_ParmDefPath, DT_ParmDefButton, DT_ParmDefGrouped

Definition at line 176 of file DT_Plugin.h.

Member Enumeration Documentation

Enumerator
OT_OPTION_ONLY 
OT_OPTION_AND_TOOLBAR 

Only show plugin option in dialog (default)

OT_TOOLBAR_ONLY 

Show option in both toolbar and dialog.

Definition at line 206 of file DT_Plugin.h.

Enumerator
T_TOGGLE 
T_INTEGER 

Toggle type. DT_ParmDefToggle.

T_FLOAT 

Integer type. DT_ParmDefInteger.

T_COLOR 

Floating point type. DT_ParmDefFloat.

T_STRING 

Color type. DT_ParmDefColor.

T_MENU 

String type. DT_ParmDefString.

T_PATH 

Menu type. DT_ParmDefMenu.

T_BUTTON 

Path type. DT_ParmDefPath.

T_GROUPED 

Button type. DT_ParmDefButton.

Grouped parms type. DT_ParmDefGrouped

Definition at line 193 of file DT_Plugin.h.

Constructor & Destructor Documentation

virtual DT_ParmDef::~DT_ParmDef ( )
inlinevirtual

Definition at line 191 of file DT_Plugin.h.

DT_ParmDef::DT_ParmDef ( int  id,
const UT_StringHolder name,
Type  parm_type 
)
protected

Member Function Documentation

virtual bool DT_ParmDef::allowsMultiValueSet ( ) const
inlinevirtual

Returns true if multiple selected rows can set this column value at the same time.

Reimplemented in DT_ParmDefButton, DT_ParmDefMenu, and DT_ParmDefToggle.

Definition at line 264 of file DT_Plugin.h.

bool DT_ParmDef::canBeIndeterminate ( ) const
inline

Definition at line 259 of file DT_Plugin.h.

static DT_ParmDef* DT_ParmDef::createFromTemplate ( int  id,
const PRM_Template tpl 
)
static

Create a new DT_ParmDef object from a PRM_Template object. Note that not all types of operator parameters can be converted, or represented, by DT_ParmDef. In that case it returns NULL.

static bool DT_ParmDef::getMenuItemsFromTemplate ( const PRM_Template tpl,
PRM_Parm parm,
DT_MenuItemList items 
)
static

Returns a list of menu items from a PRM_Template object. This can be used in case the menu is dynamically generated based on the parameter it is being evaluated for.

const UT_StringHolder& DT_ParmDef::icon ( ) const
inline

Definition at line 234 of file DT_Plugin.h.

int DT_ParmDef::id ( ) const
inline

Return the unique id used for this parameter definition. This id is passed to DT_Plugin::getParameterValue, DT_Plugin::setParameterValue, DT_Plugin::getOptionValue and DT_Plugin::setOptionValue.

Definition at line 216 of file DT_Plugin.h.

const UT_StringHolder& DT_ParmDef::name ( ) const
inline

Returns the name of the parameter definition.

Definition at line 230 of file DT_Plugin.h.

virtual bool DT_ParmDef::operator== ( const DT_ParmDef other) const
pure virtual
OptionType DT_ParmDef::optionType ( ) const
inline

Definition at line 248 of file DT_Plugin.h.

bool DT_ParmDef::readOnly ( ) const
inline

Definition at line 245 of file DT_Plugin.h.

DT_ParmDef* DT_ParmDef::setCanBeIndeterminate ( )

The parameter can be in an indeterminate state. Ignored for options.

DT_ParmDef* DT_ParmDef::setIcon ( const UT_StringHolder icon)

Show an icon, instead of a headet text / label.

DT_ParmDef* DT_ParmDef::setName ( const UT_StringHolder name)

Set a name for this parameter definition.

DT_ParmDef* DT_ParmDef::setOptionType ( OptionType  opt_type)
DT_ParmDef* DT_ParmDef::setReadOnly ( )

This parameter is read-only and cannot be edited. The plugin does not have to handle it in DT_Plugin::setParameterValue or DT_Plugin::setOptionValue.

DT_ParmDef* DT_ParmDef::setToolbarName ( const UT_StringHolder toolbar_name)

Set an alternative name to use on this parameter's label in the toolbar, if this parameter definition is used for both the option dialog and the toolbar. This should ideally be a more compact version of the more descriptive name used in the dialog.

DT_ParmDef* DT_ParmDef::setTooltip ( const UT_StringHolder str)

Set the tooltip to show on the header column, for parameters, or on the label/input for options.

const UT_StringHolder& DT_ParmDef::toolbarName ( ) const
const UT_StringHolder& DT_ParmDef::tooltip ( ) const
inline

Definition at line 239 of file DT_Plugin.h.

Type DT_ParmDef::type ( ) const
inline

Returns the type id of the parameter definition. See the derived definition classes for details on each type.

Definition at line 220 of file DT_Plugin.h.

const char* DT_ParmDef::typeName ( ) const

Returns a string version of the type. Used mostly for debugging purposes.

Member Data Documentation

bool DT_ParmDef::myCanBeIndeterminate
protected

Definition at line 280 of file DT_Plugin.h.

UT_StringHolder DT_ParmDef::myIcon
protected

Definition at line 274 of file DT_Plugin.h.

int DT_ParmDef::myId
protected

Definition at line 272 of file DT_Plugin.h.

UT_StringHolder DT_ParmDef::myName
protected

Definition at line 273 of file DT_Plugin.h.

OptionType DT_ParmDef::myOptionType
protected

Definition at line 277 of file DT_Plugin.h.

bool DT_ParmDef::myReadOnly
protected

Definition at line 279 of file DT_Plugin.h.

UT_StringHolder DT_ParmDef::myToolbarName
protected

Definition at line 278 of file DT_Plugin.h.

UT_StringHolder DT_ParmDef::myTooltip
protected

Definition at line 276 of file DT_Plugin.h.

Type DT_ParmDef::myType
protected

Definition at line 275 of file DT_Plugin.h.


The documentation for this class was generated from the following file: