searchui/stateproviders/searchstateprovider/inc/settingswidget.h
changeset 0 ccd0fd43f247
child 2 208a4ba3894c
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     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:  Declaration of the settings widget
       
    15  *
       
    16  */
       
    17 #ifndef SETTINGSWIDGET_H_
       
    18 #define SETTINGSWIDGET_H_
       
    19 
       
    20 #include <hbwidget.h>
       
    21 #include <qlist.h>
       
    22 #include <hbgridview.h>
       
    23 #include <Search_global.h>
       
    24 class HbCheckBox;
       
    25 class HbDialog;
       
    26 class QSignalMapper;
       
    27 
       
    28 SEARCH_CLASS(SearchStateProviderTest)
       
    29 
       
    30 class SettingsWidget : public HbWidget
       
    31     {
       
    32 Q_OBJECT
       
    33 public:
       
    34     /**
       
    35      * Construction
       
    36      */
       
    37     SettingsWidget();
       
    38     /**
       
    39      * destructor
       
    40      */
       
    41     ~SettingsWidget();
       
    42 public:
       
    43     /**
       
    44      * Launching the settings widget
       
    45      */
       
    46     void launchSettingWidget();
       
    47     /**
       
    48      * Verifies internet selection
       
    49      * 
       
    50      */
       
    51     bool isInternetSearchOptionSelected();
       
    52     /**
       
    53      * unchecking subcategories under the main category once main category unchecked
       
    54      */
       
    55     void unCheckSubCategories(int aUnCheckSubCategory);
       
    56     /**
       
    57      * checking subcategories under the main category once main category checked
       
    58      */
       
    59     void checkSubCategories(int acheckSubCategory);
       
    60     /**
       
    61      * storing settings to application ini file
       
    62      * 
       
    63      */
       
    64     void storeSettingsToiniFile();
       
    65     /**
       
    66      * Load setting from application ini file
       
    67      * 
       
    68      */
       
    69     void loadSettingsFrominiFile();
       
    70     /**
       
    71      * make "OK" button visible 
       
    72      * 
       
    73      */
       
    74     void setActionVisibility();
       
    75     /**
       
    76      * enable default settings in the application ini file
       
    77      * 
       
    78      */
       
    79     void enableDefaultSettings();
       
    80 public slots:
       
    81     /**
       
    82      * will be called when settings OK is clicked
       
    83      */
       
    84     void checkBoxOkEvent();
       
    85     /**
       
    86      * will be called when setting cancel is called
       
    87      */
       
    88     void checkBoxCancelEvent();
       
    89     /**
       
    90      * will be called whenn any check box is checked
       
    91      */
       
    92     void itemChecked(int);
       
    93     /**
       
    94      * will be called when change oin internet or device selectin
       
    95      * 
       
    96      */
       
    97     void changeDeviceInternetCheck();
       
    98 signals:
       
    99     /**
       
   100      * Emitted when setting closed
       
   101      * 
       
   102      */
       
   103     void settingsEvent(bool);
       
   104     /**
       
   105      * Emitted if settings changed for "go" button
       
   106      * 
       
   107      */
       
   108     void settingsChanged();
       
   109     /**
       
   110      * Emitted when categories selected or deselected
       
   111      * 
       
   112      */
       
   113     void selectedItemCategory(int, bool);
       
   114 
       
   115 private:
       
   116     /**
       
   117      * for Device category list
       
   118      */
       
   119     QList<HbCheckBox*> mDeviceCheckBoxList;
       
   120     /**
       
   121      * for Internet category list
       
   122      */
       
   123     QList<HbCheckBox*> mInternetCheckBoxList;
       
   124     /**
       
   125      * mapper to map checkboxes
       
   126      * 
       
   127      */
       
   128     QSignalMapper* signalMapper;
       
   129     /**
       
   130      * settings widget popup
       
   131      */
       
   132     HbDialog *popup;
       
   133     /**
       
   134      * to indicate internet is selected or not
       
   135      */
       
   136     bool isInternetSelected;
       
   137 
       
   138     /**
       
   139      * list of hardcoded device categories
       
   140      */
       
   141     QStringList deviceCategoryList;
       
   142 
       
   143     /**
       
   144      * list of hardcoded service providers
       
   145      */
       
   146     QStringList internetCategoryList;
       
   147     /**
       
   148      * for unit testing
       
   149      */
       
   150 SEARCH_FRIEND_CLASS    (SearchStateProviderTest)
       
   151     };
       
   152 #endif