libyui
 
Loading...
Searching...
No Matches
YItemCustomStatus Class Reference

#include <YItemCustomStatus.h>

Public Member Functions

 YItemCustomStatus (const std::string &iconName, const std::string &textIndicator, int nextStatus=-1)
 
const std::string & iconName () const
 
const std::string & textIndicator () const
 
int nextStatus () const
 
void setNextStatus (int value)
 
bool hasNextStatus () const
 

Protected Attributes

std::string _iconName
 
std::string _textIndicator
 
int _nextStatus
 

Detailed Description

Class describing a non-binary status for an item.

This is an extension of normal boolean item states: Rather than just "on" or "off" like for check boxes or radio buttons, a status of this kind can have any nonnegative integer number. The number is implicitly the index of this status in the corresponding vector.

For symmetry with boolean states, a value of 0 is defined to have the same semantics as "off" / "unselected", 1 has the semantics of "on" / "fully selected", and all other values are purely application-defined.

Constructor & Destructor Documentation

◆ YItemCustomStatus()

YItemCustomStatus::YItemCustomStatus ( const std::string & iconName,
const std::string & textIndicator,
int nextStatus = -1 )
inline

Constructor.

Member Function Documentation

◆ hasNextStatus()

bool YItemCustomStatus::hasNextStatus ( ) const
inline

Return 'true' if a next status to cylce to is defined for this status, 'false' if not.

◆ iconName()

const std::string & YItemCustomStatus::iconName ( ) const
inline

The name of an icon to use in the widget in a graphical UI if an item has this status.

◆ nextStatus()

int YItemCustomStatus::nextStatus ( ) const
inline

This returns the next status to cycle through if the user clicks on the status or cycles through status values with the corresponding shortcut key.

If no such value was specified, this returns -1. The application can then still choose to set a different status depending on other application data.

◆ setNextStatus()

void YItemCustomStatus::setNextStatus ( int value)
inline

Set the next status. This should only be done once when the status transition map is evaluated.

◆ textIndicator()

const std::string & YItemCustomStatus::textIndicator ( ) const
inline

A text representation of this status in a text-based UI if an item has this status, for example "[ ]", "[x]" or "[ ], "[ +]", "[a+]".

It is recommended to use the same character length for all states so all items line up properly, even if they have different states.


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