Applied latest source code
[apps/native/preloaded/Clock.git] / inc / ClkTimerRingingForm.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        ClkTimerRingingForm.h
20  * @brief               This is the header file for TimerRingingForm class
21  */
22
23 #ifndef CLKTIMERRINGINGFORM_H_
24 #define CLKTIMERRINGINGFORM_H_
25
26 #include <FTelCallManager.h>
27 #include <FTelCallInfo.h>
28
29 class TimerRingingForm
30 : public Tizen::Ui::Controls::Form
31   , public Tizen::Base::Runtime::ITimerEventListener
32   , public Tizen::Media::IPlayerEventListener
33   , public Tizen::Ui::IActionEventListener
34   , public Tizen::Ui::IOrientationEventListener
35   , public Tizen::Ui::Scenes::ISceneEventListener
36   , public Tizen::System::IScreenEventListener
37   , public Tizen::System::ISettingEventListener
38   , public Tizen::Telephony::ITelephonyCallEventListener
39   {
40   public:
41         /**
42          * @brief The Default constructor
43          */
44         TimerRingingForm();
45
46         /**
47          * @brief The Default destructor
48          */
49         virtual ~TimerRingingForm();
50
51         /**
52          * @brief Initializes this TimerRingingForm.
53          *
54          * @return              An error code
55          * @param[in]   void
56          * @exception   true                            The method is successful.
57          * @exception   false                           An error occurred.
58          */
59         bool Initialize(void);
60
61         /**
62          * @brief Initializes the controls of the UI for TimerRingingForm.
63          *
64          * @return              An error code
65          * @exception   E_SUCCESS                       The method is successful.
66          * @exception   E_INVALID_STATE         This instance has already been constructed.
67          * @exception   E_INVALID_ARG       A specified input parameter is invalid.
68          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
69          * @exception   E_SYSTEM                        A system error has occurred.
70          *
71          */
72         result OnInitializing(void);
73
74         virtual result OnTerminating(void);
75
76   public:
77         //IActionEventListener
78         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
79
80         //ISceenEventListener
81         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
82         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
83
84         // ITimerEventListener
85         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
86
87     //ITelephonyCallEventListener
88     void OnTelephonyCallStatusChangedN (Tizen::Telephony::CallStatus callStatus, Tizen::Telephony::CallInfo *pCallInfo);
89
90         // IPlayerEventListener
91         virtual void OnPlayerOpened(result r) {}
92         virtual void OnPlayerEndOfClip(void) {}
93         virtual void OnPlayerBuffering(int percent) {}
94         virtual void OnPlayerErrorOccurred(Tizen::Media::PlayerErrorReason r) {}
95         virtual void OnPlayerInterrupted(void) {}
96         virtual void OnPlayerReleased(void);
97         virtual void OnPlayerSeekCompleted(result r) {}
98         virtual void OnPlayerAudioFocusChanged (void);
99
100         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
101
102         virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
103
104         virtual void OnSettingChanged(Tizen::Base::String& key);
105
106         virtual void OnScreenOn(void){}
107         virtual void OnScreenOff(void);
108         virtual void OnScreenBrightnessChanged(int brightness) {}
109
110   private:
111         Tizen::Telephony::CallManager __callManager;
112         bool __nextSceneExist;
113         Tizen::Media::Player* __pPlayer;
114         Tizen::Ui::Controls::Button* __pStopButton;
115         Tizen::Base::Runtime::Timer* __pTimer;
116         Tizen::Ui::Controls::Label* __pTimerTimeLabel;
117         int __timerCalledCount;
118         bool __timerExpired;
119   };
120
121 #endif /* CLKTIMERRINGINGFORM_H_ */