Fixed Nabi Issues
[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
33 class SettingForm
34         : public Tizen::Ui::Controls::Form
35         , public Tizen::Ui::Controls::IFormBackEventListener
36         , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
37         , public Tizen::Ui::Controls::IGroupedListViewItemProvider
38         , public Tizen::Ui::IActionEventListener
39         , public Tizen::Ui::IOrientationEventListener
40         , public Tizen::Ui::Scenes::ISceneEventListener
41 {
42 public:
43         /**
44          * @brief               The Default Constructor
45          */
46         SettingForm(void);
47
48         /**
49          * @brief               The Default Destructor
50          */
51         virtual ~SettingForm(void);
52
53         /**
54          * @brief               Initializes this SettingForm Form.
55          */
56         bool Initialize(void);
57
58         /**
59          * @brief               Initializes the controls of the UI for SettingForm.
60          */
61         result OnInitializing(void);
62
63         //IActionEventListener
64         void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
65
66         //IGroupedListViewItemProvider
67         Tizen::Ui::Controls::GroupItem* CreateGroupItem(int groupIndex, int itemWidth);
68
69         Tizen::Ui::Controls::ListItemBase* CreateItem(int groupIndex, int itemIndex, int itemWidth);
70
71         bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::GroupItem* pItem, int itemWidth);
72
73         bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
74
75         int GetGroupCount(void);
76
77         int GetItemCount(int groupIndex);
78
79         //IGroupedListViewItemEventListener
80         void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
81
82         void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status);
83
84         void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction);
85
86         //IFormBackEventListener
87         void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
88
89         //IOrientationEventListener
90         void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
91
92         //ISceneEventListener
93         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
94
95         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
96         enum
97         {
98                 SETTING_INVALID = -1,
99                 SETTING_HOMEPAGE_TITLE = 0,
100                 SETTING_CURRENT_PAGE,                           //1
101                 SETTING_BLANK_PAGE,                                     //2
102                 SETTING_MOST_VISITED_SITE,                      //3
103                 //SETTING_EMPTY_PAGE,                 //1
104                 SETTING_FAVORITE_URL,               //4
105                 SETTING_DEFAULT_VIEW_TITLE,         //5
106                 SETTING_FIT_TO_WIDTH,               //6
107                 SETTING_READABLE,                   //7
108                 SETTING_RUN_JAVASCRIPT,             //8
109                 SETTING_DISPLAY_IMAGES,             //9
110                 SETTING_BLOCK_POPUP,                //10
111                 SETTING_CLEAR_CACHE,                //11
112                 SETTING_CLEAR_HISTORY,              //12
113                 SETTING_SHOW_SECURITY_WARNINGS,     //13
114                 SETTING_ACCEPT_COOKIES,                         //14
115                 SETTING_CLEAR_COOKIE_DATA,          //15
116                 SETTING_CLEAR_FORM_DATA,                        //16
117                 SETTING_CLEAR_PASSWORDS,                        //17
118                 SETTING_SEARCH_ENGINE_TITLE,        //20
119                 SETTING_SEARCH_ENGINE_YAHOO,        //21
120                 SETTING_SEARCH_ENGINE_NAVER,        //22
121                 SETTING_SEARCH_ENGINE_GOOGLE,       //23
122                 SETTING_RESET_TO_DEFAULT,           //24
123                 SETTING_MAX                                                     //25
124
125         };
126
127         enum SettingListItemType
128         {
129                 ITEM_TYPE_NORMAL = 0,
130                 ITEM_TYPE_TOGGLE,
131                 ITEM_TYPE_DROPDOWN,
132                 ITEM_TYPE_RADIO,
133         };
134
135         class SettingItemInfo
136         {
137         public:
138                 /**
139                  * @brief The Default Constructor
140                  */
141                 SettingItemInfo(void);
142
143                 /**
144                  * @brief The Default Destructor
145                  */
146                 virtual ~SettingItemInfo(void){};
147
148         public:
149                 int childCount;     //only for ITEM_TYPE_DROPDOWN type items
150                 bool isOpen;        //true for opened and false for closed
151                 bool isSelected;        //only for ITEM_TYPE_RADIO && ITEM_TYPE_TOGGLE type of items
152                 SettingListItemType itemType;
153                 Tizen::Base::String titleText;
154                 Tizen::Base::String subText;
155         };
156
157         int groupCount;
158         int* pGroupItemCount;
159         SettingItemInfo settingInfo[SETTING_MAX];
160 private:
161         /**
162          * @brief Initializes this instance of settings default values.
163          */
164         void InitializeSettingValues(void);
165
166         /**
167          * @brief Opens a popup to clear cache data.
168          */
169         void ClearCache(void);
170
171         /**
172          * @brief Opens a popup to clear all the cookies.
173          */
174         void ClearCookie(void);
175
176         /**
177          * @brief Opens a popup to clear all Saved Form Data.
178          */
179         void ClearFormData(void);
180
181         /**
182          * @brief Opens a popup to clear all Saved Passwords.
183          */
184         void ClearPasswords(void);
185
186         /**
187          * @brief Opens a popup to clear the browser history
188          */
189         void ClearHistory(void);
190
191         /**
192          * @brief Opens a popup for resetting the default settings.
193          */
194         void ResetToDefault(void);
195
196 private:
197         Tizen::Base::String __currentURL;
198         int __fontValue;
199         ConfirmationPopup* __pConfirmationPopup;
200         Tizen::Ui::Controls::GroupedListView* __pList;
201         Tizen::Ui::Controls::Popup* __pResetPopup;
202         WindowInfo* __pWindowInfo;                          // Contains window information of current scene
203         bool __isCurrentPageDisable;
204
205 };
206
207
208 #endif /* _INT_SETTING_FORM_H_ */