Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnEndCallForm.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
15 //
16
17 /**
18  * @file                PhnEndCallForm.h
19  * @brief               This is the header file for the %EndCallForm class.
20  *
21  * This header file contains the declarations for %EndCallForm class.
22  */
23 #ifndef _PHN_END_CALL_FORM_H_
24 #define _PHN_END_CALL_FORM_H_
25
26 #include <FBase.h>
27 #include <FApp.h>
28 #include <FUi.h>
29 #include "PhnBaseForm.h"
30 #include "PhnTypes.h"
31 #include "PhnIAppStateChangeListner.h"
32
33 class CallButtonsPanel;
34
35 /**
36  * @class EndCallForm
37  * @brief This class presents a form based UI for end call scenarios.
38  *
39  */
40 class EndCallForm
41         : public BaseForm
42         , public Tizen::Ui::Scenes::ISceneEventListener
43         , public Tizen::Base::Runtime::ITimerEventListener
44         , public Tizen::App::IAppControlResponseListener
45         , public IAppStateChangeListener
46 {
47 public:
48         EndCallForm(void);
49         virtual ~EndCallForm(void);
50         //From BaseForm
51         virtual void Initialize(void);
52
53 public:
54         virtual result OnInitializing(void);
55         virtual result OnTerminating(void);
56         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
57
58         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
59         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
60
61         /**
62          * Called when the container needs to draw itself. @n
63          * Users can override this method to display user-specific drawings. @n
64          * This method is called after the container has drawn itself, but just before the container draws its child controls.
65          */
66         virtual result OnDraw(void);
67
68         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
69
70         /**
71          * Called when the application control is completed.
72          * @param[in]   providerId      The provider ID
73          * @param[in]   operationId             The operation ID used in application control invocation
74          * @param[in]   pResultList             The list of callback strings of application control
75          * @remarks     The specified @c pResultList provides the result code for the first array element.
76          * @remarks     When the invoked application control is terminated without sending a result,
77          *           then this method is invoked with @c pResultList and it contains App::APPCONTROL_RESULT_TERMINATED.
78          * @remarks     Switching forms using Tizen::Ui::Controls::Frame::SetCurrentForm() in this listener disables the upcoming form
79          *           (UiApp::OnForeground()). If UiApp::OnForeground() is being used in the application logic,
80          *                      it is recommended to avoid switching forms in this listener.
81          * @see         Tizen::App::AppControl
82          */
83         virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
84         //Used to set the contact button state in the end call form
85         void SetContactButtonState(bool showState);
86         //Called when App comes to foreground
87         virtual void OnForeground(void);
88         //Called when App goes to background
89         virtual void OnBackground(void);
90
91 private:
92         //initialise the end call panel
93         void InitializeCallButtonsPanel(void);
94         //Add the action listener for the buttons
95         void AddKeyPadActionListener(const Tizen::Base::String& keyName, CommandIds cmdId);
96         // Method to show phone number on screen for all calls except conference call.
97         void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& lblName);
98         // Method to show caller name and photo for all calls.
99         void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& nameLblName, const Tizen::Base::String& photoLblName, CallInfo* pCallInfo);
100         // Method to show thumbnail
101         void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
102         //private method to handle whether to close App or goto initial scene, after no more active calls are left.
103         void HandleLastCallCompletion(void);
104
105 private:
106         //Custom Buttons Panel
107         CallButtonsPanel* __pCallButtonsPanel;
108         Tizen::Base::String* __pContactNumber;
109         //Timer used to show End call scene for 3 sec
110         Tizen::Base::Runtime::Timer* __pEndCallEventTimer;
111         Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
112         bool __isMsgAppControlLaunched;
113         bool __isContactAppControlLaunched;
114 };
115
116 #endif  // _PHN_END_CALL_FORM_H_