Fixed Nabi issues N_SE-49016, N_SE-48879, N_SE-48597, N_SE-48815, N_SE-48813, N_SE...
[apps/osp/Internet.git] / inc / IntSettingForm.h
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 //!Internet SettingForm class
19 /*@file:        IntSettingForm.h
20  *@brief:       The %IntSettingForm defines settings.
21  *
22  */
23
24 #ifndef _INT_SETTING_FORM_H_
25 #define _INT_SETTING_FORM_H_
26
27 #include <FBase.h>
28 #include <FUi.h>
29
30 #include "IntMultipleWindowPresentationModel.h"
31 #include "IntConfirmationPopup.h"
32 #include "IntNotificationPanel.h"
33
34 class SettingForm
35         : public Tizen::Ui::Controls::Form
36         , public Tizen::Ui::Controls::IFormBackEventListener
37         , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
38         , public Tizen::Ui::Controls::IGroupedListViewItemProvider
39         , public Tizen::Ui::IActionEventListener
40         , public Tizen::Ui::IOrientationEventListener
41         , public Tizen::Ui::Scenes::ISceneEventListener
42 {
43 public:
44         /**
45          * @brief               The Default Constructor
46          */
47         SettingForm(void);
48
49         /**
50          * @brief               The Default Destructor
51          */
52         virtual ~SettingForm(void);
53
54         /**
55          * @brief               Initializes this SettingForm Form.
56          */
57         bool Initialize(void);
58
59         /**
60          * @brief               Initializes the controls of the UI for SettingForm.
61          */
62         result OnInitializing(void);
63
64         //IActionEventListener
65         void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
66
67         //IGroupedListViewItemProvider
68         Tizen::Ui::Controls::GroupItem* CreateGroupItem(int groupIndex, int itemWidth);
69
70         Tizen::Ui::Controls::ListItemBase* CreateItem(int groupIndex, int itemIndex, int itemWidth);
71
72         bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::GroupItem* pItem, int itemWidth);
73
74         bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
75
76         int GetGroupCount(void);
77
78         int GetItemCount(int groupIndex);
79
80         //IGroupedListViewItemEventListener
81         void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
82
83         void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status);
84
85         void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction);
86
87         //IFormBackEventListener
88         void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
89
90         //IOrientationEventListener
91         void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
92
93         //ISceneEventListener
94         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
95
96         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
97         enum
98         {
99                 SETTING_INVALID = -1,
100                 SETTING_HOMEPAGE_TITLE = 0,
101                 SETTING_CURRENT_PAGE,                           //1
102                 SETTING_BLANK_PAGE,                                     //2
103                 SETTING_MOST_VISITED_SITE,                      //3
104                 //SETTING_EMPTY_PAGE,                 //1
105                 SETTING_FAVORITE_URL,               //4
106                 SETTING_DEFAULT_VIEW_TITLE,         //5
107                 SETTING_FIT_TO_WIDTH,               //6
108                 SETTING_READABLE,                   //7
109                 SETTING_RUN_JAVASCRIPT,             //8
110                 SETTING_DISPLAY_IMAGES,             //9
111                 SETTING_BLOCK_POPUP,                //10
112                 SETTING_CLEAR_CACHE,                //11
113                 SETTING_CLEAR_HISTORY,              //12
114                 SETTING_SHOW_SECURITY_WARNINGS,     //13
115                 SETTING_ACCEPT_COOKIES,                         //14
116                 SETTING_CLEAR_COOKIE_DATA,          //15
117                 SETTING_REMEMBER_FORM_DATA,
118                 SETTING_CLEAR_FORM_DATA,                        //16
119                 SETTING_REMEMBER_PASSWORD,
120                 SETTING_CLEAR_PASSWORDS,                        //17
121                 SETTING_SEARCH_ENGINE_TITLE,        //20
122                 SETTING_SEARCH_ENGINE_YAHOO,        //21
123                 SETTING_SEARCH_ENGINE_NAVER,        //22
124                 SETTING_SEARCH_ENGINE_GOOGLE,       //23
125                 SETTING_RESET_TO_DEFAULT,           //24
126                 SETTING_MAX                                                     //25
127
128         };
129
130         enum SettingListItemType
131         {
132                 ITEM_TYPE_NORMAL = 0,
133                 ITEM_TYPE_TOGGLE,
134                 ITEM_TYPE_DROPDOWN,
135                 ITEM_TYPE_RADIO,
136         };
137
138         class SettingItemInfo
139         {
140         public:
141                 /**
142                  * @brief The Default Constructor
143                  */
144                 SettingItemInfo(void);
145
146                 /**
147                  * @brief The Default Destructor
148                  */
149                 virtual ~SettingItemInfo(void){};
150
151         public:
152                 int childCount;     //only for ITEM_TYPE_DROPDOWN type items
153                 bool isOpen;        //true for opened and false for closed
154                 bool isSelected;        //only for ITEM_TYPE_RADIO && ITEM_TYPE_TOGGLE type of items
155                 SettingListItemType itemType;
156                 Tizen::Base::String titleText;
157                 Tizen::Base::String subText;
158         };
159
160         int groupCount;
161         int* pGroupItemCount;
162         SettingItemInfo settingInfo[SETTING_MAX];
163 private:
164         /**
165          * @brief Initializes this instance of settings default values.
166          */
167         void InitializeSettingValues(void);
168
169         /**
170          * @brief Opens a popup to clear cache data.
171          */
172         void ClearCache(void);
173
174         /**
175          * @brief Opens a popup to clear all the cookies.
176          */
177         void ClearCookie(void);
178
179         /**
180          * @brief Opens a popup to clear all Saved Form Data.
181          */
182         void ClearFormData(void);
183
184         /**
185          * @brief Opens a popup to clear all Saved Passwords.
186          */
187         void ClearPasswords(void);
188
189         /**
190          * @brief Opens a popup to clear the browser history
191          */
192         void ClearHistory(void);
193
194         /**
195          * @brief Opens a popup for resetting the default settings.
196          */
197         void ResetToDefault(void);
198
199 private:
200         Tizen::Base::String __currentURL;
201         int __fontValue;
202         ConfirmationPopup* __pConfirmationPopup;
203         Tizen::Ui::Controls::GroupedListView* __pList;
204         NotificationPanel* __pNotification;
205         Tizen::Ui::Controls::Popup* __pResetPopup;
206         WindowInfo* __pWindowInfo;                          // Contains window information of current scene
207         bool __isCurrentPageDisable;
208         int __fontSize;
209
210 };
211
212
213 #endif /* _INT_SETTING_FORM_H_ */