camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 53 61bc0f252b2b
child 57 2c87b2808fd7
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifndef CXEFAKESETTINGS_H
       
    18 #define CXEFAKESETTINGS_H
       
    19 
       
    20 #include "cxesettings.h"
       
    21 #include "cxeerror.h"
       
    22 
       
    23 class CxeFakeSettings : public CxeSettings
       
    24 {
       
    25 
       
    26     Q_OBJECT
       
    27 
       
    28     public:
       
    29         CxeFakeSettings();
       
    30         ~CxeFakeSettings();
       
    31 
       
    32     public: // from CxeSettings
       
    33 
       
    34         void get(long int uid,
       
    35                  unsigned long int key,
       
    36                  Cxe::SettingKeyType type,
       
    37                  QVariant &value) const;
       
    38         void reset();
       
    39         CxeError::Id getVariationValue(const QString &key, QVariant &value);
       
    40         bool listenForSetting(const QString &settingKey, QObject *target, const char *slot);
       
    41 
       
    42     protected:
       
    43         void getValue(const QString &key, QVariant &value) const;
       
    44         void setValue(const QString &key, const QVariant &newValue);
       
    45 
       
    46     public: // methods for unit testing
       
    47         void emulate(long int uid, unsigned long int key, QVariant value);
       
    48         
       
    49     private:
       
    50         QHash<QString, QVariantList> loadVariationSettings();
       
    51 
       
    52     private: // data
       
    53         QHash<QString, QVariant> mSettingKeyHash;
       
    54         QHash<QString, unsigned long int> mVariationKeyHash;
       
    55         QHash<QString, QVariantList> mVariationSettings;
       
    56 
       
    57     private:
       
    58         Q_DISABLE_COPY(CxeFakeSettings)
       
    59 };
       
    60 
       
    61 #endif /*CXEFAKESETTINGS_H*/
       
    62 
       
    63 // end  of file