ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
Ufe::ContextItem Struct Reference

Structure to describe contextual operations. More...

#include <contextOps.h>

Public Types

enum  HasChildren { kNoChildren = false , kHasChildren = true }
 
enum  Checkable { kNotCheckable = false , kCheckable = true }
 
enum  Checked { kNotChecked = false , kChecked = true }
 
enum  Exclusive { kNotExclusive = false , kExclusive = true }
 
enum  Enabled { kDisabled = false , kEnabled = true }
 
enum  SeparatorTag { kSeparator }
 

Public Member Functions

 ContextItem ()=default
 
 ContextItem (const std::string &argItem, const std::string &argLabel, bool argHasChildren=false, bool argCheckable=false, bool argChecked=false, bool argExclusive=false, bool argEnabled=true)
 
 ContextItem (const std::string &argItem, const std::string &argLabel, const std::string &argImage, bool argHasChildren=false, bool argCheckable=false, bool argChecked=false, bool argExclusive=false, bool argEnabled=true)
 Convenience constructor for creating an item with image icon. More...
 
 ContextItem (SeparatorTag, const std::string &argLabel="")
 Convenience constructor for creating a separator item, with optional label. More...
 

Public Attributes

std::string item {}
 The runtime's string that describes the operation or option. More...
 
std::string label {}
 The user-visible string, possibly localized. More...
 
std::string image {}
 The filename of the icon associated with the item. More...
 
bool hasChildren {false}
 
bool checkable {false}
 Can the item be in a checked state? More...
 
bool checked {false}
 Is the item checked? More...
 
bool exclusive {false}
 
bool enabled {true}
 Is the item enabled? A disabled item will be grayed out. More...
 
bool separator {false}
 Is this item a separator? More...
 

Static Public Attributes

Meta Data Keys:
static constexpr char kIsOptionBox [] = "isOptionBox"
 

Meta Data Access:

ValueDictionary metaData
 The meta data can be used to include DCC-specific data, without making UFE's interface platform specific. More...
 
Ufe::Value getMetaData (const std::string &key) const
 
void setMetaData (const std::string &key, const Ufe::Value &value)
 

Detailed Description

Structure to describe contextual operations.

Provides simple aggregation to describe the presentation and characteristics a contextual operation.

Definition at line 31 of file contextOps.h.

Member Enumeration Documentation

◆ Checkable

Enumerator
kNotCheckable 
kCheckable 

Definition at line 34 of file contextOps.h.

◆ Checked

Enumerator
kNotChecked 
kChecked 

Definition at line 35 of file contextOps.h.

◆ Enabled

Enumerator
kDisabled 
kEnabled 

Definition at line 37 of file contextOps.h.

◆ Exclusive

Enumerator
kNotExclusive 
kExclusive 

Definition at line 36 of file contextOps.h.

◆ HasChildren

Enumerator
kNoChildren 
kHasChildren 

Definition at line 33 of file contextOps.h.

◆ SeparatorTag

Enumerator
kSeparator 

Definition at line 39 of file contextOps.h.

Constructor & Destructor Documentation

◆ ContextItem() [1/4]

Ufe::ContextItem::ContextItem ( )
default

◆ ContextItem() [2/4]

Ufe::ContextItem::ContextItem ( const std::string &  argItem,
const std::string &  argLabel,
bool  argHasChildren = false,
bool  argCheckable = false,
bool  argChecked = false,
bool  argExclusive = false,
bool  argEnabled = true 
)

◆ ContextItem() [3/4]

Ufe::ContextItem::ContextItem ( const std::string &  argItem,
const std::string &  argLabel,
const std::string &  argImage,
bool  argHasChildren = false,
bool  argCheckable = false,
bool  argChecked = false,
bool  argExclusive = false,
bool  argEnabled = true 
)

Convenience constructor for creating an item with image icon.

◆ ContextItem() [4/4]

Ufe::ContextItem::ContextItem ( SeparatorTag  ,
const std::string &  argLabel = "" 
)

Convenience constructor for creating a separator item, with optional label.

Member Function Documentation

◆ getMetaData()

Ufe::Value Ufe::ContextItem::getMetaData ( const std::string &  key) const

Get the value of the meta data named key.

Parameters
[in]keyThe meta data key to query.
Returns
the value if the key exists in meta data. If the key does not exist an empty Ufe::Value is returned.

◆ setMetaData()

void Ufe::ContextItem::setMetaData ( const std::string &  key,
const Ufe::Value value 
)

Set the meta data key's value to value.

Parameters
[in]keyThe meta data key to set.
[in]valueThe value to set.

Member Data Documentation

◆ checkable

bool Ufe::ContextItem::checkable {false}

Can the item be in a checked state?

Definition at line 121 of file contextOps.h.

◆ checked

bool Ufe::ContextItem::checked {false}

Is the item checked?

Definition at line 124 of file contextOps.h.

◆ enabled

bool Ufe::ContextItem::enabled {true}

Is the item enabled? A disabled item will be grayed out.

Definition at line 131 of file contextOps.h.

◆ exclusive

bool Ufe::ContextItem::exclusive {false}

Is the item part of a set of checkable items where a single item can be checked (mutually exclusive items)?

Definition at line 128 of file contextOps.h.

◆ hasChildren

bool Ufe::ContextItem::hasChildren {false}

Does the item have children, i.e. an operation with options, or an option with sub-options?

Definition at line 118 of file contextOps.h.

◆ image

std::string Ufe::ContextItem::image {}

The filename of the icon associated with the item.

Definition at line 114 of file contextOps.h.

◆ item

std::string Ufe::ContextItem::item {}

The runtime's string that describes the operation or option.

Definition at line 108 of file contextOps.h.

◆ kIsOptionBox

constexpr char Ufe::ContextItem::kIsOptionBox[] = "isOptionBox"
staticconstexpr

Meta Data key: isOptionBox, value type = bool
Indicates that an item will be an option box item. This item usually appears to the right of the preceding item.

Definition at line 75 of file contextOps.h.

◆ label

std::string Ufe::ContextItem::label {}

The user-visible string, possibly localized.

Definition at line 111 of file contextOps.h.

◆ metaData

ValueDictionary Ufe::ContextItem::metaData

The meta data can be used to include DCC-specific data, without making UFE's interface platform specific.

Definition at line 101 of file contextOps.h.

◆ separator

bool Ufe::ContextItem::separator {false}

Is this item a separator?

Definition at line 134 of file contextOps.h.


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