Tizen 2.1 base
[apps/osp/Internet.git] / inc / IntSettingClearPrivateDataForm.h
1
2 // Copyright   2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.SETTINGSCLEARPRIVATEDATAFORM_H_
15 //
16 //!Internet SettingsClearPrivateDataForm class
17 /*@file:        IntSettingsClearPrivateDataForm.h
18  *@brief:       The SettingsClearPrivateDataForm used to create private data scene
19  *
20  */
21
22 #ifndef _INT_SETTINGS_CLEAR_PRIVATE_DATA_FORM_H_
23 #define _INT_SETTINGS_CLEAR_PRIVATE_DATA_FORM_H_
24
25 #include <FBase.h>
26 #include <FUi.h>
27
28 using namespace Tizen::Ui;
29
30 class SettingsClearPrivateDataForm
31         : public Controls::Form
32         , public IActionEventListener
33     , public Controls::IFormBackEventListener
34         , public Tizen::Ui::Controls::IListViewItemProvider
35         , public Tizen::Ui::Controls::IListViewItemEventListener
36         , public Tizen::Ui::IOrientationEventListener
37         , public Tizen::Ui::Scenes::ISceneEventListener
38 {
39 public:
40         /**
41         * Default constructor
42         */
43         SettingsClearPrivateDataForm(void);
44
45         /**
46         * Default destructor
47         */
48         virtual ~SettingsClearPrivateDataForm(void);
49
50         /**
51          *@name         Initialize
52          *@brief        Constructing and Initializing ClearPrivateDataScene
53          *@param[in]    no input parameters
54          *@retval               TRUE Initialize success
55          *@retval           FALSE Initialize failure
56          *
57          */
58         bool Initialize(void);
59
60         /**
61          *@name         OnInitializing
62          *@brief        Used to create instances and set styles for the form content.
63          *@param[in]    no input parameters
64          *@retval               TRUE Initialize success
65          *@retval           FALSE Initialize failure
66          */
67         virtual result OnInitializing(void);
68
69         /**
70          *@name         OnTerminating
71          *@brief        Called on terminate of a form
72          *@param[in]    no input parameters
73          *@retval               TRUE Terminate success
74          *@retval           FALSE Terminate failure
75          */
76         virtual result OnTerminating(void);
77
78         //IListViewItemProvider
79         /**
80          *@name         CreateItem
81          *@brief        Called when items need to be loaded.
82          *@param[in]    index           The index of the list
83          *@param[in]    itemWidth       The width of the element
84          *@retval               no return value
85          */
86         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
87
88         /**
89          *@name         DeleteItem
90          *@brief        Called when items need to be loaded.
91          *@param[in]    index           The index of the list
92          *@param[in]    pItem           The pointer to the item to be deleted
93          *@param[in]    itemWidth       The width of the element
94          *@retval               no return value
95          */
96         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
97
98         /**
99          *@name         GetItemCount
100          *@brief        Called when the IconListView is about to be drawn and requests the listener to set the number of total items.
101          *@param[in]    no input parameter
102          *@retval               no return value
103          */
104         virtual int GetItemCount(void);
105
106         // IActionEventListener
107         /**
108          *@name         OnActionPerformed
109          *@brief        Called when an action event occurs.
110          *@param[in]    source      The source of the event
111          *@param[in]    actionId        The information about the action event
112          *@retval               no return value
113          */
114         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
115
116         // IFormBackEventListener
117         /**
118          *@name         OnSceneDeactivated
119          *@brief        Called when the current Form control needs to be closed to revert back to the previous Form control.
120          *@param[in]    source  The source of the event
121          *@retval               no return value
122          */
123         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
124
125         // IListViewItemEventListener
126         /**
127          *@name         OnListViewContextItemStateChanged
128          *@brief        Called when the state of an element in the ListContextItem is changed.
129          *@param[in]    listView    The source of the event
130          *@param[in]    index           The index of the list
131          *@param[in]    elementId       The element ID
132          *@param[in]    state           The status of the element
133          *@retval               no return value
134          */
135         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
136
137         /**
138          *@name         OnListViewItemStateChanged
139          *@brief        Called when the state of an element in the ListViewItem in the ListView or GroupedListView is changed.
140          *@param[in]    listView    The source of the event
141          *@param[in]    index           The index of the list
142          *@param[in]    elementId       The element ID
143          *@param[in]    status          The status of the element
144          *@retval               no return value
145          */
146         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
147
148         /**
149          *@name         OnListViewItemSwept
150          *@brief        Called when the ListItem is swept.
151          *@param[in]    listView    The source of the event
152          *@param[in]    index           The index of the list
153          *@param[in]    direction       The sweep direction
154          *@retval               no return value
155          */
156         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
157
158         /**
159          *@name         OnListViewItemLongPressed
160          *@brief        Called when the item or the element is long pressed.
161          *@param[in]    listView    The source of the event
162          *@param[in]    index           The index of the list
163          *@param[in]    elementId       The element ID
164          *@param[in]    invokeListViewItemCallback      Indicates whether to invoke ListView item callback after this method returns
165          *@retval               no return value
166          */
167         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
168
169         //IOrientationEventListener
170         /**
171          *@name         OnOrientationChanged
172          *@brief                Called when an orientation event occurs.
173          *@param[in]   source                           The source of the event
174          *@param[in]   orientationStatus        The information about the orientation event
175          *@remarks              The orientation changed event is fired on %Control for which orientation mode change has been enabled by calling SetOrientation().
176          *@retval               no return value
177          */
178         void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
179
180         // ISceneEventListener
181         /**
182          *@name         OnSceneActivatedN
183          *@brief        Called after setting as current scene.
184          *@param[in]    previousSceneId     The scene ID of the deactivated scene
185          *@param[in]    currentSceneId          The scene ID of the newly activated scene
186          *@param[in]    IList A pointer to an argument list that is user-specified
187          *@retval               no return value
188          */
189         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
190
191         /**
192          *@name         OnSceneDeactivated
193          *@brief        Called when the current scene is deactivated.
194          *@param[in]    currentSceneId  The scene ID of the scene being deactivated
195          *@param[in]    nextSceneId             The scene ID of the newly activated scene
196          *@param[in]    IList A pointer to an argument list that is user-specified
197          *@retval               no return value
198          */
199         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
200
201 protected:
202         static const int IDA_FORMAT_TITLE_STRING;
203         static const int IDA_BUTTON_DELETE;
204         static const int IDA_BUTTON_CANCEL;
205
206 private:
207         int __clearItem;
208         // __pList Pointer to ListView
209         Tizen::Ui::Controls::ListView* __pList;
210 };
211
212 #endif /* _INT_SETTINGS_CLEAR_PRIVATE_DATA_FORM_H_ */