Updraft  1.0
Open source glider flight visualisation tool.
basicsetting.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_CORE_BASICSETTING_H_
00002 #define UPDRAFT_SRC_CORE_BASICSETTING_H_
00003 
00004 #include <QtGui>
00005 #include "settingsmanager.h"
00006 #include "settingsmodel.h"
00007 #include "../settinginterface.h"
00008 
00009 namespace Updraft {
00010 namespace Core {
00011 
00013 class BasicSetting: public QObject, public SettingInterface {
00014   Q_OBJECT
00015 
00016  public:
00017   ~BasicSetting();
00018 
00020   QVariant get();
00021 
00024   void set(const QVariant& newValue);
00025 
00028   void setDescription(const QString& newDescription);
00029 
00034   void setNeedsRestart(bool needsRestart);
00035 
00040   void callOnValueChanged(QObject* slotOwner, const char* slot);
00041 
00042   friend class SettingsManager;
00043   friend class SettingsDelegate;
00044 
00045  signals:
00047   void valueChanged();
00048 
00049  private:
00051   void emitValueChanged() {
00052     emit valueChanged();
00053   }
00054 
00060   BasicSetting(SettingsItem* settingItem, SettingsManager* mgr);
00061 
00063   void invalidate() { item = NULL; }
00064 
00066   SettingsItem* item;
00067 
00069   SettingsManager* settingsManager;
00070 };
00071 
00072 }  // End namespace Core
00073 }  // End namespace Updraft
00074 
00075 #endif  // UPDRAFT_SRC_CORE_BASICSETTING_H_
00076 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines