ade6b2c2ba1525dc88841cb93fd88c99c1ef59b2
[apps/osp/Call.git] / inc / CallEndCallForm.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                CallEndCallForm.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 "CallBaseForm.h"
30 #include "CallTypes.h"
31 #include "CallIAppStateChangeListner.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         , public Tizen::Ui::IOrientationEventListener
47 {
48 public:
49         EndCallForm(void);
50         virtual ~EndCallForm(void);
51         //From BaseForm
52         virtual void Initialize(void);
53
54 public:
55         virtual result OnInitializing(void);
56         virtual result OnTerminating(void);
57         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
58
59         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
60         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
61
62         /**
63          * Called when the container needs to draw itself. @n
64          * Users can override this method to display user-specific drawings. @n
65          * This method is called after the container has drawn itself, but just before the container draws its child controls.
66          */
67         virtual result OnDraw(void);
68
69         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
70
71         /**
72          * Called when the application control is completed.
73          * @param[in]   providerId      The provider ID
74          * @param[in]   operationId             The operation ID used in application control invocation
75          * @param[in]   pResultList             The list of callback strings of application control
76          * @remarks     The specified @c pResultList provides the result code for the first array element.
77          * @remarks     When the invoked application control is terminated without sending a result,
78          *           then this method is invoked with @c pResultList and it contains App::APPCONTROL_RESULT_TERMINATED.
79          * @remarks     Switching forms using Tizen::Ui::Controls::Frame::SetCurrentForm() in this listener disables the upcoming form
80          *           (UiApp::OnForeground()). If UiApp::OnForeground() is being used in the application logic,
81          *                      it is recommended to avoid switching forms in this listener.
82          * @see         Tizen::App::AppControl
83          */
84         virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
85         //Used to set the Viewcontact button state in the end call form
86         void ShowViewContactButton(void);
87         //Used to set the Viewcontact button state in the end call form
88         void ShowAddContactButton(void);
89         //Called when App comes to foreground
90         virtual void OnForeground(void);
91         //Called when App goes to background
92         virtual void OnBackground(void);
93         //Called when screen goes off
94         virtual void OnScreenOff(void){};
95         //From IOrientationEventListener
96         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
97
98 private:
99         //initialise the end call panel
100         void InitializeCallButtonsPanel(void);
101         //Add the action listener for the buttons
102         void AddKeyPadActionListener(const Tizen::Base::String& keyName, CommandIds cmdId);
103         // Method to show phone number on screen for all calls except conference call.
104         void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& lblName);
105         // Method to show caller name and photo for all calls.
106         void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& nameLblName, const Tizen::Base::String& photoLblName, AppCallInfo* pCallInfo);
107         // Method to show thumbnail
108         void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
109         //private method to handle whether to close App or goto initial scene, after no more active calls are left.
110         void HandleLastCallCompletion(void);
111         //Handle Add to contacts button press
112         void HandleAddToContacts(void);
113         //Method to show thumbnail image
114         void ShowThumbnailImage(const Tizen::Graphics::Bitmap* pPhotoId,const Tizen::Base::String& photoLabel);
115
116 private:
117         //Custom Buttons Panel
118         CallButtonsPanel* __pCallButtonsPanel;
119         Tizen::Base::String* __pContactNumber;
120         //Timer used to show End call scene for 3 sec
121         Tizen::Base::Runtime::Timer* __pEndCallEventTimer;
122         Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
123         bool __isMsgAppControlLaunched;
124         bool __isContactAppControlLaunched;
125 };
126
127 #endif  // _PHN_END_CALL_FORM_H_