Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_DateTimeChangeEvent.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (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  * @file                FUiCtrl_DateTimeChangeEvent.h
19  * @brief               This is the header file for the _DateTimeChangeEvent and _DateTimeChangeEventArg classes.
20  */
21
22 #ifndef _FUI_CTRL_INTERNAL_DATETIME_CHANGE_EVENT_H_
23 #define _FUI_CTRL_INTERNAL_DATETIME_CHANGE_EVENT_H_
24
25 #include <FOspConfig.h>
26 #include <FBaseResult.h>
27 #include <FBaseRt_Event.h>
28 #include "FUiCtrl_DateTimeDefine.h"
29
30 namespace Tizen { namespace Ui
31 {
32 class _Control;
33 }} // Tizen::Ui
34
35 namespace Tizen { namespace Ui { namespace Controls
36 {
37
38 class _DateTimeChangeEventArg
39         : public Tizen::Base::Runtime::IEventArg
40         , public Tizen::Base::Object
41 {
42 public:
43         _DateTimeChangeEventArg(_DateTimeChangeStatus status);
44
45         ~_DateTimeChangeEventArg(void);
46
47         int GetYear(void) const;
48
49         int GetMonth(void) const;
50
51         int GetDay(void) const;
52
53         int GetHour(void) const;
54
55         int GetMinute(void) const;
56
57         Tizen::Base::DateTime GetDateTime(void) const;
58
59         void SetDateTime(const Tizen::Base::DateTime& dateTime);
60
61         void SetTime(int hour, int minute);
62
63         void SetDate(int year, int month, int day);
64
65         _DateTimeChangeStatus GetStatus(void) const;
66
67 private:
68         // Attributes
69         _DateTimeChangeStatus __status;
70
71         int __year;
72         int __month;
73         int __day;
74         int __hour;
75         int __minute;
76
77         Tizen::Base::DateTime __dateTime;
78
79 };  // _DateTimeChangeEventArg
80
81 /**
82 * @class        _DateTimeChangeEvent
83 * @brief        This class handle a Date change event.
84 */
85
86 class _DateTimeChangeEvent
87         : public Tizen::Base::Runtime::_Event
88 {
89 public:
90         /**
91         * This is the default class constructor. After creating an instance of this
92         * class, you must explicitly call one of construction methods to initialize
93         * the instance.
94         */
95         _DateTimeChangeEvent(const Tizen::Ui::_Control& source);
96
97         /**
98         * This is the class destructor.
99         */
100         virtual ~_DateTimeChangeEvent(void);
101
102         // Operations
103 protected:
104         /**
105         * This method checks the arg and finds out the type of event. After that this method calls appopriate
106         * pListener's method.
107         *
108         * @return               This method returns a result code.
109         * @param[in]    pListener       It is a event listener related to this item event.
110         * @param[in]    arg                     It is an argument-like instance of item event retransmitted to the listener's method
111         *                                                       as an argument.
112         * @exception    E_SUCCESS               - The method is successful.
113         * @exception    E_ARG_NULL              - The listener is null.
114         * @exception    E_INVALID_ARG   - The argument passed to a method contains an invalid value.@n
115         *                                                                 &nbsp;&nbsp;The pListener is not the instance of IItemEventListener class or
116         *                                                                 the pItemEventArg is not the instance of __FlashEventArg class.
117         *
118         */
119         virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
120
121         // Attributes
122 private:
123         Tizen::Ui::_Control* __pSource;
124 }; // _DateTimeChangeEvent
125
126
127 }}} // Tizen::Ui::Controls
128
129 #endif  // _FUI_CTRL_INTERNAL_DATETIME_CHANGE_EVENT_H_