|
Canorus
0.7
|
#include <plugin.h>
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. | |
| CAPlugin::CAPlugin | ( | QString | name, |
| QString | author, | ||
| QString | version, | ||
| QString | date, | ||
| QString | dirName, | ||
| QString | homeUrl, | ||
| QString | updateUrl | ||
| ) |
References _actionMap, and _menuMap.
| 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.
| onAction | String describing action name. eg. onScoreViewPortClick, onDocumentClose |
| mainWin | Pointer to the current application main window. |
| document | Pointer to the current document. |
| evt | Pointer to the Mouse/Key/Wheel event, if it happened. |
| coords | Pointer to the coords in absolute world units, if a click on ScoreViewPort happened. |
References _actionMap, _enabled, actionList(), and callAction().
Referenced by addAction(), CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().


| QList<QString> CAPlugin::actionList | ( | ) | [inline] |
Return a list of all the actions the plugin is connected to.
References _actionMap.
Referenced by action(), CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

| void CAPlugin::addAction | ( | CAPluginAction * | action | ) |
Adds an action to the plugin, if the actionName&action aren't present yet.
| onAction | Name of the Canorus's action the plugin reacts on. |
| lang | Type of the action (ruby, python, library etc.). |
| fileName | File name of the script/library which is to be run on Canorus event. |
| function | Name of the function to be run. |
| args | List of arguments expected by the function. |
References _actionMap, action(), and CAPluginAction::onAction().
Referenced by CAPluginManager::endElement().


| void CAPlugin::addMenu | ( | QString | name, |
| QMenu * | menu | ||
| ) | [inline] |
References _menuMap, menu(), and name().
Referenced by CAPluginManager::endElement().


| QString CAPlugin::author | ( | ) | [inline] |
References _author.
Referenced by CAPlugin(), and setAuthor().

| 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.
| action | Pointer to the action to be called. |
| mainWin | Pointer to the current application main window. |
| document | Pointer to the current document. |
| evt | Pointer to the Mouse/Key/Wheel event, if it happened. |
| coords | Pointer to the coords in absolute world units, if a click on ScoreViewPort happened. |
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().


| QString CAPlugin::date | ( | ) | [inline] |
References _date.
Referenced by CAPlugin(), and setDate().

| QString CAPlugin::description | ( | QString | lang | ) | [inline] |
| QString CAPlugin::dirName | ( | ) | [inline] |
References _dirName.
Referenced by callAction(), CAPlugin(), CAPluginManager::enablePlugin(), CAPluginManager::removePlugin(), and setDirName().

| QString CAPlugin::homeUrl | ( | ) | [inline] |
References _homeUrl.
Referenced by CAPlugin(), and setHomeUrl().

| bool CAPlugin::isEnabled | ( | ) | [inline] |
References _enabled.
Referenced by CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

| QString CAPlugin::localDescription | ( | ) | [inline] |
| QMenu* CAPlugin::menu | ( | QString | menuName | ) | [inline] |
References _menuMap.
Referenced by addMenu(), and CAPluginManager::endElement().

| QString CAPlugin::name | ( | ) | [inline] |
References _name.
Referenced by addMenu(), CAPlugin(), localDescription(), and setName().

| void CAPlugin::setAuthor | ( | QString | author | ) | [inline] |
References _author, and author().
Referenced by CAPluginManager::endElement().


| void CAPlugin::setDate | ( | QString | date | ) | [inline] |
| void CAPlugin::setDescription | ( | QString | desc, |
| QString | lang = QString("") |
||
| ) | [inline] |
References _descMap.
Referenced by CAPluginManager::endElement().

| void CAPlugin::setDirName | ( | QString | dirName | ) | [inline] |
References _dirName, and dirName().
Referenced by CAPluginManager::readPlugins().


| void CAPlugin::setEnabled | ( | bool | enabled | ) | [inline] |
References _enabled.
Referenced by CAPluginManager::disablePlugin(), and CAPluginManager::enablePlugin().

| void CAPlugin::setHomeUrl | ( | QString | homeUrl | ) | [inline] |
References _homeUrl, and homeUrl().
Referenced by CAPluginManager::endElement().


| void CAPlugin::setName | ( | QString | name | ) | [inline] |
Referenced by CAPluginManager::endElement().


| void CAPlugin::setUpdateUrl | ( | QString | updateUrl | ) | [inline] |
References _updateUrl, and updateUrl().
Referenced by CAPluginManager::endElement().


| void CAPlugin::setVersion | ( | QString | version | ) | [inline] |
References _version, and version().
Referenced by CAPluginManager::endElement().


| QString CAPlugin::updateUrl | ( | ) | [inline] |
References _updateUrl.
Referenced by CAPlugin(), and setUpdateUrl().

| QString CAPlugin::version | ( | ) | [inline] |
References _version.
Referenced by CAPlugin(), and setVersion().

QMultiHash< QString, CAPluginAction* > CAPlugin::_actionMap [private] |
Referenced by action(), actionList(), addAction(), and ~CAPlugin().
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] |
Referenced by description(), localDescription(), and setDescription().
QString CAPlugin::_dirName [private] |
Referenced by callAction(), CAPlugin(), dirName(), and setDirName().
bool CAPlugin::_enabled [private] |
Referenced by action(), CAPlugin(), isEnabled(), and setEnabled().
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().
1.8.0