/usr/include/libkeduvocdocument/keduvockvtml2writer.h is in libkeduvocdocument-dev 4:15.12.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | /***************************************************************************
export a KEduVocDocument to a KVTML file
-----------------------------------------------------------------------
copyright : (C) 2007 Jeremy Whiting <jpwhiting@kde.org>
(C) 2007-2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef KEDUVOCKVTML2WRITER_H
#define KEDUVOCKVTML2WRITER_H
#include <QtXml/QDomDocument>
#include <QtCore/QList>
#include <QtCore/QFile>
#include "keduvocarticle.h"
#include "keduvocmultiplechoice.h"
#include "keduvoctranslation.h"
#include "keduvocpersonalpronoun.h"
class KEduVocDocument;
class KEduVocExpression;
class KEduVocLesson;
class KEduVocLeitnerBox;
/**
* @brief Class to write kvtml2 data files from KEduVocDocument
* @author Jeremy Whiting
*/
class KEduVocKvtml2Writer
{
public:
KEduVocKvtml2Writer( QFile *file );
bool writeDoc( KEduVocDocument *doc, const QString &generator );
QByteArray toByteArray( KEduVocDocument *doc, const QString &generator );
/**
* Helper function, appends a new element AND a text child to @p parent
* Only appends if @p text is NOT empty.
* @param parent
* @param elementName
* @param text
*/
static void appendTextElement( QDomElement &parent, const QString &elementName, const QString &text );
private:
bool createXmlDocument( KEduVocDocument *doc, const QString &generator );
/** write information entries
* @param informationElement QDomElement information to write to
* @param generator text describing generator
*/
bool writeInformation( QDomElement &informationElement, const QString &generator );
/** write identifiers group
* @param identifiersElement QDomElement identifiers to write to
*/
bool writeIdentifiers( QDomElement &identifiersElement );
/** write article
* @param articleElement QDomElement article to write to
* @param article the article number to write
*/
bool writeArticle( QDomElement &articleElement, int article );
bool writePersonalPronoun( QDomElement &pronounElement, const KEduVocPersonalPronoun &pronoun);
/** write types
* @param typesElement QDomElement types to write to
*/
bool writeWordTypes( QDomElement &typesElement, KEduVocWordType* parentContainer );
/**
* write the leitner boxes @see KEduVocLeitnerBox
* @param leitnerParentElement parent dom element
* @param parentContainer parent of the KEduVocLeitnerBoxes to write
* @return success
*/
bool writeLeitnerBoxes( QDomElement &leitnerParentElement, KEduVocLeitnerBox* parentContainer );
/** write entries
* @param entriesElement QDomElement entries to write to
*/
bool writeEntries( QDomElement &entriesElement );
/** write a translation
* @param translationElement QDomElement translation to write to, with id pre-set
* @param translation object to write
*/
bool writeTranslation( QDomElement &translationElement, KEduVocTranslation* translation );
/**
* Used to write synonym, antonym and false friend lists
* @param typesElement
* @param parentContainer
* @return
*/
bool writeRelated( QDomElement &parentElement, QList<KEduVocTranslation*> relatedList );
/** write the lesson group
* @param parentLesson the parent lesson of the current lesson
* @param lessonsElement QDomElement lessons to write to
*/
bool writeLessons( KEduVocLesson *parentLesson, QDomElement &lessonsElement );
void writeSynonymAntonymFalseFriend(QDomElement & parentElement);
/** write multiple choice choices
* @param multipleChoiceElement QDomElement multiplechoice to write to
* @returns success
*/
bool writeMultipleChoice( QDomElement &multipleChoiceElement, KEduVocTranslation* translation );
QDomElement newTextElement( const QString &elementName, const QString &text );
QFile *m_outputFile;
KEduVocDocument *m_doc;
QList<KEduVocExpression*> m_allEntries;
QList<KEduVocTranslation*> m_synonyms;
QList<KEduVocTranslation*> m_antonyms;
QList<KEduVocTranslation*> m_falseFriends;
QDomDocument m_domDoc;
};
#endif
|