Applied latest source code
[apps/native/preloaded/Clock.git] / inc / ClkDaylightSavingPopUp.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 /**
20  * @file    DaylightSavingPopUp.h
21  * @brief       This header file contains the declarations of the DaylightSavingPopUp
22  *
23  */
24
25 #ifndef _CLK_DST_POPUP_H_
26 #define _CLK_DST_POPUP_H_
27
28 #include <FApp.h>
29 #include <FBase.h>
30 #include <FUi.h>
31
32
33 class IDstTimeEventListener
34 {
35 public:
36         IDstTimeEventListener();
37         virtual ~IDstTimeEventListener();
38
39         virtual void OnDaylightSavingPopUpItemSelected(int DstTime ) = 0 ;
40 };
41
42 class DaylightSavingPopUp
43   : public Tizen::Ui::Controls::IListViewItemEventListener
44   , public Tizen::Ui::Controls::IListViewItemProvider
45   , public Tizen::Ui::Controls::Popup
46   , public Tizen::Ui::IActionEventListener
47   , public Tizen::Ui::IPropagatedKeyEventListener
48   {
49   public:
50         /**
51          * @brief The Default Constructor
52          */
53          DaylightSavingPopUp(void);
54
55         /**
56          * @brief The Default Destructor
57          */
58         ~DaylightSavingPopUp(void);
59
60         /**
61          * @brief Initializes this SettingForm Form.
62          *
63          * @return              An error code
64          * @exception   true                            The method is succeIOrientationEventListenerssful.
65          * @exception   false                           An error Occured.
66          */
67         bool Initialize(void);
68
69         /**
70          * This function terminates all the controls
71          *
72          * @return      result type
73          * @param               No parameter
74          */
75         virtual result OnTerminating(void);
76
77   public:
78
79         //IListViewItemProvider
80         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
81         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
82         virtual int GetItemCount(void);
83
84         //IActionEventListener
85         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
86
87         // IListViewItemEventListener
88         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state){};
89         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
90         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction){};
91         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback){};
92
93         void SetDstIndex(int index);
94
95         void SetEventListner(IDstTimeEventListener* listner);
96
97         virtual bool OnKeyPressed (Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
98         virtual bool OnKeyReleased (Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
99         virtual bool OnPreviewKeyPressed (Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
100         virtual bool OnPreviewKeyReleased (Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
101
102   private:
103         Tizen::Ui::Controls::ListView* __pList;
104         IDstTimeEventListener* __pListener;
105   };
106
107
108 #endif /* _CLK_DST_POPUP_H_ */