camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingscenrepstore/xqsettingsmanager.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 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 XQSETTINGSMANAGER_H
       
    18 #define XQSETTINGSMANAGER_H
       
    19 
       
    20 // INCLUDES
       
    21 #include <QObject>
       
    22 #include <QVariant>
       
    23 #include "xqsettingskey.h"
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class XQSettingsManager : public QObject
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34 
       
    35     enum Type
       
    36     {
       
    37         TypeVariant = 0,
       
    38         TypeInt,
       
    39         TypeDouble,
       
    40         TypeString,
       
    41         TypeByteArray
       
    42     };
       
    43 
       
    44     enum Error 
       
    45     {
       
    46         NoError = 0,
       
    47         OutOfMemoryError,
       
    48         NotFoundError,
       
    49         AlreadyExistsError,
       
    50         PermissionDeniedError,
       
    51         BadTypeError,
       
    52         NotSupportedError,
       
    53         UnknownError = -1
       
    54     };
       
    55 
       
    56     XQSettingsManager(QObject* parent = 0);
       
    57     ~XQSettingsManager();
       
    58 
       
    59     QVariant readItemValue(const XQSettingsKey& key, XQSettingsManager::Type type = XQSettingsManager::TypeVariant);
       
    60     bool writeItemValue(const XQSettingsKey& key, const QVariant& value);
       
    61     XQSettingsManager::Error error() const;
       
    62     bool startMonitoring(const XQSettingsKey& key, XQSettingsManager::Type type = XQSettingsManager::TypeVariant);
       
    63 
       
    64 
       
    65 signals:
       
    66     void valueChanged(const XQSettingsKey& key, const QVariant& value);
       
    67 
       
    68 private:
       
    69     XQSettingsManager::Error mError;
       
    70     QHash<unsigned long int, QVariant> mStore;
       
    71 
       
    72 };
       
    73 
       
    74 #endif // XQSETTINGSMANAGER_H
       
    75 
       
    76 // End of file