Applied latest source code
[apps/native/preloaded/Clock.git] / inc / ClkWorldClockDeleteListForm.h
1 //
2 // Tizen Native SDK
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 /**
19  * @file        WorldClockDeleteListForm.h
20  * @brief       This is the header file for WorldClockDeleteListForm class
21  */
22
23 #ifndef _CLK_WORLD_CLOCK_DELETE_LIST_FORM_H_
24 #define _CLK_WORLD_CLOCK_DELETE_LIST_FORM_H_
25
26 class WorldClockDeleteListForm
27 : public Tizen::Ui::Controls::Form
28   , public Tizen::Ui::Controls::IFormBackEventListener
29   ,     public Tizen::Ui::Controls::IListViewItemEventListener
30   , public Tizen::Ui::Controls::IListViewItemProvider
31   , public Tizen::Ui::IActionEventListener
32   , public Tizen::Ui::IOrientationEventListener
33   , public Tizen::Ui::Scenes::ISceneEventListener
34   {
35   public:
36         /**
37          *@brief Default destructor
38          */
39         WorldClockDeleteListForm(void);
40
41         /**
42          *@brief Default destructor
43          */
44         virtual ~WorldClockDeleteListForm(void);
45
46         /**
47          * @brief Initializes %WorldClockDeleteListForm.
48          *
49          * @return              An error code
50          * @param[in]   void
51          * @exception   true                            The method is successful.
52          * @exception   false                           An error occurred.
53          */
54         bool Initialize(void);
55
56         /**
57          * @brief Initializes the controls of the UI for %WorldClockDeleteListForm.
58          *
59          * @return              An error code
60          * @exception   E_SUCCESS                       The method is successful.
61          * @exception   E_INVALID_STATE         This instance has already been constructed.
62          * @exception   E_INVALID_ARG       A specified input parameter is invalid.
63          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
64          * @exception   E_SYSTEM                        A system error has occurred.
65          */
66         virtual result OnInitializing(void);
67
68         /**
69          * @brief Terminates the controls of the UI for %WorldClockDeleteListForm.
70          *
71          * @return              An error code
72          * @exception   E_SUCCESS                       The method is successful.
73          * @exception   E_INVALID_STATE         This instance has already been constructed.
74          * @exception   E_INVALID_ARG       A specified input parameter is invalid.
75          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
76          * @exception   E_SYSTEM                        A system error has occurred.
77          */
78         virtual result OnTerminating(void);
79
80   public:
81         //IListViewItemProvider
82         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
83         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth);
84         virtual int GetItemCount(void);
85
86         //IActionEventListener
87         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
88
89         //IFormBackEventListener
90         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
91
92         //IListViewItemEventListener
93         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status){};
94         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
95         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
96         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction){};
97         virtual void OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo);
98
99         //ISceneEventListener
100         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
101         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
102
103         void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
104
105   private:
106         Tizen::Base::Collection::ArrayList* __pData;
107         Tizen::Ui::Controls::ListView* __pListView; // The GroupedListView which contains the history lists
108         Tizen::Ui::Controls::CheckButton* __pSelectAllCheck;
109         Tizen::Ui::Controls::Label* __pSelectedLabel;
110         bool __sameOrder;
111         int __selectedCount;
112         int __selectedItemCount;
113         Tizen::Base::Collection::ArrayList __worldClockList;
114         Tizen::Base::Collection::ArrayList __previousWorldClockList;
115         Tizen::Base::Collection::ArrayList __selectedItemList;
116
117   };
118
119 #endif  // _CLK_WORLD_CLOCK_DELETE_LIST_FORM_H_