LibKEduVocDocument

keduvockvtmlcompability.h
Go to the documentation of this file.
1/*
2 * C++ Interface: keduvockvtml1compability_p
3 * SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KEDUVOCKVTMLCOMPABILITY_H
7#define KEDUVOCKVTMLCOMPABILITY_H
8
9#include <QMap>
10#include <QSet>
11#include <QString>
12
13// internal types, indented are subtypes
14
15#define QM_VERB "v" // go
16// #define QM_VERB_IRR "ir"
17// #define QM_VERB_REG "re"
18#define QM_NOUN "n" // table, coffee
19// #define QM_NOUN_F "f"
20// #define QM_NOUN_M "m"
21// #define QM_NOUN_S "s"
22#define QM_NAME "nm"
23// #define QM_ART "ar" // article
24// #define QM_ART_DEF "def" // definite a/an
25// #define QM_ART_IND "ind" // indefinite the
26#define QM_ADJ "aj" // adjective expensive, good
27// #define QM_ADV "av" // adverb today, strongly
28// #define QM_PRON "pr" // pronoun you, she
29// #define QM_PRON_POS "pos" // possessive my, your
30// #define QM_PRON_PER "per" // personal
31// #define QM_PHRASE "ph"
32// #define QM_NUM "num" // numeral
33// #define QM_NUM_ORD "ord" // ordinal first, second
34// #define QM_NUM_CARD "crd" // cardinal one, two
35// #define QM_INFORMAL "ifm"
36// #define QM_FIG "fig"
37// #define QM_CON "con" // conjunction and, but
38// #define QM_PREP "pre" // preposition behind, between
39// #define QM_QUEST "qu" // question who, what
40
41// type delimiters
42
43#define QM_USER_TYPE "#" // designates number of user type
44#define QM_TYPE_DIV ":" // divide main from subtype
45
46// usage delimiters (also declared in UsageManager.h)
47
48#define UL_USER_USAGE "#" // designates number of user type
49
50class KEduVocWordType;
51
52/**
53 * @file keduvockvtmlcompability.h
54 * contains defines and constants necessary for reading kvtml files prior to KDE4. kvtml version 1.
55 */
56class KEduVocKvtmlCompability
57{
58public:
59 /**
60 * Constructor, initialize the map.
61 */
62 KEduVocKvtmlCompability();
63
64 ///// TYPES
65 /**
66 * Get the type from an old type definition
67 * @param parent the parent word type
68 * @param typeSubtypeString the old string containing everything
69 * @return type
70 */
71 KEduVocWordType *typeFromOldFormat(KEduVocWordType *parent, const QString &typeSubtypeString) const;
72
73 /**
74 * To write old docs: convert a nice new type to the ugly old style.
75 * @param mainType type
76 * @param subType subtype
77 * @return old type string
78 */
79 QString oldType(const QString &mainType, const QString &subType) const;
80
81 void addUserdefinedTense(const QString &tense);
82 QString tenseFromKvtml1(const QString &oldTense);
83 QStringList documentTenses() const;
84 QString oldTense(const QString &tense);
85
86 void setupWordTypes(KEduVocWordType *parent);
87
88private:
89 //////////// TYPES /////////////////
90 void initOldTypeLists();
91
92 QMap<QString, QString> m_oldMainTypeNames;
93 QMap<QString, QString> m_oldSubTypeNames;
94 int m_userdefinedTypeCounter;
95
96 ///////////TENSES/CONJUGATIONS///////
97 void initOldTenses();
98
99 QMap<QString, QString> m_oldTenses;
100 int m_userdefinedTenseCounter;
101 QSet<QString> m_tenses;
102
103 /// # defines user defined usage/word type/tense
104 static const QString KVTML_1_USER_DEFINED;
105 /// : separates usages/word types
106 static const QString KVTML_1_SEPERATOR;
107};
108
109#endif // KEDUVOCKVTMLCOMPABILITY_H
class to store translation word types
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.