LibKEduVocDocument
keduvockvtml2writer.cpp
50 m_domDoc = QDomDocument(QStringLiteral("kvtml PUBLIC \"kvtml2.dtd\" \"http://edu.kde.org/kvtml/kvtml2.dtd\""));
51 m_domDoc.appendChild(m_domDoc.createProcessingInstruction(QStringLiteral("xml"), QStringLiteral("version=\"1.0\" encoding=\"UTF-8\"")));
103bool KEduVocKvtml2Writer::writeInformation(QDomElement &informationElement, const QString &generator)
137 informationElement.appendChild(newTextElement(KVTML_DATE, today.toString(QStringLiteral("yyyy-MM-dd"))));
157 // TODO: when support for more parts of the identifier is in the document class (name, type, etc.) store those here as well
264 entryElement.setAttribute(KVTML_ID, QString::number(m_allEntries.indexOf(translation->entry())));
301bool KEduVocKvtml2Writer::writeRelated(QDomElement & parentElement, QList< KEduVocTranslation * > relatedList)
305 entryElement.setAttribute( KVTML_ID, QString::number(m_allEntries.indexOf(translation->entry())) );
342 QString articleString = m_doc->identifier(language).article().article(numbers[num] | genders[gen] | defs[def]);
358bool KEduVocKvtml2Writer::writeWordTypes(QDomElement &typesElement, KEduVocWordType *parentContainer)
368 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_MALE));
371 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_FEMALE));
374 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN_NEUTRAL));
376 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_NOUN));
378 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_VERB));
381 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_ADJECTIVE));
384 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_ADVERB));
387 typeDefinitionElement.appendChild(newTextElement(KVTML_SPECIALWORDTYPE, KVTML_SPECIALWORDTYPE_CONJUNCTION));
414bool KEduVocKvtml2Writer::writeLeitnerBoxes(QDomElement &leitnerParentElement, KEduVocLeitnerBox *parentContainer)
476bool KEduVocKvtml2Writer::writeTranslation(QDomElement &translationElement, KEduVocTranslation *translation)
482 if (!(translation->comparativeForm().text().isEmpty() || translation->superlativeForm().text().isEmpty())) {
516 urlString = QUrl::fromLocalFile(dir.relativeFilePath(translation->imageUrl().toLocalFile())).url();
530 urlString = QUrl::fromLocalFile(dir.relativeFilePath(translation->soundUrl().toLocalFile())).url();
565bool KEduVocKvtml2Writer::writeMultipleChoice(QDomElement &multipleChoiceElement, KEduVocTranslation *translation)
590bool KEduVocKvtml2Writer::writePersonalPronoun(QDomElement &pronounElement, const KEduVocPersonalPronoun &pronoun)
610 persons[2] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Masculine);
611 persons[3] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Feminine);
612 persons[4] = (KEduVocWordFlag::Flags)((int)KEduVocWordFlag::Third | (int)KEduVocWordFlag::Neuter);
630void KEduVocKvtml2Writer::appendTextElement(QDomElement &parent, const QString &elementName, const QString &text)
class to store information about a container - that can be a lesson or word types
Definition keduvoccontainer.h:22
The primary entry point to the hierarchy of objects describing vocabularies.
Definition keduvocdocument.h:32
KEduVocWordType * wordTypeContainer()
Returns the root word type object.
Definition keduvocdocument.cpp:671
KEduVocLeitnerBox * leitnerContainer()
Returns the root Leitner container.
Definition keduvocdocument.cpp:676
KEduVocIdentifier & identifier(int index)
Returns the identifier of translation index.
Definition keduvocdocument.cpp:607
This class contains one vocabulary expression as an original with one or more translations.
Definition keduvocexpression.h:27
bool isActive() const
returns flag if entry is activated for queries
Definition keduvocexpression.cpp:135
KEduVocTranslation * translation(int index)
Get a pointer to the translation.
Definition keduvocexpression.cpp:165
KEduVocArticle & article() const
Articles (a, the in English, el, la,... in Spanish)
Definition keduvocidentifier.cpp:99
KEduVocPersonalPronoun & personalPronouns() const
Get the personal pronouns for this identifier.
Definition keduvocidentifier.cpp:104
QString locale() const
The locale of the contents: en, de, es, ...
Definition keduvocidentifier.cpp:84
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:630
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive) override
get a list of all entries in the box
Definition keduvocleitnerbox.cpp:36
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive) override
get a list of all entries in the lesson
Definition keduvoclesson.cpp:47
count_t practiceCount() const
returns how often this entry has been practiced as int
Definition keduvoctext.cpp:112
Definition keduvoctranslation.h:25
QStringList getMultipleChoice() const
Returns multiple choice if available.
Definition keduvoctranslation.cpp:277
KEduVocLeitnerBox * leitnerBox() const
Returns the leitner box of this translation.
Definition keduvoctranslation.cpp:359
QUrl soundUrl()
Get the sound url for this translation if it exists.
Definition keduvoctranslation.cpp:313
QList< KEduVocTranslation * > synonyms() const
Returns synonyms of this expression.
Definition keduvoctranslation.cpp:214
QList< KEduVocTranslation * > antonyms() const
Returns antonyms of this expression.
Definition keduvoctranslation.cpp:224
QList< KEduVocTranslation * > falseFriends() const
Returns false friends of this expression.
Definition keduvoctranslation.cpp:199
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:339
QUrl imageUrl()
Get the image url for this translation if it exists.
Definition keduvoctranslation.cpp:326
QList< KEduVocExpression * > entries(EnumEntriesRecursive recursive=NotRecursive) override
get a list of all entries in the lesson
Definition keduvocwordtype.cpp:37
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
KIOCORE_EXPORT QString dir(const QString &fileClass)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QDate currentDate()
QString toString(QStringView format, QCalendar cal) const const
QDomElement createElement(const QString &tagName)
QDomProcessingInstruction createProcessingInstruction(const QString &target, const QString &data)
QDomText createTextNode(const QString &value)
QByteArray toByteArray(int indent) const const
void setAttribute(const QString &name, const QString &value)
QDomNode appendChild(const QDomNode &newChild)
bool hasChildNodes() const const
QDomDocument ownerDocument() const const
void save(QTextStream &stream, int indent, EncodingPolicy encodingPolicy) const const
bool testFlag(Enum flag) const const
void append(QList< T > &&value)
bool contains(const AT &value) const const
qsizetype count() const const
qsizetype indexOf(const AT &value, qsizetype from) const const
bool isEmpty() const const
value_type takeFirst()
T value(qsizetype i) const const
bool isEmpty() const const
bool isNull() const const
QString number(double n, char format, int precision)
RemoveFilename
QUrl adjusted(FormattingOptions options) const const
QUrl fromLocalFile(const QString &localFile)
bool isEmpty() const const
bool isParentOf(const QUrl &childUrl) const const
QString toLocalFile() const const
QString url(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:53:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:53:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.