kalzium
Avogadro::Extension Class Reference
#include <extension.h>
Inheritance diagram for Avogadro::Extension:

Detailed Description
Interface for adding extensions.This is a template class used for adding extensions to Avogadro. Implementing the pure virutal functions provides a mechanism for more functionality. Extensions work by allowing each extension to have an unlimited number of possible actions (each represented by a QAction). To perform an action the extension should implement performAction and perform the correct action based on the action it receives. The actual action should will be performed by the parent object (usually MainWindow) as a result of a redo call on the returned QUndoCommand from the performAction function. Thus, to implement functionality you should subclass QUndoCommand accordingly based on the required functionality of the extension and return the command based on the action being peformed.
Definition at line 58 of file src/extension.h.
Public Slots | |
| virtual void | setMolecule (Molecule *m) |
Signals | |
| void | message (const QString &m) |
Public Member Functions | |
| virtual QList< QAction * > | actions () const =0 |
| virtual QString | description () const |
| virtual QDockWidget * | dockWidget () |
| Extension (QObject *parent) | |
| virtual QString | menuPath (QAction *action) const |
| virtual QString | name () const |
| virtual QUndoCommand * | performAction (QAction *action, GLWidget *widget)=0 |
| virtual void | readSettings (QSettings &settings) |
| virtual void | writeSettings (QSettings &settings) const |
| virtual | ~Extension () |
Constructor & Destructor Documentation
| Avogadro::Extension::Extension | ( | QObject * | parent | ) | [inline] |
Definition at line 63 of file src/extension.h.
| virtual Avogadro::Extension::~Extension | ( | ) | [inline, virtual] |
Definition at line 64 of file src/extension.h.
Member Function Documentation
- Returns:
- a list of actions which this widget can perform
| QString Avogadro::Extension::description | ( | ) | const [virtual] |
- Returns:
- a brief description of what the extension does (e.g., tooltip)
Definition at line 34 of file extension.cpp.
| QDockWidget * Avogadro::Extension::dockWidget | ( | ) | [virtual] |
- Returns:
- a list of dock widgets associated with this extensions
Definition at line 44 of file extension.cpp.
| void Avogadro::Extension::message | ( | const QString & | m | ) | [signal] |
Can be used to add messages to the message pane.
- Parameters:
-
m the message to add to the message pane.
| QString Avogadro::Extension::name | ( | ) | const [virtual] |
| virtual QUndoCommand* Avogadro::Extension::performAction | ( | QAction * | action, | |
| GLWidget * | widget | |||
| ) | [pure virtual] |
| void Avogadro::Extension::readSettings | ( | QSettings & | settings | ) | [virtual] |
read settings for this extension
- Parameters:
-
settings settings variable to read settings from
Definition at line 59 of file extension.cpp.
| void Avogadro::Extension::setMolecule | ( | Molecule * | m | ) | [virtual, slot] |
Definition at line 49 of file extension.cpp.
| void Avogadro::Extension::writeSettings | ( | QSettings & | settings | ) | const [virtual] |
save settings for this extension
- Parameters:
-
settings settings variable to write settings to
Definition at line 54 of file extension.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference