Unity Action API
Signals | Public Member Functions | Properties | List of all members
unity::action::PreviewAction Class Reference

previewable action More...

Inheritance diagram for unity::action::PreviewAction:
unity::action::Action

Signals

void cancelled ()
 
void commitLabelChanged (const QString &value)
 
void parametersChanged ()
 
void resetted ()
 
void started ()
 
- Signals inherited from unity::action::Action
void descriptionChanged (const QString &value)
 
void enabledChanged (bool value)
 
void iconNameChanged (const QString &value)
 
void keywordsChanged (const QString &value)
 
void nameChanged (const QString &value)
 
void parameterTypeChanged (unity::action::Action::Type value)
 
void textChanged (const QString &value)
 
void triggered (QVariant value)
 

Public Member Functions

 PreviewAction (QObject *parent=0)
 
Q_INVOKABLE void addParameter (unity::action::PreviewParameter *parameter)
 
QString commitLabel () const
 
QList< PreviewParameter * > parameters ()
 
Q_INVOKABLE void removeParameter (unity::action::PreviewParameter *parameter)
 
void setCommitLabel (const QString &value)
 
- Public Member Functions inherited from unity::action::Action
 Action (QObject *parent=0)
 
QString description () const
 
bool enabled () const
 
QString iconName () const
 
QString keywords () const
 
QString name () const
 
Type parameterType () const
 
void setDescription (const QString &value)
 
void setEnabled (bool value)
 
void setIconName (const QString &value)
 
void setKeywords (const QString &value)
 
void setName (const QString &value)
 
void setParameterType (Type value)
 
void setText (const QString &value)
 
QString text () const
 

Properties

QString commitLabel
 
- Properties inherited from unity::action::Action
QString description
 
bool enabled
 
QString iconName
 
QString keywords
 
QString name
 
unity::action::Action::Type parameterType
 
QString text
 

Additional Inherited Members

- Public Types inherited from unity::action::Action
enum  Type {
  None, String, Integer, Bool,
  Real
}
 Available parameter types. More...
 
- Public Slots inherited from unity::action::Action
void trigger (QVariant value=QVariant())
 

Detailed Description

previewable action

The preview action is an action that allows the application to generate a preview of the action before the action is applied. The preview is controlled by the HUD UI.

PreviewActions contain one or more parameters which form the preview parameters of the action.

For more details see Preview Actions

Note
Even though PreviewAction is subclass of Action not all of the properties of Action base class are supported.
Action::parameterType must be Action::None

Constructor & Destructor Documentation

PreviewAction::PreviewAction ( QObject *  parent = 0)
explicit
Parameters
parentparent QObject or 0

Constructs a new PreviewAction. See the property documentation for default values.

Member Function Documentation

void PreviewAction::addParameter ( unity::action::PreviewParameter parameter)
Parameters
parameterparameter to be added

Adds a parameter.

Calling this function multiple times with the same parameter does not have any side effects; the parameter gets added only once.

PreviewAction monitors if the parameter is deleted and does the appropriate cleanup when necessary, so it is not mandatory to call removeParameter() before the action is destroyed.

Note
parameter must not be 0.
void unity::action::PreviewAction::cancelled ( )
signal

Signal to inform that the user has cancelled the action from the HUD UI. No modifications should be done on the application and the program should return to the state it was before the action was first started.

QList< PreviewParameter * > PreviewAction::parameters ( )
Returns
The list of parameters added to the action.
void unity::action::PreviewAction::parametersChanged ( )
signal

Notifies that a parameter was either added or removed.

void PreviewAction::removeParameter ( unity::action::PreviewParameter parameter)
Parameters
parameterparameter to be removed

Remove a parameter.

Calling this function multiple times with the same parameter does not have any side effects; the parameter gets removed only if it was previously added with addParameter().

Note
parameter must not be 0
void unity::action::PreviewAction::resetted ( )
signal

Signal to inform that the user has clicked the "reset" button from the HUD UI. The action is still active on the HUD UI but the application should reset the values of the parameters to the same values they where when the action was started.

void unity::action::PreviewAction::started ( )
signal

Signal to inform that a action is selected in the HUD UI. The application should set the values of the parameters to their initial state.

Property Documentation

QString PreviewAction::commitLabel
readwrite

User visible label shown in the HUD parameter view.

This is the label shown in the HUD UI on the button that applies or commits the action after the user is happy with the parameters.

If set to empty string the HUD UI will use a default commit label.

Initial Value:
""
Accessors:
commitLabel(), setCommitLabel()
Notify:
commitLabelChanged()

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