camerauis/cameraxui/cxui/inc/cxuisettingsinfo.h
changeset 19 d9aefe59d544
child 21 fa6d9f75d6a6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
       
     1 /*
       
     2 * Copyright (c) 2009 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 
       
    18 #ifndef CXUISETTINGSINFO_H
       
    19 #define CXUISETTINGSINFO_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QMap>
       
    23 #include <QPair>
       
    24 #include <QList>
       
    25 #include <QString>
       
    26 #include <QStringList>
       
    27 #include "cxeerror.h"
       
    28 #include "cxuisettingradiobuttonlist.h"
       
    29 
       
    30 
       
    31 class CxeEngine;
       
    32 class CxuiSettingXmlReader;
       
    33 
       
    34 namespace CxUiSettings
       
    35 {
       
    36     // Setting mappings
       
    37     static const char *IMAGE_SETTING_MAPPING_FILE = ":/xml/image_setting.xml";
       
    38     static const char *VIDEO_SETTING_MAPPING_FILE = ":/xml/video_setting.xml";
       
    39 
       
    40     struct SettingItem
       
    41     {
       
    42         QString mItem;
       
    43         QVariant mValue;
       
    44         QString mIcon;
       
    45     };
       
    46 
       
    47     /*!
       
    48     * Class that holds all the data required for radiobutton list
       
    49     */
       
    50     class RadioButtonListParams
       
    51     {
       
    52     public:
       
    53         RadioButtonListParams& operator=(const RadioButtonListParams& other);
       
    54 
       
    55     public:
       
    56         QString mHeading;
       
    57         QString mSettingId;
       
    58         QString mHeadingIcon;
       
    59         QList<SettingItem> mSettingPairList;
       
    60         bool mPreview;
       
    61         CxuiSettingRadioButtonList::ListBoxType mListboxType;
       
    62     };
       
    63 
       
    64 
       
    65     /*!
       
    66     * Class that holds all the data required for slider
       
    67     */
       
    68     class SliderParams
       
    69     {
       
    70     public:
       
    71         SliderParams& operator=(const SliderParams& other);
       
    72 
       
    73     public:
       
    74         QString mHeading;
       
    75         QString mSettingId;
       
    76         QString mHeadingIcon;
       
    77         QStringList mSettingStrings;
       
    78         QPair<int, int> mRange;
       
    79         qreal mStep;
       
    80     };
       
    81 }
       
    82 
       
    83 /**
       
    84  * Model Class that handles all HbDialog settings content widget info
       
    85  */
       
    86 class CxuiSettingsInfo : public QObject
       
    87 {
       
    88     Q_OBJECT
       
    89 public:
       
    90    CxuiSettingsInfo(CxeEngine *engine);
       
    91    ~CxuiSettingsInfo();
       
    92    bool getSettingsContent(const QString &key, CxUiSettings::RadioButtonListParams &p);
       
    93    bool getSettingsContent(const QString &key, CxUiSettings::SliderParams &p);
       
    94 
       
    95 private:
       
    96     void getImageQualitySettings(CxUiSettings::RadioButtonListParams &settings);
       
    97     void getVideoQualitySettings(CxUiSettings::RadioButtonListParams &settings);
       
    98     void handleQualitySettings(const QString &key, CxUiSettings::RadioButtonListParams &settings);
       
    99 
       
   100 private slots:
       
   101     void initForCurrentMode(CxeError::Id status);
       
   102 
       
   103 private: // data members
       
   104     CxeEngine *mEngine;
       
   105     CxuiSettingXmlReader *mXmlReader;
       
   106 };
       
   107 
       
   108 
       
   109 #endif // CXUISETTINGSINFO_H