emailservices/nmclientapi/inc/nmapimailboxsettingsdata_p.h
changeset 54 997a02608b3a
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
       
     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 _NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_
       
    18 #define _NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_
       
    19 
       
    20 #include <QObject>
       
    21 #include <QScopedPointer>
       
    22 #include <QHash>
       
    23 
       
    24 namespace EmailClientApi
       
    25 {
       
    26 class NmApiMailboxSettingsDataPrivate
       
    27 {
       
    28 public:
       
    29     NmApiMailboxSettingsDataPrivate();
       
    30     virtual ~NmApiMailboxSettingsDataPrivate();
       
    31     void setMailboxId(quint64 mailboxId);
       
    32     quint64 mailboxId() const;
       
    33     void setValue(int key, const QVariant &settingValue);
       
    34     bool getValue(int key, QVariant &settingValue) const;
       
    35     bool validateData() const;
       
    36     QList<int> listSettings() const;
       
    37 	void clearSettings();
       
    38     
       
    39 private:
       
    40     bool validateString(int key, QVariant& val, bool& validated) const;
       
    41     bool validateStringValue(int key, QString& val) const;
       
    42     bool validateStringGeneral(int key, QString& val, bool& handled) const;
       
    43     bool validateEmailAddress(int key, QString& val, bool& handled) const;
       
    44     bool validateUsesAuthentication(int key, QString& val, bool& handled) const;
       
    45     bool validateSecurityType(int key, QString& val, bool& handled) const;
       
    46     bool validateAOLState(int key, QString& val, bool& handled) const;
       
    47     bool validateInteger(int key, QVariant& val, bool& validated) const;
       
    48     bool validateIntVal(int key, int val) const;
       
    49     bool validateIntGeneral(int key, int val, bool& handled) const;
       
    50     bool validateOnOffValue(int key, int val, bool& handled) const;
       
    51     bool validateWeekdayMask(int key, int val, bool& handled) const;
       
    52     bool validateHoursInDay(int key, int val, bool& handled) const;
       
    53     bool validateBool(int key, QVariant& val, bool& validated) const;
       
    54     bool validateDateTime(int key, QVariant& val, bool& validated) const;
       
    55 
       
    56 private:
       
    57     quint64 mId;
       
    58     QScopedPointer<QHash<int, QVariant> > mSettings;
       
    59 
       
    60 };
       
    61 }//end namespace
       
    62 
       
    63 #endif //_NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_