libkdeedu/keduvocdocument
KEduVocDocument Class Reference
#include <keduvocdocument.h>

Detailed Description
This class contains the expressions of your vocabulary as well as other information about the vocabulary.Definition at line 43 of file keduvocdocument.h.
Public Types | |
| enum | FileType { KvdNone, Automatic, Kvtml, Wql, Pauker, Vokabeln, Xdxf, Csv, Kvtml1 } |
| enum | ErrorCode { NoError = 0, Unknown, InvalidXml, FileTypeUnknown, FileCannotWrite, FileWriterFailed, FileCannotRead, FileReaderFailed, FileDoesNotExist } |
| enum | FileDialogMode { Reading, Writing } |
| enum | LessonDeletion { DeleteEmptyLesson, DeleteEntriesAndLesson } |
Signals | |
| void | progressChanged (KEduVocDocument *, int curr_percent) |
| void | docModified (bool mod) |
Public Member Functions | |
| KEduVocDocument (QObject *parent=0) | |
| ~KEduVocDocument () | |
| int | open (const KUrl &url) |
| int | saveAs (const KUrl &url, FileType ft, const QString &generator) |
| void | merge (KEduVocDocument *docToMerge, bool matchIdentifiers) |
| void | setModified (bool dirty=true) |
| bool | isModified () const |
| void | setUrl (const KUrl &url) |
| KUrl | url () const |
| void | setTitle (const QString &title) |
| QString | title () const |
| void | setAuthor (const QString &author) |
| QString | author () const |
| void | setLicense (const QString &license) |
| QString | license () const |
| void | setDocumentComment (const QString &comment) |
| QString | documentComment () const |
| void | setCategory (const QString &category) |
| QString | category () const |
| void | setGenerator (const QString &generator) |
| QString | generator () const |
| void | setVersion (const QString &ver) |
| QString | version () const |
| void | appendEntry (KEduVocExpression *expression) |
| void | insertEntry (KEduVocExpression *expression, int index) |
| void | removeEntry (int index) |
| void | shuffle () |
| int | cleanUp () |
| int | entryCount () const |
| int | sizeHint (int index) const |
| void | setSizeHint (int index, const int width) |
| int | identifierCount () const |
| int | appendIdentifier (const KEduVocIdentifier &identifier=KEduVocIdentifier()) |
| void | setIdentifier (int index, const KEduVocIdentifier &lang) |
| KEduVocIdentifier & | identifier (int index) |
| void | removeIdentifier (int index) |
| int | indexOfIdentifier (const QString &name) const |
| KEduVocWordType & | wordTypes () |
| void | setTenseName (int index, QString &str) |
| QString | tenseName (int index) const |
| void | setTenseDescriptions (const QStringList &names) |
| QStringList | tenseDescriptions () const |
| QStringList | usages () const |
| void | addUsage (const QString &usage) |
| void | renameUsage (const QString &oldName, const QString &newName) |
| void | removeUsage (const QString &name) |
| void | resetEntry (int index=-1, int lesson=0) |
| KEduVocExpression * | entry (int index) |
| KDE_DEPRECATED void | queryIdentifier (QString &org, QString &trans) const |
| KDE_DEPRECATED void | setQueryIdentifier (const QString &org, const QString &trans) |
| int | currentLesson () const |
| void | setCurrentLesson (int lesson) |
| KEduVocLesson & | lesson (int index) |
| QList< KEduVocLesson > & | lessons () const |
| int | lessonCount () const |
| int | appendLesson (const QString &lessonName, bool inQuery=true) |
| bool | removeLesson (int lessonIndex, int deleteMode) |
| KDE_DEPRECATED QStringList | lessonNames () const |
| void | moveLesson (int from, int to) |
| QString | csvDelimiter () const |
| void | setCsvDelimiter (const QString &delimiter) |
Static Public Member Functions | |
| static FileType | detectFileType (const QString &fileName) |
| static QString | pattern (FileDialogMode mode) |
| static QString | errorDescription (int errorCode) |
Member Enumeration Documentation
the return code when opening/saving
- Enumerator:
-
NoError Unknown InvalidXml FileTypeUnknown FileCannotWrite FileWriterFailed FileCannotRead FileReaderFailed FileDoesNotExist
Definition at line 62 of file keduvocdocument.h.
delete only empty lessons or also if they have entries
Definition at line 82 of file keduvocdocument.h.
Constructor & Destructor Documentation
| KEduVocDocument::KEduVocDocument | ( | QObject * | parent = 0 |
) | [explicit] |
Constructor for a KdeEdu vocabulary document.
- Parameters:
-
parent calling object
Definition at line 132 of file keduvocdocument.cpp.
| KEduVocDocument::~KEduVocDocument | ( | ) |
Member Function Documentation
| int KEduVocDocument::open | ( | const KUrl & | url | ) |
Open a document file.
- Parameters:
-
url url to file to open
- Returns:
- ErrorCode
- Todo:
- make the readers return int, pass on the error message properly
Definition at line 249 of file keduvocdocument.cpp.
Saves the data under the given name.
- Parameters:
-
url if url is empty (or NULL) actual name is preserved ft the filetype to be used when saving the document generator the name of the application saving the document
- Returns:
- ErrorCode
Definition at line 380 of file keduvocdocument.cpp.
| void KEduVocDocument::merge | ( | KEduVocDocument * | docToMerge, | |
| bool | matchIdentifiers | |||
| ) |
Merges data from another document.
- Parameters:
-
docToMerge document containing the data to be merged matchIdentifiers if true only entries having identifiers present in the current document will be mergedurl is empty (or NULL) actual name is preserved
- Todo:
- IMPLEMENT ME
Definition at line 439 of file keduvocdocument.cpp.
| void KEduVocDocument::setModified | ( | bool | dirty = true |
) |
Indicates if the document is modified.
- Parameters:
-
dirty new state
Definition at line 143 of file keduvocdocument.cpp.
| bool KEduVocDocument::isModified | ( | ) | const |
| void KEduVocDocument::setUrl | ( | const KUrl & | url | ) |
| KUrl KEduVocDocument::url | ( | ) | const |
| void KEduVocDocument::setTitle | ( | const QString & | title | ) |
set the title of the file
- Parameters:
-
title title to set
Definition at line 923 of file keduvocdocument.cpp.
| QString KEduVocDocument::title | ( | ) | const |
| void KEduVocDocument::setAuthor | ( | const QString & | author | ) |
set the author of the file
- Parameters:
-
author author to set
Definition at line 929 of file keduvocdocument.cpp.
| QString KEduVocDocument::author | ( | ) | const |
| void KEduVocDocument::setLicense | ( | const QString & | license | ) |
set the license of the file
- Parameters:
-
license license to set
Definition at line 935 of file keduvocdocument.cpp.
| QString KEduVocDocument::license | ( | ) | const |
| void KEduVocDocument::setDocumentComment | ( | const QString & | comment | ) |
set the comment of the file
- Parameters:
-
comment comment to set
Definition at line 941 of file keduvocdocument.cpp.
| QString KEduVocDocument::documentComment | ( | ) | const |
| void KEduVocDocument::setCategory | ( | const QString & | category | ) |
set the category of the file
- Parameters:
-
category category to set
Definition at line 898 of file keduvocdocument.cpp.
| QString KEduVocDocument::category | ( | ) | const |
- Returns:
- the category of the file
- Todo:
- make writer/reader use this
Definition at line 903 of file keduvocdocument.cpp.
| void KEduVocDocument::setGenerator | ( | const QString & | generator | ) |
| QString KEduVocDocument::generator | ( | ) | const |
| void KEduVocDocument::setVersion | ( | const QString & | ver | ) |
Sets version of the loaded file.
- Parameters:
-
ver the new version
Definition at line 965 of file keduvocdocument.cpp.
| QString KEduVocDocument::version | ( | ) | const |
| void KEduVocDocument::appendEntry | ( | KEduVocExpression * | expression | ) |
Appends a new expression to the end of the vocabulary.
- Parameters:
-
expression expression to append
Definition at line 150 of file keduvocdocument.cpp.
| void KEduVocDocument::insertEntry | ( | KEduVocExpression * | expression, | |
| int | index | |||
| ) |
Inserts a new expression at position index.
- Parameters:
-
expression expression to insert index index of entry
Definition at line 156 of file keduvocdocument.cpp.
| void KEduVocDocument::removeEntry | ( | int | index | ) |
Removes an expression from the document.
- Parameters:
-
index index of expression
Definition at line 663 of file keduvocdocument.cpp.
| void KEduVocDocument::shuffle | ( | ) |
| int KEduVocDocument::cleanUp | ( | ) |
Removes duplicate entries (original plus all translations).
- Returns:
- number of removed entries
Definition at line 1114 of file keduvocdocument.cpp.
| int KEduVocDocument::entryCount | ( | ) | const |
| int KEduVocDocument::sizeHint | ( | int | index | ) | const |
Returns the recommended size.
- Parameters:
-
index number of expr, -1 = lesson
- Returns:
- width of column
Definition at line 736 of file keduvocdocument.cpp.
| void KEduVocDocument::setSizeHint | ( | int | index, | |
| const int | width | |||
| ) |
Sets the recommended size.
- Parameters:
-
index number of expr, -1 = lesson width width of column
Definition at line 757 of file keduvocdocument.cpp.
| int KEduVocDocument::identifierCount | ( | ) | const |
- Returns:
- the number of different identifiers (usually languages)
Definition at line 812 of file keduvocdocument.cpp.
| int KEduVocDocument::appendIdentifier | ( | const KEduVocIdentifier & | identifier = KEduVocIdentifier() |
) |
Appends a new identifier (usually a language).
- Parameters:
-
identifier the identifier to append. If empty default names are used.
- Returns:
- the identifier number
Definition at line 817 of file keduvocdocument.cpp.
| void KEduVocDocument::setIdentifier | ( | int | index, | |
| const KEduVocIdentifier & | lang | |||
| ) |
Sets the identifier of translation.
- Parameters:
-
index number of translation 0..x lang thr language identifier: en=english, de=german, ...
Definition at line 697 of file keduvocdocument.cpp.
| KEduVocIdentifier & KEduVocDocument::identifier | ( | int | index | ) |
Returns the identifier of translation index.
- Parameters:
-
index number of translation 0..x
- Returns:
- the language identifier: en=english, de=german, ...
Definition at line 688 of file keduvocdocument.cpp.
| void KEduVocDocument::removeIdentifier | ( | int | index | ) |
Removes identifier and the according translations in all entries.
- Parameters:
-
index number of translation 0..x
Definition at line 778 of file keduvocdocument.cpp.
| int KEduVocDocument::indexOfIdentifier | ( | const QString & | name | ) | const |
Determines the index of a given identifier.
- Parameters:
-
lang identifier of language
- Returns:
- index of identifier, 0 = original, 1..n = translation, -1 = not found
Definition at line 677 of file keduvocdocument.cpp.
| KEduVocWordType & KEduVocDocument::wordTypes | ( | ) |
Returns the type handling class.
See KEduVocWordType.
- Returns:
- the KEduVocWordType* type handling class
Definition at line 1240 of file keduvocdocument.cpp.
| void KEduVocDocument::setTenseName | ( | int | index, | |
| QString & | str | |||
| ) |
Sets the tense string.
- Parameters:
-
index number of tense str name of tense
Definition at line 714 of file keduvocdocument.cpp.
| QString KEduVocDocument::tenseName | ( | int | index | ) | const |
Returns the tense string.
- Parameters:
-
index number of tense
- Returns:
- string
Definition at line 705 of file keduvocdocument.cpp.
| void KEduVocDocument::setTenseDescriptions | ( | const QStringList & | names | ) |
| QStringList KEduVocDocument::tenseDescriptions | ( | ) | const |
| QStringList KEduVocDocument::usages | ( | ) | const |
Gets the descriptions of the usages.
Usages are context information in a dictionary you may find [biol.] [am.] and the like to hint at the context in which the word is usually used.
Definition at line 1246 of file keduvocdocument.cpp.
| void KEduVocDocument::addUsage | ( | const QString & | usage | ) |
Adds a usage label to the doc.
- Parameters:
-
usage name of the usage
Definition at line 1252 of file keduvocdocument.cpp.
Rename a usage label.
Actually changes the label in the vocabulary as well.
- Parameters:
-
oldName old name of the usage label newName new name of the usage label
Definition at line 1258 of file keduvocdocument.cpp.
| void KEduVocDocument::removeUsage | ( | const QString & | name | ) |
Remove a usage label.
Also removes the label from all translations.
- Parameters:
-
name new name of the usage label
Definition at line 1278 of file keduvocdocument.cpp.
| void KEduVocDocument::resetEntry | ( | int | index = -1, |
|
| int | lesson = 0 | |||
| ) |
Sets grades to KV_NORM_GRADE, counts to 0 .
..
- Parameters:
-
index index of language 0..x, -1 = all lesson lesson id, if this is 0 all lesson are affected, otherwise only matching numbers
Definition at line 804 of file keduvocdocument.cpp.
| KEduVocExpression * KEduVocDocument::entry | ( | int | index | ) |
Returns pointer to expression object index.
- Parameters:
-
index index of desired entry
- Returns:
- pointer to object or NULL if index out of range
Definition at line 654 of file keduvocdocument.cpp.
Retrieves the identifiers for the current query not written in the new version!
- Parameters:
-
org identifier for original trans identifier for translation
Definition at line 909 of file keduvocdocument.cpp.
Sets the identifiers for the current query not written in the new version!
- Parameters:
-
org identifier for original trans identifier for translation
Definition at line 916 of file keduvocdocument.cpp.
| int KEduVocDocument::currentLesson | ( | ) | const |
| void KEduVocDocument::setCurrentLesson | ( | int | lesson | ) |
Sets current lesson index.
- Parameters:
-
lesson index of lesson
Definition at line 977 of file keduvocdocument.cpp.
| KEduVocLesson & KEduVocDocument::lesson | ( | int | index | ) |
get a lesson object
- Returns:
- a pointer to the lesson object at the specified index NOTE: this will create one if it doesn't exist
Definition at line 854 of file keduvocdocument.cpp.
| QList< KEduVocLesson > & KEduVocDocument::lessons | ( | ) | const |
get all lesson objects
- Returns:
- a map of pointers to lesson objects
Definition at line 849 of file keduvocdocument.cpp.
| int KEduVocDocument::lessonCount | ( | ) | const |
| int KEduVocDocument::appendLesson | ( | const QString & | lessonName, | |
| bool | inQuery = true | |||
| ) |
Append a new lesson to the list of lessons.
- Parameters:
-
lessonName name for the new lesson
- Returns:
- the index of the new lesson
Definition at line 840 of file keduvocdocument.cpp.
| bool KEduVocDocument::removeLesson | ( | int | lessonIndex, | |
| int | deleteMode | |||
| ) |
Delete a lesson.
- Parameters:
-
lessonIndex which lesson deleteMode either KEduVocDocument::DeleteEmptyLesson (delete only if empty) or KEduVocDocument::DeleteEntriesAndLesson (delete including vocabulary in that lesson)
- Returns:
- if the deletion was successful. If there are vocabularies in the lesson, but DeleteEmptyLesson, this will return false and not delete the lesson.
Definition at line 997 of file keduvocdocument.cpp.
| QStringList KEduVocDocument::lessonNames | ( | ) | const |
DEPRECATED All lesson descriptions as stringlist.
- Returns:
- a list of defined lessons
Definition at line 983 of file keduvocdocument.cpp.
| void KEduVocDocument::moveLesson | ( | int | from, | |
| int | to | |||
| ) |
- Todo:
- implement this? Moves the lesson at index position from to index position to.
- Parameters:
-
from the lesson to be moved to the new position
| QString KEduVocDocument::csvDelimiter | ( | ) | const |
Returns the delimiter (separator) used for csv import and export.
The default is a single tab character
- Returns:
- the delimiter used
Definition at line 1068 of file keduvocdocument.cpp.
| void KEduVocDocument::setCsvDelimiter | ( | const QString & | delimiter | ) |
Sets the delimiter (separator) used for csv import and export.
- Parameters:
-
delimiter the delimiter to use
Definition at line 1074 of file keduvocdocument.cpp.
| KEduVocDocument::FileType KEduVocDocument::detectFileType | ( | const QString & | fileName | ) | [static] |
Definition at line 173 of file keduvocdocument.cpp.
| QString KEduVocDocument::pattern | ( | FileDialogMode | mode | ) | [static] |
Create a string with the supported document types, that can be used as filter in KFileDialog.
It includes also an entry to match all the supported types.
- Parameters:
-
mode the mode for the supported document types
- Returns:
- the filter string
Definition at line 1181 of file keduvocdocument.cpp.
| QString KEduVocDocument::errorDescription | ( | int | errorCode | ) | [static] |
Definition at line 1214 of file keduvocdocument.cpp.
| void KEduVocDocument::progressChanged | ( | KEduVocDocument * | , | |
| int | curr_percent | |||
| ) | [signal] |
| void KEduVocDocument::docModified | ( | bool | mod | ) | [signal] |
Emitted when the document becomes modified or saved.
- Returns:
- state (true=modified)
The documentation for this class was generated from the following files:
KDE 4.0 API Reference