camerauis/cameraxui/cxui/inc/cxuisettingsinfo.h
branchRCL_3
changeset 53 61bc0f252b2b
equal deleted inserted replaced
50:f54ad444594d 53:61bc0f252b2b
       
     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 /*!
       
    22 * @file
       
    23 * @brief CxUi settings related classes and constants.
       
    24 */
       
    25 
       
    26 #include <QObject>
       
    27 #include <QMap>
       
    28 #include <QPair>
       
    29 #include <QList>
       
    30 #include <QString>
       
    31 #include <QStringList>
       
    32 #include "cxeerror.h"
       
    33 #include "cxuisettingradiobuttonlist.h"
       
    34 
       
    35 
       
    36 class CxeEngine;
       
    37 class CxuiSettingXmlReader;
       
    38 
       
    39 /*!
       
    40 * @namespace CxUiSettings
       
    41 * @brief Namespace for UI settings related constants and classes.
       
    42 */
       
    43 namespace CxUiSettings
       
    44 {
       
    45     /*! Image setting definitions. */
       
    46     static const char *IMAGE_SETTING_MAPPING_FILE = ":/xml/image_setting.xml";
       
    47     /*! Video setting definitions. */
       
    48     static const char *VIDEO_SETTING_MAPPING_FILE = ":/xml/video_setting.xml";
       
    49 
       
    50     /*!
       
    51     * Character used to separate lines within a single string.
       
    52     * E.g. SettingItem::mItem can be split with this character to get multi-line item.
       
    53     */
       
    54     static const char NEW_LINE_CHAR = '\n';
       
    55 
       
    56     struct SettingItem
       
    57     {
       
    58         QString mItem;
       
    59         QVariant mValue;
       
    60         QString mIcon;
       
    61     };
       
    62 
       
    63     /*!
       
    64     * Class that holds all the data required for radiobutton list
       
    65     */
       
    66     class RadioButtonListParams
       
    67     {
       
    68     public:
       
    69         RadioButtonListParams& operator=(const RadioButtonListParams& other);
       
    70 
       
    71     public:
       
    72         QString mHeading;
       
    73         QString mSettingId;
       
    74         QString mHeadingIcon;
       
    75         QList<SettingItem> mSettingPairList;
       
    76         bool mPreview;
       
    77         CxuiSettingRadioButtonList::ListBoxType mListboxType;
       
    78     };
       
    79 
       
    80 
       
    81     /*!
       
    82     * Class that holds all the data required for slider
       
    83     */
       
    84     class SliderParams
       
    85     {
       
    86     public:
       
    87         SliderParams& operator=(const SliderParams& other);
       
    88 
       
    89     public:
       
    90         QString mHeading;
       
    91         QString mSettingId;
       
    92         QString mHeadingIcon;
       
    93         QStringList mSettingStrings;
       
    94         QPair<int, int> mRange;
       
    95         qreal mMinorStep;
       
    96         qreal mMajorStep;
       
    97     };
       
    98 }
       
    99 
       
   100 /**
       
   101  * Model Class that handles all HbDialog settings content widget info
       
   102  */
       
   103 class CxuiSettingsInfo : public QObject
       
   104 {
       
   105     Q_OBJECT
       
   106 public:
       
   107    CxuiSettingsInfo(CxeEngine *engine);
       
   108    ~CxuiSettingsInfo();
       
   109    bool getSettingsContent(const QString &key, CxUiSettings::RadioButtonListParams &p);
       
   110    bool getSettingsContent(const QString &key, CxUiSettings::SliderParams &p);
       
   111 
       
   112 private:
       
   113     void getImageQualitySettings(CxUiSettings::RadioButtonListParams &settings);
       
   114     void getVideoQualitySettings(CxUiSettings::RadioButtonListParams &settings);
       
   115     void handleQualitySettings(const QString &key, CxUiSettings::RadioButtonListParams &settings);
       
   116 
       
   117 private:
       
   118     void checkMode();
       
   119 
       
   120 private: // data members
       
   121     int mMode;
       
   122     CxeEngine *mEngine;
       
   123     CxuiSettingXmlReader *mXmlReader;
       
   124 };
       
   125 
       
   126 
       
   127 #endif // CXUISETTINGSINFO_H