SpeedCrunch
0.11
|
00001 // This file is part of the SpeedCrunch project 00002 // Copyright (C) 2007 Ariya Hidayat <ariya@kde.org> 00003 // Copyright (C) 2008-2009 Helder Correia <helder.pereira.correia@gmail.com> 00004 // Copyright (C) 2009 Andreas Scherer <andreas_coder@freenet.de> 00005 // 00006 // This program is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU General Public License 00008 // as published by the Free Software Foundation; either version 2 00009 // of the License, or (at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this program; see the file COPYING. If not, write to 00018 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 // Boston, MA 02110-1301, USA. 00020 00021 #ifndef CORE_CONSTANTS_H 00022 #define CORE_CONSTANTS_H 00023 00024 #include <QObject> 00025 #include <QStringList> 00026 00027 #include <memory> 00028 00029 struct Constant { 00030 QString category; 00031 QString name; 00032 QString unit; 00033 QString value; 00034 }; 00035 00036 class constant_name_is 00037 { 00038 QString m_name; 00039 public: 00040 explicit constant_name_is(const QString&); 00041 bool operator()(const Constant&) const; 00042 }; 00043 00044 class Constants : public QObject { 00045 Q_OBJECT 00046 00047 public: 00048 static Constants* instance(); 00049 ~Constants(); 00050 00051 const QStringList& categories() const; 00052 const QList<Constant>& list() const; 00053 00054 public slots: 00055 void retranslateText(); 00056 00057 private: 00058 struct Private; 00059 const std::auto_ptr<Private> d; 00060 00061 Constants(); 00062 Constants(const Constants&); 00063 Constants& operator=(const Constants&); 00064 }; 00065 00066 #endif