summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/translator/translatorlanguages.h
blob: 986e5c3766dc373175a99eded75cdc3af83fd5e7 (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
93
94
/*
    translatorlanguages.h

    Kopete Translatorfish Translator plugin

    Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett       <duncan@kde.org>
    Copyright (c) 2002-2003 by Olivier Goffart      <ogoffart @ kde.org>
    Copyright (c) 2003 by Matt Rogers                <matt@matt.rogers.name>

    Kopete    (c) 2002-2003 by the Kopete developers  <kopete-devel@kde.org>

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

#include <tqmap.h>
#include <tqstringlist.h>

class TQString;


class TranslatorLanguages
{
public:
	TranslatorLanguages();

	/***************************************************************************
	 *   Language APIs                                                         *
	 ***************************************************************************/

	const TQString& languageName( const TQString &key )
	{ return m_langs[key]; };

	const int languageIndex	( const TQString &key )
	{ return m_langKeyIntMap[key]; };

	const TQString& languageKey( const int index )
	{ return  m_langIntKeyMap[index]; };

	const TQMap<TQString,TQString>& languagesMap()
	{ return m_langs; };

	const TQMap<TQString,TQString>& servicesMap()
	{ return m_services; };

	const TQStringList& supported( const TQString &servicekey )
	{ return m_supported[servicekey]; };

	const int serviceIndex	( const TQString &key )
	{ return m_servicesKeyIntMap[key]; };

	const TQString& serviceKey( const int index )
	{ return  m_servicesIntKeyMap[index]; };

	int numLanguages()	{ return m_lc; };

	int numServices()	{ return m_sc; };

private:

	/* Known Languages key -> desc ie: en -> English */
	TQMap< TQString, TQString> m_langs;

	/* Known Services key -> desc ie: en -> English */
	TQMap< TQString, TQString> m_services;

	/* Supported translations per service, src_dst format ( ie: en_es )*/
	TQMap< TQString, TQStringList > m_supported;

	/* int to lang key and viceversa*/
	TQMap<int, TQString> m_langIntKeyMap;
	TQMap<TQString, int> m_langKeyIntMap;

	/* int to services key and viceversa*/
	TQMap<int, TQString> m_servicesIntKeyMap;
	TQMap<TQString, int> m_servicesKeyIntMap;

	/* Lang counter */
	int m_lc;
	/* Service counter */
	int m_sc;

};

#endif