Fawkes API Fawkes Development Version

ConfigEditorPlugin Class Reference

Base class for plugins for the Fawkes config editor. More...

#include <tools/config_editor/config_editor_plugin.h>

Inheritance diagram for ConfigEditorPlugin:

List of all members.

Public Member Functions

 ConfigEditorPlugin (std::string config_path, std::string glade_file)
 Constructor.
virtual ~ConfigEditorPlugin ()
 Destructor.
void initialize ()
 Initialize the plugin.
void run ()
 Run the plugin.
std::string get_config_path () const
 Get the config prefix specified for this config editor plugin.
void set_config (fawkes::Configuration *config)
 Set the configuration for the plugin to work on.

Protected Member Functions

virtual void pre_run ()=0
 Config editor plugins need to implement this function.
virtual void post_run (int response)=0
 This method is called after the dialog is closed.
virtual Gtk::Dialog * load_dialog ()=0
 In this function the (custom) dialog of the plugin needs to be initialized.

Protected Attributes

Gtk::Dialog * m_dialog
 The (main-) dialog of the plugin.
Glib::RefPtr< Gnome::Glade::Xml > m_ref_xml
 Glade XML object created from the Glade file of the plugin.
std::string m_config_path
 The config prefix the plugin is attached to.
fawkes::Configurationm_config
 The fawkes::Configuration.

Detailed Description

Base class for plugins for the Fawkes config editor.

A plugin allows to manipulate a certain part of the configuration, most often this is intended to be the config options for a Fawkes plugin.

Author:
Daniel Beck

Definition at line 35 of file config_editor_plugin.h.


Constructor & Destructor Documentation

ConfigEditorPlugin::ConfigEditorPlugin ( std::string  config_path,
std::string  glade_file 
)

Constructor.

Parameters:
config_paththe prefix of the part that can be configured with this plugin
glade_filea Glade file which contains the definition the plugin's GUI components

Definition at line 78 of file config_editor_plugin.cpp.

ConfigEditorPlugin::~ConfigEditorPlugin ( ) [virtual]

Destructor.

Definition at line 86 of file config_editor_plugin.cpp.


Member Function Documentation

std::string ConfigEditorPlugin::get_config_path ( ) const

Get the config prefix specified for this config editor plugin.

Returns:
the config prefix

Definition at line 94 of file config_editor_plugin.cpp.

Referenced by ConfigTreeView::register_plugin().

void ConfigEditorPlugin::initialize ( )

Initialize the plugin.

This method needs to be called before the plugin can be used.

Definition at line 112 of file config_editor_plugin.cpp.

Referenced by ConfigTreeView::register_plugin().

Gtk::Dialog * ConfigEditorPlugin::load_dialog ( ) [protected, pure virtual]

In this function the (custom) dialog of the plugin needs to be initialized.

Returns:
pointer to the loaded dialog

Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.

void ConfigEditorPlugin::post_run ( int  response) [protected, pure virtual]

This method is called after the dialog is closed.

Here, the input the user has made needs to be handled.

Parameters:
responsethe response obtained from the run() method of the dialog (Gtk::RESPONSE_OK or Gtk::RESPONSE_CANCEL)

Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.

void ConfigEditorPlugin::pre_run ( ) [protected, pure virtual]

Config editor plugins need to implement this function.

It is called before the actual dialog is opened. Ususally, plugins want to parse the configuration, here, and initialize the GUI elements of the dialog.

Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.

void ConfigEditorPlugin::run ( )

Run the plugin.

Usually, this means opening a dialog where config values can be manipulated and on closing these are written to the config.

Definition at line 122 of file config_editor_plugin.cpp.

void ConfigEditorPlugin::set_config ( fawkes::Configuration config)

Set the configuration for the plugin to work on.

Parameters:
configthe configuration

Definition at line 103 of file config_editor_plugin.cpp.


Member Data Documentation

The config prefix the plugin is attached to.

Definition at line 58 of file config_editor_plugin.h.

Referenced by RetrieverConfigPlugin::post_run(), and RetrieverConfigPlugin::pre_run().

The (main-) dialog of the plugin.

Definition at line 55 of file config_editor_plugin.h.

Referenced by RetrieverConfigPlugin::post_run(), and RetrieverConfigPlugin::pre_run().

Glade XML object created from the Glade file of the plugin.

Definition at line 56 of file config_editor_plugin.h.

Referenced by RetrieverConfigPlugin::load_dialog(), and NaoStiffnessConfigPlugin::load_dialog().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends