summaryrefslogtreecommitdiffstats
path: root/kvoctrain/kvoctrain/kvt-core/langset.h
blob: cfcc7f3b13d53595004ba62bff95659bdc79ec5c (plain)
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
/***************************************************************************

                     properties for a language

    -----------------------------------------------------------------------

    begin                : Thu Mar 11 20:50:53 MET 1999

    copyright            : (C) 1999-2001 Ewald Arnold
                           (C) 2001 The KDE-EDU team

    email                : kvoctrain@ewald-arnold.de

    -----------------------------------------------------------------------

 ***************************************************************************

 ***************************************************************************
 *                                                                         *
 *   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 langset_h
#define langset_h

#include <vector>
using namespace std;

#include <tqstring.h>


class LangSet
{
 public:

   LangSet () {}

   void addSet (TQString shortId, TQString longId, TQString PixMapFile,
		const TQString& shortId2 = TQString(),
		const TQString& keyboardLayout = TQString());

/*    void addSet (TQString shortId, TQString shortId2, TQString longId, */
/* 		TQString PixMapFile,  */
/* 		const TQString& keyboardLayout = TQString()); */

   void appendSet(const LangSet &set);

   unsigned int size () const { return langs.size(); }
   void erase (int idx);
   void clear ();

   TQString shortId (int index) const;
   TQString shortId2 (int index) const;
   TQString longId (int index) const;
   TQString PixMapFile (int index) const;
   TQString keyboardLayout (int index) const;

   int indexShortId (TQString shortId) const;
   int indexLongId (TQString longId) const;
   int indexPixMapFile (TQString PixMapFile) const;
   // doesn't make sense for keyboard layouts since there is no 1-to-1 relation to languages

   void setShortId (const TQString & shortId, int index);
   void setShortId2 (const TQString & shortId2, int index);
   void setLongId (const TQString & longId, int index);
   void setPixMapFile (const TQString & PixMapFile, int index);
   void setKeyboardLayout(const TQString & tqlayout, int index);

   TQString findShortId (const TQString & longId)  const;
   TQString findLongId  (const TQString & shortId) const;

 private:

   struct LangDef {
     TQString shortId,
             shortId2,
             longId,
       PixMapFile,
       keyboardLayout;
   };

   vector<LangDef> langs;
};


#endif // langset_h