KNewStuff
ktranslatable.h
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2006, 2007 Josef Spillner <spillner@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef KTRANSLATABLE_H 00021 #define KTRANSLATABLE_H 00022 00023 #include <knewstuff2/knewstuff_export.h> 00024 00025 #include <QtCore/QString> 00026 #include <QtCore/QMap> 00027 #include <QtCore/QStringList> 00028 00029 namespace KNS 00030 { 00031 00032 class KTranslatablePrivate; 00033 00043 class KNEWSTUFF_EXPORT KTranslatable 00044 { 00045 public: 00046 typedef QMap<QString, QString> Map; 00047 typedef QMapIterator<QString, QString> Iterator; 00048 00052 KTranslatable(); 00053 00058 KTranslatable(const QString& string); 00059 00060 KTranslatable& operator=(const KTranslatable&); 00061 KTranslatable(const KTranslatable&); 00062 ~KTranslatable(); 00063 00070 void addString(const QString& lang, const QString& string); 00071 00077 QString representation() const; 00078 00085 QString translated(const QString& lang) const; 00086 00092 QStringList strings() const; 00093 00099 QStringList languages() const; 00100 00106 QString language() const; 00107 00113 QMap<QString, QString> stringmap() const; 00114 00120 bool isTranslated() const; 00121 00127 bool isEmpty() const; 00128 private: 00129 class KTranslatablePrivate* const d; 00130 00131 QMap<QString, QString> m_strings; 00132 }; 00133 00134 } 00135 00136 #endif