searchui/stateproviders/searchstateprovider/inc/settingswidget.h
changeset 2 208a4ba3894c
parent 0 ccd0fd43f247
child 3 6832643895f7
equal deleted inserted replaced
0:ccd0fd43f247 2:208a4ba3894c
    18 #define SETTINGSWIDGET_H_
    18 #define SETTINGSWIDGET_H_
    19 
    19 
    20 #include <hbwidget.h>
    20 #include <hbwidget.h>
    21 #include <qlist.h>
    21 #include <qlist.h>
    22 #include <hbgridview.h>
    22 #include <hbgridview.h>
    23 #include <Search_global.h>
    23 #include <search_global.h>
    24 class HbCheckBox;
    24 class HbCheckBox;
    25 class HbDialog;
    25 class HbDialog;
    26 class QSignalMapper;
    26 class QSignalMapper;
       
    27 class HbDocumentLoader;
       
    28 class HbDataFormModel;
       
    29 class HbDataForm;
       
    30 class HbRadioButtonList;
       
    31 class HbDataFormModelItem;
    27 
    32 
    28 SEARCH_CLASS(SearchStateProviderTest)
    33 SEARCH_CLASS(SearchStateProviderTest)
    29 
    34 
    30 class SettingsWidget : public HbWidget
    35 class SettingsWidget : public QObject
    31     {
    36     {
    32 Q_OBJECT
    37 Q_OBJECT
    33 public:
    38 public:
    34     /**
    39     /**
    35      * Construction
    40      * Construction
    50      */
    55      */
    51     bool isInternetSearchOptionSelected();
    56     bool isInternetSearchOptionSelected();
    52     /**
    57     /**
    53      * unchecking subcategories under the main category once main category unchecked
    58      * unchecking subcategories under the main category once main category unchecked
    54      */
    59      */
    55     void unCheckSubCategories(int aUnCheckSubCategory);
    60     void unCheckSubCategories();
    56     /**
    61     /**
    57      * checking subcategories under the main category once main category checked
    62      * checking subcategories under the main category once main category checked
    58      */
    63      */
    59     void checkSubCategories(int acheckSubCategory);
    64     void checkSubCategories();
    60     /**
    65     /**
    61      * storing settings to application ini file
    66      * storing settings to application ini file
    62      * 
    67      * 
    63      */
    68      */
    64     void storeSettingsToiniFile();
    69     void storeSettingsToiniFile();
    65     /**
    70     /**
    66      * Load setting from application ini file
    71      * Load setting from application ini file
    67      * 
    72      * 
    68      */
    73      */
    69     void loadSettingsFrominiFile();
    74     void loadDeviceSettings();
       
    75     
       
    76     /**
       
    77      * Load default settings for search categories to ini file
       
    78      * 
       
    79      */
       
    80 
       
    81     void loadBaseSettings();
       
    82 
    70     /**
    83     /**
    71      * make "OK" button visible 
    84      * make "OK" button visible 
    72      * 
    85      * 
    73      */
    86      */
    74     void setActionVisibility();
    87     void setActionVisibility();
    75     /**
    88     /**
    76      * enable default settings in the application ini file
    89      * enable default settings in the application ini file
    77      * 
    90      * 
    78      */
    91      */
    79     void enableDefaultSettings();
    92     void storeDefaultSettings();
       
    93     
       
    94     /**
       
    95      * setting up gui for the settings widget
       
    96      */
       
    97 
       
    98     void createGui();
       
    99     
       
   100     /**
       
   101      * Filter out categories from the sql database provided by the engine
       
   102      * for only those categories that have been successfully harvested
       
   103      */
       
   104 
       
   105     void preparecategories();
       
   106     
       
   107     
       
   108     /**
       
   109       * initilize the settings wizard while entering to the setting state
       
   110       */
       
   111 
       
   112     void initialize();
       
   113   
    80 public slots:
   114 public slots:
    81     /**
   115     /**
    82      * will be called when settings OK is clicked
   116      * will be called when settings OK is clicked
    83      */
   117      */
    84     void checkBoxOkEvent();
   118     void checkBoxOkEvent();
    89     /**
   123     /**
    90      * will be called whenn any check box is checked
   124      * will be called whenn any check box is checked
    91      */
   125      */
    92     void itemChecked(int);
   126     void itemChecked(int);
    93     /**
   127     /**
    94      * will be called when change oin internet or device selectin
   128       * slot called while clicking items added to  the combobox
    95      * 
   129       */
    96      */
   130 
    97     void changeDeviceInternetCheck();
   131     void q_currentIndexChanged(int);
    98 signals:
   132 signals:
    99     /**
   133     /**
   100      * Emitted when setting closed
   134      * Emitted when setting closed
   101      * 
   135      * 
   102      */
   136      */
   136     bool isInternetSelected;
   170     bool isInternetSelected;
   137 
   171 
   138     /**
   172     /**
   139      * list of hardcoded device categories
   173      * list of hardcoded device categories
   140      */
   174      */
   141     QStringList deviceCategoryList;
   175     QMap<QString, bool> mCategoryDbMapping;
   142 
   176 
       
   177     QStringList mDeviceListDisplay;
       
   178     /**
       
   179       * list of hardcoded device categories:cretaed to
       
   180       * set up default category values to the ini file
       
   181       */
       
   182 
       
   183     QStringList mDeviceCategoryRefList;
       
   184     /**
       
   185       * intermediate variable to store selected category values
       
   186       */
       
   187 
       
   188     QList<bool> mDeviceMapping;
   143     /**
   189     /**
   144      * list of hardcoded service providers
   190      * list of hardcoded service providers
   145      */
   191      */
   146     QStringList internetCategoryList;
   192     QStringList internetCategoryList;
   147     /**
   193     /**
   148      * for unit testing
   194      * for unit testing
   149      */
   195      */
       
   196     QStringList mCategoryList;
       
   197     /**
       
   198       * DocumentLoader variable for the setting widget
       
   199       */
       
   200 
       
   201     HbDocumentLoader* mDocumentLoader;
       
   202     
       
   203     /**
       
   204      * Dataform for the settingwidget
       
   205      */
       
   206 
       
   207     HbDataForm* dataform;
       
   208 
       
   209     /**
       
   210       * Dataform model
       
   211       */
       
   212     HbDataFormModel* mModel;
       
   213     /**
       
   214       * variable for customizing each item the in the dataform
       
   215       */
       
   216 
       
   217     QList<HbDataFormModelItem*> mModelItemList;
       
   218 
       
   219     QList<QAction*> mActions;
       
   220 
       
   221     int mSelectedScope;
       
   222 
       
   223     int mSelectedProvider;
       
   224     /**
       
   225       * Radio buttion list for internet search categories
       
   226       */
       
   227 
       
   228     HbRadioButtonList* mradiolist;
       
   229 
       
   230     bool mInstialize;
       
   231     bool mchangestate;
   150 SEARCH_FRIEND_CLASS    (SearchStateProviderTest)
   232 SEARCH_FRIEND_CLASS    (SearchStateProviderTest)
   151     };
   233     };
   152 #endif
   234 #endif