OpenASIP  2.0
Public Types | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
GUITextGenerator Class Reference

#include <GUITextGenerator.hh>

Inheritance diagram for GUITextGenerator:
Inheritance graph
Collaboration diagram for GUITextGenerator:
Collaboration graph

Public Types

enum  {
  TXT_BUTTON_ADD = Texts::LAST__, TXT_BUTTON_ADD_DIALOG, TXT_BUTTON_CANCEL, TXT_BUTTON_DELETE,
  TXT_BUTTON_EDIT, TXT_BUTTON_EDIT_DIALOG, TXT_BUTTON_OK, TXT_BUTTON_HELP
}
 Ids for the generated texts. More...
 

Static Public Member Functions

static GUITextGeneratorinstance ()
 
static void destroy ()
 

Private Member Functions

 GUITextGenerator ()
 
 ~GUITextGenerator ()
 

Static Private Attributes

static GUITextGeneratorinstance_ = NULL
 

Additional Inherited Members

- Public Member Functions inherited from Texts::TextGenerator
 TextGenerator ()
 
virtual ~TextGenerator ()
 
virtual boost::format text (int textId)
 
virtual void addText (int textId, const std::string &templateString)
 
virtual void replaceText (int textId, const std::string &newString)
 

Detailed Description

Provides common texts for tce graphical user interfaces.

The class is implemented using the 'singleton' design pattern. Only one instance of this class is created, and the instance can be accessed using the instance() method.

Definition at line 46 of file GUITextGenerator.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Ids for the generated texts.

Enumerator
TXT_BUTTON_ADD 

Label for an add button.

TXT_BUTTON_ADD_DIALOG 

Label for add button (with trailing ...).

TXT_BUTTON_CANCEL 

Label for cancel button.

TXT_BUTTON_DELETE 

Label for delete button.

TXT_BUTTON_EDIT 

Label for edit button.

TXT_BUTTON_EDIT_DIALOG 

Label for edit button (with trailing ...).

TXT_BUTTON_OK 

Label for OK button.

TXT_BUTTON_HELP 

Label for help button.

Definition at line 52 of file GUITextGenerator.hh.

52  {
53  TXT_BUTTON_ADD = Texts::LAST__, ///< Label for an add button.
54  TXT_BUTTON_ADD_DIALOG, ///< Label for add button (with trailing ...).
55  TXT_BUTTON_CANCEL, ///< Label for cancel button.
56  TXT_BUTTON_DELETE, ///< Label for delete button.
57  TXT_BUTTON_EDIT, ///< Label for edit button.
58  TXT_BUTTON_EDIT_DIALOG, ///< Label for edit button (with trailing ...).
59  TXT_BUTTON_OK, ///< Label for OK button.
60  TXT_BUTTON_HELP ///< Label for help button.
61  };

Constructor & Destructor Documentation

◆ GUITextGenerator()

GUITextGenerator::GUITextGenerator ( )
private

The Constructor.

Initializes string templates to the text generator.

Definition at line 42 of file GUITextGenerator.cc.

42  {
43  addText(TXT_BUTTON_ADD, "Add");
44  addText(TXT_BUTTON_ADD_DIALOG, "Add...");
45  addText(TXT_BUTTON_CANCEL, "&Cancel");
46  addText(TXT_BUTTON_DELETE, "Delete");
47  addText(TXT_BUTTON_EDIT, "Edit");
48  addText(TXT_BUTTON_EDIT_DIALOG, "Edit...");
49  addText(TXT_BUTTON_HELP, "&Help");
50  addText(TXT_BUTTON_OK, "&OK");
51 }

References Texts::TextGenerator::addText(), TXT_BUTTON_ADD, TXT_BUTTON_ADD_DIALOG, TXT_BUTTON_CANCEL, TXT_BUTTON_DELETE, TXT_BUTTON_EDIT, TXT_BUTTON_EDIT_DIALOG, TXT_BUTTON_HELP, and TXT_BUTTON_OK.

Referenced by instance().

Here is the call graph for this function:

◆ ~GUITextGenerator()

GUITextGenerator::~GUITextGenerator ( )
private

The Destructor.

Definition at line 57 of file GUITextGenerator.cc.

57  {
58 }

Member Function Documentation

◆ destroy()

void GUITextGenerator::destroy ( )
static

Deletes the instance of this command if one exists.

Definition at line 79 of file GUITextGenerator.cc.

79  {
80  if (instance_ != NULL) {
81  delete instance_;
82  instance_ = NULL;
83  }
84 }

References instance_.

◆ instance()

GUITextGenerator * GUITextGenerator::instance ( )
static

Member Data Documentation

◆ instance_

GUITextGenerator * GUITextGenerator::instance_ = NULL
staticprivate

Definition at line 66 of file GUITextGenerator.hh.

Referenced by destroy(), and instance().


The documentation for this class was generated from the following files:
GUITextGenerator::GUITextGenerator
GUITextGenerator()
Definition: GUITextGenerator.cc:42
GUITextGenerator::TXT_BUTTON_HELP
@ TXT_BUTTON_HELP
Label for help button.
Definition: GUITextGenerator.hh:60
GUITextGenerator::TXT_BUTTON_CANCEL
@ TXT_BUTTON_CANCEL
Label for cancel button.
Definition: GUITextGenerator.hh:55
Texts::TextGenerator::addText
virtual void addText(int textId, const std::string &templateString)
Definition: TextGenerator.cc:118
GUITextGenerator::instance_
static GUITextGenerator * instance_
Definition: GUITextGenerator.hh:66
GUITextGenerator::TXT_BUTTON_ADD
@ TXT_BUTTON_ADD
Label for an add button.
Definition: GUITextGenerator.hh:53
GUITextGenerator::TXT_BUTTON_DELETE
@ TXT_BUTTON_DELETE
Label for delete button.
Definition: GUITextGenerator.hh:56
GUITextGenerator::TXT_BUTTON_ADD_DIALOG
@ TXT_BUTTON_ADD_DIALOG
Label for add button (with trailing ...).
Definition: GUITextGenerator.hh:54
GUITextGenerator::TXT_BUTTON_EDIT_DIALOG
@ TXT_BUTTON_EDIT_DIALOG
Label for edit button (with trailing ...).
Definition: GUITextGenerator.hh:58
Texts::LAST__
@ LAST__
Definition: TextGenerator.hh:68
GUITextGenerator::TXT_BUTTON_EDIT
@ TXT_BUTTON_EDIT
Label for edit button.
Definition: GUITextGenerator.hh:57
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59