Relacs Core Library  0.9.8
Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Friends | List of all members
MacroCommand Class Reference

#include <macros.h>

Inheritance diagram for MacroCommand:
Inheritance graph
[legend]
Collaboration diagram for MacroCommand:
Collaboration graph
[legend]

Public Types

enum  CommandType {
  UnknownCom, ReProCom, MacroCom, FilterCom,
  DetectorCom, ControlCom, SwitchCom, StartSessionCom,
  StopSessionCom, ShutdownCom, ShellCom, MessageCom,
  BrowseCom
}
 

Public Slots

void start (void)
 
void run (void)
 
void view (void)
 
void reload (void)
 
void help (void)
 
void enable (void)
 
void dialog (void)
 
void acceptDialog (void)
 
void dialogAction (int r)
 
void dialogClosed (int r)
 

Public Member Functions

 MacroCommand (void)
 
 MacroCommand (const string &line, Macros *mcs, Macro *mc)
 
 MacroCommand (RePro *repro, const string &params, Macros *mcs, Macro *mc)
 
 MacroCommand (const MacroCommand &com)
 
CommandType command (void) const
 
string name (void) const
 
void setName (const string &name)
 
string parameter (void) const
 
void setParameter (const string &parameter)
 
void addParameter (const string &s, bool addsep)
 
bool enabled (void) const
 
void clearIcon (void)
 
void setRunIcon (void)
 
ReProrepro (void)
 
void setReProCommand (void)
 
void setMacroIndex (int index)
 
void init (int macronum, int commandnum)
 
QMenu * menu (void)
 
void addMenu (QMenu *menu)
 
bool check (string &warning)
 
void checkOptions (string &warning)
 
bool execute (bool saving)
 
void reloadRePro (RePro *repro)
 

Static Public Member Functions

static void createIcons (int size)
 
static void destroyIcons (void)
 

Friends

ostream & operator<< (ostream &str, const MacroCommand &command)
 

Detailed Description

A single command of a macro.

This class is used in the private list of macros of the Macros class. It describes the function (repro, message, shell, macro) of the command.

Member Enumeration Documentation

The different types of commands.

Enumerator
UnknownCom 

This command does nothing.

ReProCom 

The command executes a RePro.

MacroCom 

The command executes another macro.

FilterCom 

The command executes a function of a filter .

DetectorCom 

The command executes a function of a detector.

ControlCom 

The command sets a parameter of a control.

SwitchCom 

The command switches the macro file.

StartSessionCom 

The command starts a session.

StopSessionCom 

The command stops a session without launching the dialog.

ShutdownCom 

The command shuts down relacs.

ShellCom 

The command executes a shell command.

MessageCom 

The command opens a message box with some text.

BrowseCom 

The command opens a browser for looking at a text.

Constructor & Destructor Documentation

MacroCommand ( void  )
MacroCommand ( const string &  line,
Macros mcs,
Macro mc 
)
MacroCommand ( RePro repro,
const string &  params,
Macros mcs,
Macro mc 
)

Create a MacroCommand for a RePro.

MacroCommand ( const MacroCommand com)

Copy constructor.

Member Function Documentation

MacroCommand::CommandType command ( void  ) const
Returns
the CommandType of the MacroCommand.

Referenced by Macro::load().

string name ( void  ) const
Returns
the name of the MacroCommand.

Referenced by MacroCommand::check(), Macro::load(), and MacroCommand::setName().

void setName ( const string &  name)

Set the name of the MacroCommand to name.

References MacroCommand::name().

Referenced by MacroCommand::check().

string parameter ( void  ) const
void setParameter ( const string &  parameter)

Set the parameter of the MacroCommand to parameter.

References MacroCommand::parameter().

Referenced by Macro::check(), and MacroCommand::check().

void addParameter ( const string &  s,
bool  addsep 
)

Add s to the command's parameter string. Add a semicolon beforehand if addsep is true.

References Str::empty(), and Str::provideLast().

bool enabled ( void  ) const
Returns
Whether the MacroCommand is enabled.
void clearIcon ( void  )

Set the command's icon to enabled or disabled.

void setRunIcon ( void  )

Set the command's icon to running.

Referenced by MacroCommand::execute().

RePro * repro ( void  )

The RePro of this MacroCommand.

Referenced by MacroCommand::check().

void setReProCommand ( void  )

Set the CommandType of the MacroCommand to ReProCom .

References MacroCommand::ReProCom.

Referenced by Macro::load().

void setMacroIndex ( int  index)

Set the index of the Macro of this MacroCommand to index.

void init ( int  macronum,
int  commandnum 
)

Initialize the number of the parent macro and the command number.

QMenu * menu ( void  )

The menu offering various actions for the command.

void addMenu ( QMenu *  menu)
bool check ( string &  warning)
void checkOptions ( string &  warning)

Check the command options. Returns true on success. Otherwise, a warning message is added, and false is returned.

References RePro::checkOptions(), Macro::expandParameter(), ConfigDialog::name(), MacroCommand::parameter(), and MacroCommand::ReProCom.

bool execute ( bool  saving)
void reloadRePro ( RePro repro)

Update the macro command for the reloaded repro repro.

References ConfigDialog::name(), and MacroCommand::ReProCom.

void createIcons ( int  size)
static

Generates some icons.

See Also
destroyIcons()

Referenced by Macros::Macros().

void destroyIcons ( void  )
static

Frees the icons.

See Also
createIcons()

Referenced by Macros::~Macros().

void start ( void  )
slot

Start macro at this command.

References Macros::startMacro(), and Macro::variables().

Referenced by MacroCommand::addMenu().

void run ( void  )
slot
void view ( void  )
slot

View the RePro.

References RePros::raise(), and Macros::RPs.

Referenced by MacroCommand::addMenu().

void reload ( void  )
slot

Reload the RePro plugin.

References RePros::reload(), and Macros::RPs.

Referenced by MacroCommand::addMenu().

void help ( void  )
slot

Display the RePro's help text.

References RePros::help(), and Macros::RPs.

Referenced by MacroCommand::addMenu().

void enable ( void  )
slot

Enable/disable the command.

Referenced by MacroCommand::addMenu().

void dialog ( void  )
slot
void acceptDialog ( void  )
slot
void dialogAction ( int  r)
slot

Runs the macro for r==2 and set the options to default for r==3.

References Macros::startMacro().

Referenced by MacroCommand::dialog(), and MacroCommand::dialogClosed().

void dialogClosed ( int  r)
slot

Unsets the DialogOpen flag and disconnects signals.

References MacroCommand::acceptDialog(), MacroCommand::dialogAction(), and MacroCommand::ReProCom.

Referenced by MacroCommand::dialog().

Friends And Related Function Documentation

ostream& operator<< ( ostream &  str,
const MacroCommand command 
)
friend

Write information of the MacroCommand to str.


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