qtmobileextensions/src/settingsmanager/xqcentralrepositoryutils.h
branchRCL_3
changeset 9 5d007b20cfd0
equal deleted inserted replaced
8:885c2596c964 9:5d007b20cfd0
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
       
    19 *
       
    20 */
       
    21 
       
    22 #ifndef XQCENTRALREPOSITORYUTILS_H
       
    23 #define XQCENTRALREPOSITORYUTILS_H
       
    24 
       
    25 #include <QObject>
       
    26 #include "xqsettingskey.h"
       
    27 #include "settingsmanager_global.h"
       
    28 
       
    29 class XQSettingsManager;
       
    30 class XQCentralRepositoryUtilsPrivate;
       
    31 class XQCentralRepositorySearchCriteria;
       
    32 
       
    33 class XQSETTINGSMANAGER_EXPORT XQCentralRepositoryUtils : public QObject
       
    34 {
       
    35 public:
       
    36 
       
    37     enum TransactionMode
       
    38     {
       
    39         ConcurrentReadWriteTransaction,
       
    40         ReadTransaction,
       
    41         ReadWriteTransaction
       
    42     };
       
    43 
       
    44     enum TransactionState
       
    45     {
       
    46         NotInTransaction,
       
    47         ActiveTransaction,
       
    48         FailedTransaction,
       
    49         UnknownTransaction
       
    50     };
       
    51     
       
    52     XQCentralRepositoryUtils(XQSettingsManager& settingsManager, QObject* parent = 0);
       
    53     ~XQCentralRepositoryUtils();
       
    54     bool createKey(const XQCentralRepositorySettingsKey& key, const QVariant& value);
       
    55     bool deleteKey(const XQCentralRepositorySettingsKey& key);
       
    56     bool resetKey(const XQCentralRepositorySettingsKey& key);
       
    57     bool resetRepository(long int repositoryUid);
       
    58     QList<XQCentralRepositorySettingsKey> findKeys(const XQCentralRepositorySearchCriteria& criteria);
       
    59 
       
    60     bool startTransaction(long int repositoryUid, TransactionMode transactionMode);
       
    61     bool commitTransaction(long int repositoryUid);
       
    62     void cancelTransaction(long int repositoryUid);
       
    63     void failTransaction(long int repositoryUid);
       
    64     TransactionState transactionState(long int repositoryUid) const;
       
    65 
       
    66 private:
       
    67     XQCentralRepositoryUtilsPrivate* d;
       
    68 };
       
    69 
       
    70 #endif //XQCENTRALREPOSITORYUTILS_H