Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
CAPlugin Class Reference

#include <plugin.h>

List of all members.

Public Member Functions

 CAPlugin ()
 CAPlugin (QString name, QString author, QString version, QString date, QString dirName, QString homeUrl, QString updateUrl)
 ~CAPlugin ()
bool action (QString onAction, CAMainWin *mainWin=0, CADocument *document=0, QEvent *evt=0, QPoint *coords=0)
bool callAction (CAPluginAction *action, CAMainWin *mainWin=0, CADocument *document=0, QEvent *evt=0, QPoint *coords=0, QString filename="")
void addAction (CAPluginAction *action)
void addMenu (QString name, QMenu *menu)
void setEnabled (bool enabled)
bool isEnabled ()
QString name ()
QString author ()
QString version ()
QString date ()
QString dirName ()
QString homeUrl ()
QString updateUrl ()
QString description (QString lang)
QString localDescription ()
QMenu * menu (QString menuName)
void setName (QString name)
void setDescription (QString desc, QString lang=QString(""))
void setAuthor (QString author)
void setVersion (QString version)
void setDate (QString date)
void setDirName (QString dirName)
void setHomeUrl (QString homeUrl)
void setUpdateUrl (QString updateUrl)
QList< QString > actionList ()

Private Attributes

QString _name
QHash< QString, QString > _descMap
QString _author
 LOCALE description of the plugin, key means the language code, value is the translation. Empty string key is the key of universal non-translated description.
QString _version
QString _date
QString _dirName
QString _homeUrl
 ABSOLUTE Name of directory where the plugin is located - plugin only stores the relative one, Canorus changes it to absolute one.
QString _updateUrl
bool _enabled
QMultiHash< QString,
CAPluginAction * > 
_actionMap
QHash< QString, QMenu * > _menuMap
 Key: onAction, Value: plugin's action.

Constructor & Destructor Documentation

CAPlugin::CAPlugin ( QString  name,
QString  author,
QString  version,
QString  date,
QString  dirName,
QString  homeUrl,
QString  updateUrl 
)

References _author, _date, _dirName, _enabled, _homeUrl, _name, _updateUrl, _version, author(), date(), dirName(), homeUrl(), name(), updateUrl(), and version().

Here is the call graph for this function:

References _actionMap, and _menuMap.


Member Function Documentation

bool CAPlugin::action ( QString  onAction,
CAMainWin mainWin = 0,
CADocument document = 0,
QEvent *  evt = 0,
QPoint *  coords = 0 
)

This function is called when an event was triggered in a program and a plugin connected to this event is triggered. It calls all the plugin's actions having the given onAction.

Parameters:
onActionString describing action name. eg. onScoreViewPortClick, onDocumentClose
mainWinPointer to the current application main window.
documentPointer to the current document.
evtPointer to the Mouse/Key/Wheel event, if it happened.
coordsPointer to the coords in absolute world units, if a click on ScoreViewPort happened.
Returns:
True, if all the actions were successfully called, False otherwise.

References _actionMap, _enabled, actionList(), and callAction().

Referenced by addAction(), CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

Here is the call graph for this function:

Here is the caller graph for this function:

QList<QString> CAPlugin::actionList ( ) [inline]

Return a list of all the actions the plugin is connected to.

Returns:
List of actions in QList QString format.

References _actionMap.

Referenced by action(), CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

Here is the caller graph for this function:

void CAPlugin::addAction ( CAPluginAction action)

Adds an action to the plugin, if the actionName&action aren't present yet.

Parameters:
onActionName of the Canorus's action the plugin reacts on.
langType of the action (ruby, python, library etc.).
fileNameFile name of the script/library which is to be run on Canorus event.
functionName of the function to be run.
argsList of arguments expected by the function.

References _actionMap, action(), and CAPluginAction::onAction().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::addMenu ( QString  name,
QMenu *  menu 
) [inline]

References _menuMap, menu(), and name().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

QString CAPlugin::author ( ) [inline]

References _author.

Referenced by CAPlugin(), and setAuthor().

Here is the caller graph for this function:

bool CAPlugin::callAction ( CAPluginAction action,
CAMainWin mainWin = 0,
CADocument document = 0,
QEvent *  evt = 0,
QPoint *  coords = 0,
QString  filename = "" 
)

This function calls a specific action. This is used for export, import and custom actions which aren't called by Canorus automatically.

Parameters:
actionPointer to the action to be called.
mainWinPointer to the current application main window.
documentPointer to the current document.
evtPointer to the Mouse/Key/Wheel event, if it happened.
coordsPointer to the coords in absolute world units, if a click on ScoreViewPort happened.
Returns:
True, if the action succeeded, False otherwise.

References _dirName, _name, CAPluginAction::args(), CAMainWin::currentScoreViewPort(), CAMainWin::currentSheet(), dirName(), CADrawableMusElement::DrawableNote, CAPluginAction::filename(), CAPluginAction::function(), CAPluginAction::lang(), CAScoreViewPort::musElementSelection(), CAPluginAction::onAction(), CAMainWin::pyConsoleIface, CACanorus::rebuildUI(), CAPluginAction::refresh(), and CAScoreViewPort::selection().

Referenced by action(), and CAPluginAction::triggeredSlot().

Here is the call graph for this function:

Here is the caller graph for this function:

QString CAPlugin::date ( ) [inline]

References _date.

Referenced by CAPlugin(), and setDate().

Here is the caller graph for this function:

QString CAPlugin::description ( QString  lang) [inline]

References _descMap.

Referenced by localDescription().

Here is the caller graph for this function:

QString CAPlugin::dirName ( ) [inline]

References _dirName.

Referenced by callAction(), CAPlugin(), CAPluginManager::enablePlugin(), CAPluginManager::removePlugin(), and setDirName().

Here is the caller graph for this function:

QString CAPlugin::homeUrl ( ) [inline]

References _homeUrl.

Referenced by CAPlugin(), and setHomeUrl().

Here is the caller graph for this function:

bool CAPlugin::isEnabled ( ) [inline]

References _enabled.

Referenced by CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

Here is the caller graph for this function:

QString CAPlugin::localDescription ( ) [inline]

References _descMap, description(), and name().

Here is the call graph for this function:

QMenu* CAPlugin::menu ( QString  menuName) [inline]

References _menuMap.

Referenced by addMenu(), and CAPluginManager::endElement().

Here is the caller graph for this function:

QString CAPlugin::name ( ) [inline]

References _name.

Referenced by addMenu(), CAPlugin(), localDescription(), and setName().

Here is the caller graph for this function:

void CAPlugin::setAuthor ( QString  author) [inline]

References _author, and author().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::setDate ( QString  date) [inline]

References _date, and date().

Here is the call graph for this function:

void CAPlugin::setDescription ( QString  desc,
QString  lang = QString("") 
) [inline]

References _descMap.

Referenced by CAPluginManager::endElement().

Here is the caller graph for this function:

void CAPlugin::setDirName ( QString  dirName) [inline]

References _dirName, and dirName().

Referenced by CAPluginManager::readPlugins().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::setEnabled ( bool  enabled) [inline]

References _enabled.

Referenced by CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

Here is the caller graph for this function:

void CAPlugin::setHomeUrl ( QString  homeUrl) [inline]

References _homeUrl, and homeUrl().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::setName ( QString  name) [inline]

References _name, and name().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::setUpdateUrl ( QString  updateUrl) [inline]

References _updateUrl, and updateUrl().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAPlugin::setVersion ( QString  version) [inline]

References _version, and version().

Referenced by CAPluginManager::endElement().

Here is the call graph for this function:

Here is the caller graph for this function:

QString CAPlugin::updateUrl ( ) [inline]

References _updateUrl.

Referenced by CAPlugin(), and setUpdateUrl().

Here is the caller graph for this function:

QString CAPlugin::version ( ) [inline]

References _version.

Referenced by CAPlugin(), and setVersion().

Here is the caller graph for this function:


Member Data Documentation

QMultiHash< QString, CAPluginAction* > CAPlugin::_actionMap [private]
QString CAPlugin::_author [private]

LOCALE description of the plugin, key means the language code, value is the translation. Empty string key is the key of universal non-translated description.

Referenced by author(), CAPlugin(), and setAuthor().

QString CAPlugin::_date [private]

Referenced by CAPlugin(), date(), and setDate().

QHash<QString, QString> CAPlugin::_descMap [private]
QString CAPlugin::_dirName [private]
bool CAPlugin::_enabled [private]
QString CAPlugin::_homeUrl [private]

ABSOLUTE Name of directory where the plugin is located - plugin only stores the relative one, Canorus changes it to absolute one.

Referenced by CAPlugin(), homeUrl(), and setHomeUrl().

QHash< QString, QMenu* > CAPlugin::_menuMap [private]

Key: onAction, Value: plugin's action.

Referenced by addMenu(), menu(), and ~CAPlugin().

QString CAPlugin::_name [private]

Referenced by callAction(), CAPlugin(), name(), and setName().

QString CAPlugin::_updateUrl [private]

Referenced by CAPlugin(), setUpdateUrl(), and updateUrl().

QString CAPlugin::_version [private]

Referenced by CAPlugin(), setVersion(), and version().


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