• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

parley

ScriptManager Class Reference

This class finds the scripts installed in the application directory and manages loading and unloading of the scripts. More...

#include <scriptmanager.h>

Inheritance diagram for ScriptManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ScriptManager (Editor *editor)
 ~ScriptManager ()
void addObject (QObject *obj, const QString &name)
void addScriptAction (const QString &name, KAction *action)
void disablePlugin (QString desktopFile)
QStringList enabledScripts ()
QString getScriptFileName (QString desktopFile)
void loadScripts ()
void reloadScripts ()
Translator * translator ()

Static Public Member Functions

static QMap< QString, QString > categories ()
static QStringList getDesktopFiles ()
static QString getScriptEntry (QString desktopFile)

Detailed Description

This class finds the scripts installed in the application directory and manages loading and unloading of the scripts.

For each script an instance of Script class is created.

Author:
Avgoustinos Kadis <avgoustinos.kadis@kdemail.net>

Definition at line 29 of file scriptmanager.h.


Constructor & Destructor Documentation

ScriptManager::ScriptManager ( Editor *  editor  ) 

Definition at line 29 of file scriptmanager.cpp.

ScriptManager::~ScriptManager (  ) 

Definition at line 38 of file scriptmanager.cpp.


Member Function Documentation

void ScriptManager::addObject ( QObject *  obj,
const QString &  name 
)

Adds a QObject as a module for the script.

Parameters:
obj The QObject to be added to the script
name The name of the object as it will appear in the script

Definition at line 138 of file scriptmanager.cpp.

void ScriptManager::addScriptAction ( const QString &  name,
KAction *  action 
)

Add a KAction to the Scripts menu.

Parameters:
name The action name
action KAction to be added

Definition at line 163 of file scriptmanager.cpp.

QMap< QString, QString > ScriptManager::categories (  )  [static]

Returns a QMap (from from categories codenames to categories display label) to be used in KPluginSelector (ScriptDialog) for displaying the various categories.

Note:
this function is not used later on (categories are disabled)
Returns:
the QMap described above

Definition at line 55 of file scriptmanager.cpp.

void ScriptManager::disablePlugin ( QString  desktopFile  ) 

Modify the parleyrc configuration so it disables the dektopFile plugin.

This function is to be used when the plugin is invalid (wrong script name, incorrect desktop file etc)

Parameters:
desktopFile 

Definition at line 99 of file scriptmanager.cpp.

QStringList ScriptManager::enabledScripts (  ) 

Returns a list of filenames (full path) of enabled scripts.

Definition at line 79 of file scriptmanager.cpp.

QStringList ScriptManager::getDesktopFiles (  )  [static]

Finds all the available desktop files in {PARLEY_DATA_FOLDER}/plugins.

Returns:
The list of desktop filenames available for parley

Definition at line 43 of file scriptmanager.cpp.

QString ScriptManager::getScriptEntry ( QString  desktopFile  )  [static]

Parses the desktop desktopFile given and returns the value of "Script" entry.

Parameters:
desktopFile The .desktop file that will get the value from
Returns:
The value of "Script" entry. Empty string of no "Script" entry is found

Definition at line 63 of file scriptmanager.cpp.

QString ScriptManager::getScriptFileName ( QString  desktopFile  ) 

Returns the full path to the script name given in the desktopFile.

Parameters:
desktopFile The desktop file for the parley plugin
Returns:
The full-path to the script

Definition at line 72 of file scriptmanager.cpp.

void ScriptManager::loadScripts (  ) 

Loads (activates) all the available scripts and notifies the user if any script was not activated (due to errors in the script).

Definition at line 111 of file scriptmanager.cpp.

void ScriptManager::reloadScripts (  ) 

Reloads all the scripts.

Definition at line 144 of file scriptmanager.cpp.

Translator* ScriptManager::translator (  )  [inline]

returns the Translator object the Scripting::Parley

Definition at line 110 of file scriptmanager.h.


The documentation for this class was generated from the following files:
  • scriptmanager.h
  • scriptmanager.cpp

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal