diff -r 0e652f8f1fbd -r 24fd82631616 camerauis/cameraxui/cxengine/inc/cxesettingsimp.h --- a/camerauis/cameraxui/cxengine/inc/cxesettingsimp.h Thu Jul 15 01:55:05 2010 +0300 +++ b/camerauis/cameraxui/cxengine/inc/cxesettingsimp.h Fri Jul 23 11:35:41 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,13 +17,17 @@ #ifndef CXESETTINGSIMP_H #define CXESETTINGSIMP_H +#include #include "cxesettings.h" #include "cxeerror.h" +#include "cxescenemodestore.h" + +// forward declaration +class CxeSettingsStore; -// forward declaration -class CxeSettingsModel; - +typedef QPair CxeSettingListener; +typedef QList CxeSettingListenerList; /* * Class to access all kind of Settings @@ -34,28 +38,45 @@ public: - CxeSettingsImp(CxeSettingsModel &settingsModel); + CxeSettingsImp(CxeSettingsStore *settingStore); virtual ~CxeSettingsImp(); - CxeError::Id get(const QString &key, int &value) const; - CxeError::Id get(const QString &key, QString &stringValue) const; - CxeError::Id get(const QString &key, qreal &value) const; void get(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) const; - CxeError::Id set(const QString &key, int newValue); - CxeError::Id set(const QString &key,const QString &newValue); - CxeError::Id set(const QString &key, qreal newValue); void reset(); + CxeError::Id getVariationValue(const QString &key, QVariant &value); + bool listenForSetting(const QString &settingKey, QObject *target, const char *slot); public slots: void loadSettings(Cxe::CameraMode mode); +protected: + void getValue(const QString &key, QVariant &value) const; + void setValue(const QString &key, const QVariant &newValue); + private: // helper methods - CxeError::Id getSceneMode(const QString &key, QString &stringValue) const; - CxeError::Id setSceneMode(const QString &key, const QString &stringValue); + + void restoreImageSettings(); + void restoreVideoSettings(); + + void setImageScene(const QString &newScene); + void setVideoScene(const QString &newScene); + + void loadVariationSettings(); + + void notifyListeners(const QString &settingKey, const QVariant &newValue); + +private slots: + void handleListenerDestroyed(QObject *object); private: - CxeSettingsModel &mSettingsModel; // not owned + + CxeSettingsStore *mSettingStore; + QHash mVariationSettings; + CxeSceneModeStore mSceneModeStore; + Cxe::CameraMode mCameraMode; + + QMap mSettingListeners; }; #endif // CXESETTINGSIMP_H