libkdeedu/keduvocdocument
keduvockvtml2writer.cpp
Go to the documentation of this file.
59 m_domDoc = QDomDocument( "kvtml PUBLIC \"kvtml2.dtd\" \"http://edu.kde.org/kvtml/kvtml2.dtd\"" );
60 m_domDoc.appendChild( m_domDoc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
112 bool KEduVocKvtml2Writer::writeInformation( QDomElement &informationElement, const QString &generator )
132 informationElement.appendChild( newTextElement( KVTML_AUTHORCONTACT, m_doc->authorContact() ) );
146 informationElement.appendChild( newTextElement( KVTML_DATE, today.toString(QLatin1String("yyyy-MM-dd")) ) );
167 // TODO: when support for more parts of the identifier is in the document class (name, type, etc.) store those here as well
198 bool KEduVocKvtml2Writer::writeLessons( KEduVocLesson *parentLesson, QDomElement &lessonsElement )
277 entryElement.setAttribute( KVTML_ID, QString::number(m_allEntries.indexOf(translation->entry())) );
293 partnerElement.setAttribute( KVTML_ID, QString::number(m_allEntries.indexOf(synonym->entry())) );
316 bool KEduVocKvtml2Writer::writeRelated(QDomElement & parentElement, QList< KEduVocTranslation * > relatedList)
320 entryElement.setAttribute( KVTML_ID, QString::number(m_allEntries.indexOf(translation->entry())) );
359 QString articleString = m_doc->identifier(language).article().article(numbers[num] | genders[gen] | defs[def]);
376 bool KEduVocKvtml2Writer::writeWordTypes( QDomElement &typesElement, KEduVocWordType* parentContainer )
387 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_MALE ) );
390 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_FEMALE ) );
393 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_NEUTRAL ) );
395 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN ) );
398 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_VERB ) );
401 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_ADJECTIVE ) );
404 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_ADVERB ) );
407 typeDefinitionElement.appendChild( newTextElement( KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_CONJUNCTION ) );
435 bool KEduVocKvtml2Writer::writeLeitnerBoxes( QDomElement &leitnerParentElement, KEduVocLeitnerBox* parentContainer )
498 bool KEduVocKvtml2Writer::writeTranslation( QDomElement &translationElement, KEduVocTranslation* translation )
504 if ( !(translation->comparativeForm().text().isEmpty() || translation->superlativeForm().text().isEmpty())) {
586 bool KEduVocKvtml2Writer::writeMultipleChoice( QDomElement &multipleChoiceElement, KEduVocTranslation* translation )
603 QDomElement KEduVocKvtml2Writer::newTextElement( const QString &elementName, const QString &text )
611 bool KEduVocKvtml2Writer::writePersonalPronoun(QDomElement & pronounElement, const KEduVocPersonalPronoun & pronoun)
615 pronounElement.appendChild( m_domDoc.createElement( KVTML_THIRD_PERSON_MALE_FEMALE_DIFFERENT ) );
632 persons[2] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Masculine);
633 persons[3] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Feminine);
634 persons[4] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Neuter);
654 void KEduVocKvtml2Writer::appendTextElement(QDomElement & parent, const QString & elementName, const QString & text)
QList< KEduVocContainer * > childContainers()
Definition: keduvoccontainer.cpp:190
Definition: keduvocwordflags.h:41
#define KVTML_SPECIALWORDTYPE_CONJUNCTION
Definition: kvtml2defs.h:114
class to store information about a container - that can be a lesson or word types ...
Definition: keduvoccontainer.h:30
Definition: keduvocwordflags.h:38
Definition: keduvocwordflags.h:33
Definition: keduvocwordflags.h:49
QStringList & multipleChoice()
Returns multiple choice if available.
Definition: keduvoctranslation.cpp:296
Definition: keduvocwordflags.h:28
Definition: keduvocwordflags.h:47
bool isActive() const
returns flag if entry is activated for queries
Definition: keduvocexpression.cpp:150
KEduVocContainer * childContainer(int row)
Definition: keduvoccontainer.cpp:85
KEduVocWordType * wordType() const
Returns the word type of this expression, you will get a 0 pointer if wordtype is not set for the tra...
Definition: keduvoctranslation.cpp:355
KEduVocLeitnerBox * leitnerContainer()
Definition: keduvocdocument.cpp:726
KEduVocArticle & article() const
Articles (a, the in English, el, la,...
Definition: keduvocidentifier.cpp:106
Leitner Boxes are an alternative grading system.
Definition: keduvocleitnerbox.h:31
KEduVocIdentifier & identifier(int index)
Returns the identifier of translation index.
Definition: keduvocdocument.cpp:654
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive)
get a list of all entries in the lesson
Definition: keduvocwordtype.cpp:46
KEduVocKvtml2Writer(QFile *file)
Definition: keduvockvtml2writer.cpp:31
#define KVTML_SPECIALWORDTYPE_NOUN_FEMALE
Definition: kvtml2defs.h:109
KEduVocWordType * wordTypeContainer()
Definition: keduvocdocument.cpp:721
QString locale() const
The locale of the contents: en, de, es, ...
Definition: keduvocidentifier.cpp:91
#define KVTML_SPECIALWORDTYPE_NOUN_NEUTRAL
Definition: kvtml2defs.h:110
QList< KEduVocTranslation * > falseFriends() const
Returns false friends of this expression.
Definition: keduvoctranslation.cpp:224
static void appendTextElement(QDomElement &parent, const QString &elementName, const QString &text)
Helper function, appends a new element AND a text child to parent Only appends if text is NOT empty...
Definition: keduvockvtml2writer.cpp:654
#define KVTML_THIRD_PERSON_NEUTRAL_EXISTS
Definition: kvtml2defs.h:90
Definition: keduvocwordflags.h:35
bool dualExists() const
Definition: keduvocpersonalpronoun.cpp:116
QString personalPronoun(KEduVocWordFlags flags) const
Definition: keduvocpersonalpronoun.cpp:78
KUrl imageUrl()
Get the image url for this translation if it exists.
Definition: keduvoctranslation.cpp:342
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive)
get a list of all entries in the lesson
Definition: keduvoclesson.cpp:51
Definition: keduvoctranslation.h:35
Definition: keduvocwordflags.h:39
Definition: keduvoccontainer.h:44
QList< KEduVocTranslation * > synonyms() const
Returns synonyms of this expression.
Definition: keduvoctranslation.cpp:240
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive)
get a list of all entries in the box
Definition: keduvocleitnerbox.cpp:44
Definition: keduvocwordflags.h:62
QList< KEduVocTranslation * > antonyms() const
Returns antonyms of this expression.
Definition: keduvoctranslation.cpp:250
bool neutralExists() const
Definition: keduvocpersonalpronoun.cpp:106
This class contains one vocabulary expression as an original with one or more translations.
Definition: keduvocexpression.h:37
KEduVocText superlativeForm() const
Definition: keduvoctranslation.cpp:447
KEduVocPersonalPronoun & personalPronouns() const
Get the personal pronouns for this identifier.
Definition: keduvocidentifier.cpp:111
static const QString KVTML_GRAMMATICAL_DEFINITENESS[]
Definition: kvtml2defs.h:80
bool writeDoc(KEduVocDocument *doc, const QString &generator)
Definition: keduvockvtml2writer.cpp:37
Definition: keduvocwordflags.h:42
QByteArray toByteArray(KEduVocDocument *doc, const QString &generator)
Definition: keduvockvtml2writer.cpp:47
#define KVTML_THIRD_PERSON_MALE_FEMALE_DIFFERENT
Definition: kvtml2defs.h:88
KEduVocTranslation * translation(int index)
Get a pointer to the translation.
Definition: keduvocexpression.cpp:182
QList< int > translationIndices() const
Definition: keduvocexpression.cpp:199
count_t practiceCount() const
returns how often this entry has been practiced as int
Definition: keduvoctext.cpp:107
void toKVTML2(QDomElement &parent)
Definition: keduvoctranslation.cpp:493
Definition: keduvocwordflags.h:30
KEduVocLeitnerBox * leitnerBox() const
Returns the leitner box of this translation.
Definition: keduvoctranslation.cpp:375
bool maleFemaleDifferent() const
Definition: keduvocpersonalpronoun.cpp:96
This class contains the expressions of your vocabulary as well as other information about the vocabul...
Definition: keduvocdocument.h:44
Definition: keduvocwordflags.h:29
Definition: keduvocwordflags.h:48
Definition: keduvocwordflags.h:61
Definition: keduvocwordflags.h:34
KEduVocText comparativeForm() const
Definition: keduvoctranslation.cpp:430
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:37:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:37:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.