parley
#include <parley.h>
Public Types | |
enum | Flags { NoInformation = 0x0, Masculine = 0x1, Feminine = 0x2, Neuter = 0x4, Singular = 0x10, Dual = 0x20, Plural = 0x40, Verb = 0x100, Noun = 0x200, Pronoun = 0x400, Adjective = 0x800, Adverb = 0x1000, Article = 0x2000, Conjunction = 0x4000, First = 0x10000, Second = 0x20000, Third = 0x40000, Nominative = 0x80000, Genitive = 0x100000, Dative = 0x200000, Accusative = 0x400000, Ablative = 0x800000, Locative = 0x1000000, Vocative = 0x2000000, Definite = 0x4000000, Indefinite = 0x8000000, Regular = 0x10000000, Irregular = 0x20000000 } |
Public Slots | |
void | addTranslation (QString word, QString fromLanguage, QString toLanguage, QString translation) |
QStringList | dataDirs () |
QString | localeName (QString locale) |
QStringList | locales () |
QObject * | newAction (const QString &name, const QString &text=QString()) |
QObject * | newDocument () |
void | open (QString filename) |
QStringList | pluginDirs () |
QVariantList | selectedEntries () |
QVariantList | selectedTranslations () |
Signals | |
void | translateWord (const QString &word, const QString &fromLanguage, const QString &toLanguage) |
void | translationFinished (const QString &word, const QString &fromLanguage, const QString &toLanguage) |
void | translationStarted (const QString &word, const QString &fromLanguage, const QString &toLanguage) |
Public Member Functions | |
Parley (Editor::EditorWindow *editor) | |
~Parley () | |
QObject * | activeLesson () |
void | callTranslateWord (const QString &word, const QString &fromLanguage, const QString &toLanguage) |
QObject * | getDocument () |
Translator * | translator () |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Properties | |
QObject | activeLesson |
QObject | doc |
QObject | document |
Properties inherited from QObject | |
objectName | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Detailed Description
Parley scripting class (main entry point of a Parley Kross script)
Parley class is the main entry point of Parley scripting classes. Through it you can access the Document class (Parley.doc or Parley.document) which provides functionality for viewing/modifying a Parley document (KEduVocDocument), that means access lessons, entries, document languages etc.
The Parley class has to do more with the active Parley application. Here it follows a list of possible usages of Parley class:
- Add a new Action to the script menu (see Parley::newAction() function)
- Add a new translation script (see Parley::translateWord() signal)
- Have direct access to the active lesson (see Parley::activeLesson property)
- Have access to various enumerations (see Parley::Number, Parley::Case, Parley::Person, Parley::Gender and Parley::Definiteness enumerations)
- Create a new Parley Document (see Parley::newDocument() function)
Signals and Slots: To connect a script function (slot) to a signal you just define a function with the same name as the signal or use the Parley.connect function:
Member Enumeration Documentation
Constructor & Destructor Documentation
Scripting::Parley::Parley | ( | Editor::EditorWindow * | editor | ) |
Definition at line 42 of file parley.cpp.
Scripting::Parley::~Parley | ( | ) |
Definition at line 48 of file parley.cpp.
Member Function Documentation
QObject* Scripting::Parley::activeLesson | ( | ) |
|
slot |
Adds the found translation
of the word
from language fromLanguage
to language toLanguage
to Parley translations to be used for translating lesson entries (or anything else).
This function is ment to be used by scripts to add a translation of a word by parsing either online or offline dictionaries.
- Parameters
-
word Translated word fromLanguage From language toLanguage To language translation Translation of word
Definition at line 61 of file parley.cpp.
void Scripting::Parley::callTranslateWord | ( | const QString & | word, |
const QString & | fromLanguage, | ||
const QString & | toLanguage | ||
) |
Definition at line 54 of file parley.cpp.
|
inlineslot |
Gives the language name of the given locale
.
- Parameters
-
locale Language locale
- Returns
- Language name
Definition at line 73 of file parley.cpp.
|
slot |
Returns a list of all available locales (to be used by the scripts)
- Returns
Definition at line 67 of file parley.cpp.
|
slot |
Creates and adds to the Scripts menu a new KAction (see KAction documentation)
- Parameters
-
name Unique action name text Action's text (what text appears in the scripts menu)
- Returns
- A reference to a KAction object (accessible by scripts)
Definition at line 145 of file parley.cpp.
|
inlineslot |
Creates a new document and returns a reference to it.
- Returns
- A Document object, the newly created lesson
|
slot |
- Todo:
- Make this function working (not very important function)
Definition at line 78 of file parley.cpp.
|
inlineslot |
|
slot |
Returns a list of Expression objects (the selected entries of the active lesson)
Definition at line 90 of file parley.cpp.
|
slot |
Returns a list of Translation objects (the selected translations of the active lesson)
Definition at line 116 of file parley.cpp.
|
signal |
Slots (script functions) connected to this signal are called when a translation of word
is requested.
Note that a script function with the same name as a signal will be automatically connected to that signal when the script is activated.
- Parameters
-
word Word to translate fromLanguage The language of word
to translate fromtoLanguage The language you want to translate to
|
signal |
|
signal |
|
inline |
Property Documentation
|
read |
|
read |
Abreviation of document property (same as Parley.document)
|
read |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.