Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnActiveCallForm.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                PhnActiveCallForm.h
19  * @brief               This is the header file for the %ActiveCallForm class.
20  *
21  * This header file contains the declarations for %ActiveCallForm class.
22  */
23 #ifndef _PHN_ACTIVE_CALL_FORM_H_
24 #define _PHN_ACTIVE_CALL_FORM_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28 #include "PhnBaseForm.h"
29
30 class CallButtonsPanel;
31 class DtmfKeyPadPanel;
32 class CallInfo;
33
34 /**
35  * @class ActiveCallForm
36  * @brief This class presents a form based UI for dialing call, active call, conference call,
37  *      single active call, multiple active call scenarios.
38  *
39  */
40 class ActiveCallForm
41         : public BaseForm
42         , public Tizen::Ui::Controls::IListViewItemEventListener
43         , public Tizen::Ui::Controls::IListViewItemProvider
44         , public Tizen::Ui::Scenes::ISceneEventListener
45         , public Tizen::Base::Runtime::ITimerEventListener
46 {
47 public:
48         ActiveCallForm(FormType formType);
49         virtual ~ActiveCallForm(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         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
62
63         // Handle the call swap notification in multiple call screen
64         void HandleCallSwapN(Tizen::Base::Collection::IList* pCallList);
65
66 private:
67         // Create the call buttons panel and add to form
68         result InitializeCallButtonsPanel(void);
69         // Set the correct bitmaps and action listeners for swap button
70         void InitializeSwapButton(void);
71         // Set the action listener for manage conf call button
72         void InitializeManageConfCallButton(void);
73         // Set the correct bitmaps and action listeners for hold button
74         void InitializeHoldButton(void);
75         // Set the state of the hold button according to call state
76         void SetHoldButtonStatus(bool toHoldCall);
77         // This function is used to fetch person details using phone number.
78         void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo);
79         // Method to show phone number on screen for all calls except conference call.
80         void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName);
81         // Method to show caller name for all calls.
82         void ShowCallerName(const Tizen::Base::String& callerName, const Tizen::Base::String& nameLblName);
83         // This function draws the caller's photo onto screen.
84         void ShowCallerPhoto(Tizen::Graphics::Bitmap* pPhotoId, bool isSecondCaller);
85         //This function is used to show small Thumbnail size photo of caller.
86         void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
87         // Method to show call duration/state(held) for call in progress
88         void ShowTimerInfo(const Tizen::Base::String& timerLblName, bool isOnHold, long long startTime = 0);
89         // Method to set the show state of all the labels when DTMF keypad is launched
90         void SetShowStateOnKeypad(bool showState);
91         // Method to populate the list shown on "More" option
92         void CreateMoreOptionsMenuList(void);
93         // Method to destroy the list shown on "More" option
94         void DestroyMoreOptionsMenuList(void);
95         //Used to Show DTMF keypad
96         void ShowDTMFKeypad(void);
97         //Used to hide DTMF Keypad
98         void HideDTMFKeypad(void);
99         //Used to show text in text field
100         void SetTextToDTMFTextField(const Tizen::Base::String& dtmfStr);
101
102         //From IListViewItemEventListener
103         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
104         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
105         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
106         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
107
108         //From IListViewItemProvider
109         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
110         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
111         virtual int GetItemCount(void);
112
113 private:
114         //Start time for Active call
115         long long __activeCallStartTime;
116         //Timer used to show call time
117         Tizen::Base::Runtime::Timer* __pActiveCallTimer;
118         //Custom Buttons Panel
119         CallButtonsPanel* __pCallButtonsPanel;
120         DtmfKeyPadPanel* __pDTMFKeypad;
121         //Option Menu List for conference call
122         Tizen::Ui::Controls::ListView* __pMoreOptionsList;
123         Tizen::Ui::Controls::Label* __pMoreOptionsListAnchor;
124         Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
125         CallInfo* __pActiveCallInfo;
126         CallInfo* __pHeldCallInfo;
127 };
128
129 #endif  //_PHN_ACTIVE_CALL_FORM_H_