OpenASIP  2.0
Public Member Functions | Private Member Functions | List of all members
OSEdUserManualCmd Class Reference

#include <OSEdUserManualCmd.hh>

Inheritance diagram for OSEdUserManualCmd:
Inheritance graph
Collaboration diagram for OSEdUserManualCmd:
Collaboration graph

Public Member Functions

 OSEdUserManualCmd ()
 
virtual ~OSEdUserManualCmd ()
 
virtual int id () const
 
virtual GUICommandcreate () const
 
virtual bool Do ()
 
virtual bool isEnabled ()
 
virtual std::string icon () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
virtual std::string shortName () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Private Member Functions

 OSEdUserManualCmd (const OSEdUserManualCmd &)
 Copying not allowed. More...
 
OSEdUserManualCmdoperator= (const OSEdUserManualCmd &)
 Assignment not allowed. More...
 
std::string userManual () const
 

Detailed Description

Command for opening user manual browser.

Definition at line 43 of file OSEdUserManualCmd.hh.

Constructor & Destructor Documentation

◆ OSEdUserManualCmd() [1/2]

OSEdUserManualCmd::OSEdUserManualCmd ( )

Constructor.

Definition at line 49 of file OSEdUserManualCmd.cc.

49  :
51 }

Referenced by create().

◆ ~OSEdUserManualCmd()

OSEdUserManualCmd::~OSEdUserManualCmd ( )
virtual

Destructor.

Definition at line 56 of file OSEdUserManualCmd.cc.

56  {
57 }

◆ OSEdUserManualCmd() [2/2]

OSEdUserManualCmd::OSEdUserManualCmd ( const OSEdUserManualCmd )
private

Copying not allowed.

Member Function Documentation

◆ create()

GUICommand * OSEdUserManualCmd::create ( ) const
virtual

Creates new command.

Returns
New command.

Implements GUICommand.

Definition at line 75 of file OSEdUserManualCmd.cc.

75  {
76  return new OSEdUserManualCmd();
77 }

References OSEdUserManualCmd().

Here is the call graph for this function:

◆ Do()

bool OSEdUserManualCmd::Do ( )
virtual

Executes the command.

Returns
True if execution is successful.

Implements GUICommand.

Definition at line 85 of file OSEdUserManualCmd.cc.

85  {
86 
87  string manualFile = userManual();
88 
91 
92  HelpBrowser* browser = new HelpBrowser(
93  WxConversion::toWxString(fmt.str()),
94  WxConversion::toWxString(manualFile), wxDefaultPosition,
95  wxSize(800, 600));
96 
97  browser->Show(true);
98  return true;
99 }

References OSEdTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_USER_MANUAL_TITLE, and userManual().

Here is the call graph for this function:

◆ icon()

string OSEdUserManualCmd::icon ( ) const
virtual

Returns the icon path.

Returns
Empty string (icons not used).

Implements GUICommand.

Definition at line 120 of file OSEdUserManualCmd.cc.

120  {
121  return "";
122 }

◆ id()

int OSEdUserManualCmd::id ( ) const
virtual

Returns the id of the command.

Returns
The id of the command.

Implements GUICommand.

Definition at line 65 of file OSEdUserManualCmd.cc.

65  {
67 }

References OSEdConstants::CMD_USER_MANUAL.

◆ isEnabled()

bool OSEdUserManualCmd::isEnabled ( )
virtual

Returns true if command is enabled.

Command is enabled when user manual exists.

Returns
True if command is enabled.

Implements GUICommand.

Definition at line 109 of file OSEdUserManualCmd.cc.

109  {
110  string manualFile = userManual();
111  return FileSystem::fileExists(manualFile);
112 }

References FileSystem::fileExists(), and userManual().

Here is the call graph for this function:

◆ operator=()

OSEdUserManualCmd& OSEdUserManualCmd::operator= ( const OSEdUserManualCmd )
private

Assignment not allowed.

◆ userManual()

std::string OSEdUserManualCmd::userManual ( ) const
private

Returns the user manual location.

Returns
User manual location.

Definition at line 130 of file OSEdUserManualCmd.cc.

References FileSystem::DIRECTORY_SEPARATOR, Environment::manDirPath(), and OSEdConstants::USER_MANUAL_NAME.

Referenced by Do(), and isEnabled().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
WxConversion::toWxString
static wxString toWxString(const std::string &source)
Environment::manDirPath
static std::string manDirPath(const std::string &prog)
Definition: Environment.cc:250
OSEdConstants::USER_MANUAL_NAME
static const std::string USER_MANUAL_NAME
Name of the user manual.
Definition: OSEdConstants.hh:80
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
HelpBrowser
Definition: HelpBrowser.hh:42
OSEdTextGenerator::TXT_USER_MANUAL_TITLE
@ TXT_USER_MANUAL_TITLE
User manual dialog title.
Definition: OSEdTextGenerator.hh:116
OSEdUserManualCmd::OSEdUserManualCmd
OSEdUserManualCmd()
Definition: OSEdUserManualCmd.cc:49
OSEdConstants::CMD_USER_MANUAL
@ CMD_USER_MANUAL
User manual command id.
Definition: OSEdConstants.hh:103
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
OSEdConstants::CMD_NAME_USER_MANUAL
static const std::string CMD_NAME_USER_MANUAL
User manual command name.
Definition: OSEdConstants.hh:67
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
OSEdUserManualCmd::userManual
std::string userManual() const
Definition: OSEdUserManualCmd.cc:130
FileSystem::fileExists
static bool fileExists(const std::string fileName)
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42