Warning, file /education/libkeduvocdocument/keduvocdocument/keduvockvtmlcompability.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * C++ Interface: keduvockvtml1compability_p
0003  * SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #ifndef KEDUVOCKVTMLCOMPABILITY_H
0007 #define KEDUVOCKVTMLCOMPABILITY_H
0008 
0009 #include <QString>
0010 #include <QMap>
0011 #include <QSet>
0012 
0013 
0014 // internal types, indented are subtypes
0015 
0016 #define QM_VERB           "v"    // go
0017 // #define   QM_VERB_IRR     "ir"
0018 // #define   QM_VERB_REG     "re"
0019 #define QM_NOUN           "n"    // table, coffee
0020 // #define   QM_NOUN_F       "f"
0021 // #define   QM_NOUN_M       "m"
0022 // #define   QM_NOUN_S       "s"
0023 #define QM_NAME           "nm"
0024 // #define QM_ART            "ar"   // article
0025 // #define   QM_ART_DEF      "def"  // definite    a/an
0026 // #define   QM_ART_IND      "ind"  // indefinite  the
0027 #define QM_ADJ            "aj"   // adjective   expensive, good
0028 // #define QM_ADV            "av"   // adverb      today, strongly
0029 // #define QM_PRON           "pr"   // pronoun     you, she
0030 // #define   QM_PRON_POS     "pos"  // possessive  my, your
0031 // #define   QM_PRON_PER     "per"  // personal
0032 // #define QM_PHRASE         "ph"
0033 // #define QM_NUM            "num"  // numeral
0034 // #define   QM_NUM_ORD      "ord"  // ordinal     first, second
0035 // #define   QM_NUM_CARD     "crd"  // cardinal    one, two
0036 // #define QM_INFORMAL       "ifm"
0037 // #define QM_FIG            "fig"
0038 // #define QM_CON            "con"  // conjunction  and, but
0039 // #define QM_PREP           "pre"  // preposition behind, between
0040 // #define QM_QUEST          "qu"   // question    who, what
0041 
0042 // type delimiters
0043 
0044 #define QM_USER_TYPE  "#"   // designates number of user type
0045 #define QM_TYPE_DIV   ":"   // divide main from subtype
0046 
0047 // usage delimiters (also declared in UsageManager.h)
0048 
0049 #define UL_USER_USAGE  "#"   // designates number of user type
0050 
0051 class KEduVocWordType;
0052 
0053 /**
0054   * @file keduvockvtmlcompability.h
0055   * contains defines and constants necessary for reading kvtml files prior to KDE4. kvtml version 1.
0056   */
0057 class KEduVocKvtmlCompability
0058 {
0059 
0060 public:
0061     /**
0062      * Constructor, initialize the map.
0063      */
0064     KEduVocKvtmlCompability();
0065 
0066     ///// TYPES
0067     /**
0068      * Get the type from an old type definition
0069      * @param parent the parent word type
0070      * @param typeSubtypeString the old string containing everything
0071      * @return type
0072      */
0073     KEduVocWordType* typeFromOldFormat(KEduVocWordType* parent, const QString & typeSubtypeString ) const;
0074 
0075     /**
0076      * To write old docs: convert a nice new type to the ugly old style.
0077      * @param mainType type
0078      * @param subType subtype
0079      * @return old type string
0080      */
0081     QString oldType( const QString& mainType, const QString& subType ) const;
0082 
0083 
0084     void addUserdefinedTense( const QString& tense );
0085     QString tenseFromKvtml1( const QString & oldTense );
0086     QStringList documentTenses() const;
0087     QString oldTense( const QString& tense );
0088 
0089     void setupWordTypes(KEduVocWordType* parent);
0090 
0091 private:
0092 
0093 //////////// TYPES /////////////////
0094     void initOldTypeLists();
0095 
0096     QMap<QString, QString> m_oldMainTypeNames;
0097     QMap<QString, QString> m_oldSubTypeNames;
0098     int m_userdefinedTypeCounter;
0099 
0100 ///////////TENSES/CONJUGATIONS///////
0101     void initOldTenses();
0102 
0103     QMap<QString, QString> m_oldTenses;
0104     int m_userdefinedTenseCounter;
0105     QSet<QString> m_tenses;
0106 
0107     /// # defines user defined usage/word type/tense
0108     static const QString KVTML_1_USER_DEFINED;
0109     /// : separates usages/word types
0110     static const QString KVTML_1_SEPERATOR;
0111 };
0112 
0113 #endif // KEDUVOCKVTMLCOMPABILITY_H