camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp
changeset 45 24fd82631616
parent 43 0e652f8f1fbd
child 52 7e18d488ac5f
equal deleted inserted replaced
43:0e652f8f1fbd 45:24fd82631616
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "cxefakesettings.h"
    18 #include "cxefakesettings.h"
    19 
    19 
       
    20 
    20 CxeFakeSettings::CxeFakeSettings()
    21 CxeFakeSettings::CxeFakeSettings()
    21 {
    22 {
    22 }
    23 }
    23 
    24 
    24 CxeFakeSettings::~CxeFakeSettings()
    25 CxeFakeSettings::~CxeFakeSettings()
    25 {
    26 {
    26 }
    27 }
    27 
    28 
    28 CxeError::Id CxeFakeSettings::get(const QString& key, int& value) const
       
    29 {
       
    30     value = mSettingKeyHash[key].toInt();
       
    31     return CxeError::None;
       
    32 }
       
    33 
    29 
    34 CxeError::Id CxeFakeSettings::get(const QString& key, QString &stringValue) const
    30 void CxeFakeSettings::get(long int uid,
    35 {
    31          unsigned long int key,
    36     stringValue = mSettingKeyHash[key].toString();
    32          Cxe::SettingKeyType type,
    37     return CxeError::None;
    33          QVariant &value) const
    38 }
       
    39 
       
    40 
       
    41 
       
    42 CxeError::Id CxeFakeSettings::get(const QString &key, qreal &value) const
       
    43 {
       
    44     value = mSettingKeyHash[key].toReal();
       
    45     return CxeError::None;
       
    46 }
       
    47 
       
    48 
       
    49 void CxeFakeSettings::get(long int uid, unsigned long int key, Cxe::SettingKeyType type, QVariant &value) const
       
    50 {
    34 {
    51     Q_UNUSED(uid);
    35     Q_UNUSED(uid);
    52     Q_UNUSED(key);
    36     Q_UNUSED(key);
    53     Q_UNUSED(type);
    37     Q_UNUSED(type);
    54     Q_UNUSED(value);
    38     Q_UNUSED(value);
    55 }
    39 }
    56 
    40 
       
    41 bool CxeFakeSettings::listenForSetting(const QString &settingKey, QObject *target, const char *slot)
       
    42 {
       
    43     Q_UNUSED(settingKey);
       
    44     Q_UNUSED(target);
       
    45     Q_UNUSED(slot);
       
    46     return true;
       
    47 }
    57 
    48 
    58 CxeError::Id CxeFakeSettings::set(const QString& key, int newValue)
    49 CxeError::Id CxeFakeSettings::getVariationValue(const QString &key, QVariant &value)
    59 {
    50 {
    60     mSettingKeyHash[key] = QVariant(newValue);
    51     int variation = mVariationKeyHash[key];
    61     emit settingValueChanged(key, newValue);
    52     value = QVariant(variation);
    62     return CxeError::None;
    53     return CxeError::None;
    63 }
    54 }
    64 
    55 
    65 CxeError::Id CxeFakeSettings::set(const QString &key, const QString &newValue)
    56 void CxeFakeSettings::getValue(const QString &key, QVariant &value) const
    66 {
    57 {
    67     mSettingKeyHash[key] = QVariant(newValue);
    58     value = mSettingKeyHash[key];
    68     emit settingValueChanged(key, newValue);
       
    69     return CxeError::None;
       
    70 }
    59 }
    71 
    60 
       
    61 void CxeFakeSettings::setValue(const QString &key, const QVariant &newValue)
       
    62 {
       
    63     mSettingKeyHash[key] = newValue;
       
    64     emit settingValueChanged(key, newValue);
       
    65 }
    72 
    66 
    73 
       
    74 CxeError::Id CxeFakeSettings::set(const QString &key, qreal newValue)
       
    75 {
       
    76     mSettingKeyHash[key] = QVariant(newValue);
       
    77     emit settingValueChanged(key, newValue);
       
    78     return CxeError::None;
       
    79 }
       
    80 
    67 
    81 
    68 
    82 void CxeFakeSettings::reset()
    69 void CxeFakeSettings::reset()
    83 {
    70 {
    84 }
    71 }