Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YShortcut Class Reference

Helper class for shortcut management: This class holds data about the shortcut for one single widget. More...

#include <YShortcut.h>

List of all members.

Public Member Functions

 YShortcut (YWidget *shortcut_widget)
virtual ~YShortcut ()
YWidgetwidget ()
const char * widgetClass ()
string shortcutString ()
string cleanShortcutString ()
char preferred ()
char shortcut ()
void setShortcut (char new_shortcut)
bool conflict ()
void setConflict (bool newConflictState=true)
int distinctShortcutChars ()

Static Public Member Functions

string cleanShortcutString (string shortcutString)
char shortcutMarker ()
string::size_type findShortcutPos (const string &str, string::size_type start_pos=0)
char findShortcut (const string &str, string::size_type start_pos=0)
bool isValid (char c)
char normalized (char c)
string getShortcutString (YWidget *widget)

Protected Member Functions

string getShortcutString ()

Protected Attributes

YWidget_widget
string _shortcut_string
bool _shortcut_string_chached
string _clean_shortcut_string
bool _clean_shortcut_string_chached
int _preferred
int _shortcut
bool _conflict
int _distinctShortcutChars


Detailed Description

Helper class for shortcut management: This class holds data about the shortcut for one single widget.


Constructor & Destructor Documentation

YShortcut::YShortcut YWidget shortcut_widget  ) 
 

Constructor

YShortcut::~YShortcut  )  [virtual]
 

Destructor


Member Function Documentation

string YShortcut::cleanShortcutString string  shortcutString  )  [static]
 

Static version of the above for general use: Returns the specified string without any "& " markers.

string YShortcut::cleanShortcutString  ) 
 

Returns the shortcut string ( from the widget's shortcut property ) without any "& " markers.

bool YShortcut::conflict  )  [inline]
 

Query the internal 'conflict' marker. This class doesn't care about that flag, it just stores it for the convenience of higher-level classes.

int YShortcut::distinctShortcutChars  ) 
 

Obtain the number of distinct valid shortcut characters in the shortcut string, i.e. how many different shortcuts that widget could get.

char YShortcut::findShortcut const string &  str,
string::size_type  start_pos = 0
[static]
 

Static function: Find the next shortcut marker in a string, beginning at starting position start_pos.

Returns the shortcut character or 0 if none found.

string::size_type YShortcut::findShortcutPos const string &  str,
string::size_type  start_pos = 0
[static]
 

Static function: Find the next occurrence of the shortcut marker ( '& ' ) in a string, beginning at starting position start_pos.

Returns string::npos if not found or the position of the shortcut marker ( ! ) if found.

string YShortcut::getShortcutString  )  [protected]
 

Obtain the the shortcut property of this shortcut's widget - the string that contains "& " to designate a shortcut.

string YShortcut::getShortcutString YWidget widget  )  [static]
 

Obtain a widget's shortcut property - the string that contains "& " to designate a shortcut.

bool YShortcut::isValid char  c  )  [static]
 

Returns 'true' if 'c' is a valid shortcut character, i.e. [a-zA-Z0-9], 'false' otherwise.

char YShortcut::normalized char  c  )  [static]
 

Return the normalized version of shortcut character 'c', i.e. a lowercase letter or a digit [a-z0-9]. Returns 0 if 'c' is invalid.

char YShortcut::preferred  ) 
 

The preferred shortcut character, i.e. the character that had been preceded by "& " before checking / resolving conflicts began.

void YShortcut::setConflict bool  newConflictState = true  )  [inline]
 

Set or unset the internal 'conflict' marker.

void YShortcut::setShortcut char  new_shortcut  ) 
 

Set ( override ) the shortcut character.

char YShortcut::shortcut  ) 
 

The actual shortcut character.

This may be different from preferred() if it is overridden.

char YShortcut::shortcutMarker  )  [inline, static]
 

Static function: Returns the character used for marking keyboard shortcuts.

string YShortcut::shortcutString  ) 
 

Returns the complete shortcut string ( which may or may not contain "& " ), i.e. the value of the widget's shortcut property. For PushButtons, this is the label on the button ( e.g., "& Details..." ), for other widgets usually the caption above it.

This value is chached, i.e. this isn't a too expensive operation.

YWidget* YShortcut::widget  )  [inline]
 

Returns the YWidget this shortcut data belong to.

const char* YShortcut::widgetClass  )  [inline]
 

Returns the textual representation of the widget class of the widget this shortcut data belongs to.


Member Data Documentation

string YShortcut::_clean_shortcut_string [protected]
 

bool YShortcut::_clean_shortcut_string_chached [protected]
 

bool YShortcut::_conflict [protected]
 

int YShortcut::_distinctShortcutChars [protected]
 

int YShortcut::_preferred [protected]
 

int YShortcut::_shortcut [protected]
 

string YShortcut::_shortcut_string [protected]
 

bool YShortcut::_shortcut_string_chached [protected]
 

YWidget* YShortcut::_widget [protected]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6