libkdeedu/keduvocdocument
keduvockvtmlcompability.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 00003 C++ Interface: keduvockvtml1compability_p 00004 00005 ----------------------------------------------------------------------- 00006 00007 begin : Di Aug 28 2007 00008 00009 copyright : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 00010 00011 ----------------------------------------------------------------------- 00012 00013 ***************************************************************************/ 00014 00015 /*************************************************************************** 00016 * * 00017 * This program is free software; you can redistribute it and/or modify * 00018 * it under the terms of the GNU General Public License as published by * 00019 * the Free Software Foundation; either version 2 of the License, or * 00020 * (at your option) any later version. * 00021 * * 00022 ***************************************************************************/ 00023 00024 #ifndef KEDUVOCKVTMLCOMPABILITY_H 00025 #define KEDUVOCKVTMLCOMPABILITY_H 00026 00027 #include <KDE/KLocalizedString> 00028 #include <QtCore/QString> 00029 #include <QtCore/QMap> 00030 #include <QtCore/QSet> 00031 00032 00033 // internal types, indented are subtypes 00034 00035 #define QM_VERB "v" // go 00036 // #define QM_VERB_IRR "ir" 00037 // #define QM_VERB_REG "re" 00038 #define QM_NOUN "n" // table, coffee 00039 // #define QM_NOUN_F "f" 00040 // #define QM_NOUN_M "m" 00041 // #define QM_NOUN_S "s" 00042 #define QM_NAME "nm" 00043 // #define QM_ART "ar" // article 00044 // #define QM_ART_DEF "def" // definite a/an 00045 // #define QM_ART_IND "ind" // indefinite the 00046 #define QM_ADJ "aj" // adjective expensive, good 00047 // #define QM_ADV "av" // adverb today, strongly 00048 // #define QM_PRON "pr" // pronoun you, she 00049 // #define QM_PRON_POS "pos" // possessive my, your 00050 // #define QM_PRON_PER "per" // personal 00051 // #define QM_PHRASE "ph" 00052 // #define QM_NUM "num" // numeral 00053 // #define QM_NUM_ORD "ord" // ordinal first, second 00054 // #define QM_NUM_CARD "crd" // cardinal one, two 00055 // #define QM_INFORMAL "ifm" 00056 // #define QM_FIG "fig" 00057 // #define QM_CON "con" // conjuncton and, but 00058 // #define QM_PREP "pre" // preposition behind, between 00059 // #define QM_QUEST "qu" // question who, what 00060 00061 // type delimiters 00062 00063 #define QM_USER_TYPE "#" // designates number of user type 00064 #define QM_TYPE_DIV ":" // divide main from subtype 00065 00066 // usage delimiters (also declared in UsageManager.h) 00067 00068 #define UL_USER_USAGE "#" // designates number of user type 00069 00070 00074 class KEduVocKvtmlCompability 00075 { 00076 00077 public: 00081 KEduVocKvtmlCompability(); 00082 00089 void addUserdefinedUsage( const QString& usage ); 00090 00098 QSet<QString> usageFromKvtml1( const QString& oldUsage ) const; 00099 00104 QSet<QString> documentUsages() const; 00105 00107 00112 QString mainTypeFromOldFormat( const QString& typeSubtypeString ) const; 00113 00119 QString subTypeFromOldFormat( const QString& typeSubtypeString ) const; 00120 00127 QString oldType( const QString& mainType, const QString& subType ) const; 00128 00129 00130 void addUserdefinedTense( const QString& tense ); 00131 QString tenseFromKvtml1( const QString & oldTense ); 00132 QStringList documentTenses() const; 00133 QString oldTense( const QString& tense ); 00134 00135 private: 00141 static QMap< QString, QString > usageMap(); 00142 00144 QMap< QString, QString > m_usages; 00145 00146 00148 int m_userdefinedUsageCounter; 00149 00150 00152 void initOldTypeLists(); 00153 00154 QMap<QString, QString> m_oldMainTypeNames; 00155 QMap<QString, QString> m_oldSubTypeNames; 00156 00158 void initOldTenses(); 00159 00160 QMap<QString, QString> m_oldTenses; 00161 int m_userdefinedTenseCounter; 00162 QSet<QString> m_tenses; 00163 00165 static const QString KVTML_1_USER_DEFINED; 00167 static const QString KVTML_1_SEPERATOR; 00168 }; 00169 00170 #endif // KEDUVOCKVTMLCOMPABILITY_H
KDE 4.0 API Reference