diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/translator/translatorlanguages.h | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/translator/translatorlanguages.h')
-rw-r--r-- | kopete/plugins/translator/translatorlanguages.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/kopete/plugins/translator/translatorlanguages.h b/kopete/plugins/translator/translatorlanguages.h new file mode 100644 index 00000000..cbd6385f --- /dev/null +++ b/kopete/plugins/translator/translatorlanguages.h @@ -0,0 +1,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 <qmap.h> +#include <qstringlist.h> + +class QString; + + +class TranslatorLanguages +{ +public: + TranslatorLanguages(); + + /*************************************************************************** + * Language APIs * + ***************************************************************************/ + + const QString& languageName( const QString &key ) + { return m_langs[key]; }; + + const int languageIndex ( const QString &key ) + { return m_langKeyIntMap[key]; }; + + const QString& languageKey( const int index ) + { return m_langIntKeyMap[index]; }; + + const QMap<QString,QString>& languagesMap() + { return m_langs; }; + + const QMap<QString,QString>& servicesMap() + { return m_services; }; + + const QStringList& supported( const QString &servicekey ) + { return m_supported[servicekey]; }; + + const int serviceIndex ( const QString &key ) + { return m_servicesKeyIntMap[key]; }; + + const QString& 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 */ + QMap< QString, QString> m_langs; + + /* Known Services key -> desc ie: en -> English */ + QMap< QString, QString> m_services; + + /* Supported translations per service, src_dst format ( ie: en_es )*/ + QMap< QString, QStringList > m_supported; + + /* int to lang key and viceversa*/ + QMap<int, QString> m_langIntKeyMap; + QMap<QString, int> m_langKeyIntMap; + + /* int to services key and viceversa*/ + QMap<int, QString> m_servicesIntKeyMap; + QMap<QString, int> m_servicesKeyIntMap; + + /* Lang counter */ + int m_lc; + /* Service counter */ + int m_sc; + +}; + +#endif |