libyui  3.9.3
YItemCustomStatus Class Reference

Class describing a non-binary status for an item. More...

#include <YItemCustomStatus.h>

Collaboration diagram for YItemCustomStatus:

Public Member Functions

 YItemCustomStatus (const std::string &iconName, const std::string &textIndicator, int nextStatus=-1)
 Constructor.
 
const std::string & iconName () const
 The name of an icon to use in the widget in a graphical UI if an item has this status.
 
const std::string & textIndicator () const
 A text representation of this status in a text-based UI if an item has this status, for example "[ ]", "[x]" or "[ ], "[ +]", "[a+]". More...
 
int nextStatus () const
 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. More...
 
void setNextStatus (int value)
 Set the next status. More...
 
bool hasNextStatus () const
 Return 'true' if a next status to cylce to is defined for this status, 'false' if not.
 

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.

Definition at line 44 of file YItemCustomStatus.h.

Member Function Documentation

◆ 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.

Definition at line 82 of file YItemCustomStatus.h.

◆ setNextStatus()

void YItemCustomStatus::setNextStatus ( int  value)
inline

Set the next status.

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

Definition at line 88 of file YItemCustomStatus.h.

◆ 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.

Definition at line 71 of file YItemCustomStatus.h.


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