License and Privilege changes
[apps/osp/Call.git] / inc / CallActiveCallForm.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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                CallActiveCallForm.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 "CallBaseForm.h"
29 #include "CallIAppStateChangeListner.h"
30
31 class CallButtonsPanel;
32 class DtmfKeyPadPanel;
33 class AppCallInfo;
34
35 /**
36  * @class ActiveCallForm
37  * @brief This class presents a form based UI for dialing call, active call, conference call,
38  *      single active call, multiple active call scenarios.
39  *
40  */
41 class ActiveCallForm
42         : public BaseForm
43         , public IAppStateChangeListener
44         , public Tizen::Ui::Controls::IListViewItemEventListener
45         , public Tizen::Ui::Controls::IListViewItemProvider
46         , public Tizen::Ui::Scenes::ISceneEventListener
47         , public Tizen::Base::Runtime::ITimerEventListener
48         , public Tizen::Ui::IOrientationEventListener
49 {
50 public:
51         ActiveCallForm(FormType formType);
52         virtual ~ActiveCallForm(void);
53         //From BaseForm
54         virtual void Initialize(void);
55
56 public:
57         virtual result OnInitializing(void);
58         virtual result OnTerminating(void);
59         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
60
61         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
62         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
63
64         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
65
66         // Handle the changes(e.g. participant ended) in conference call
67         void HandleConfCallChanged(void);
68         // Used to update multiple call screen
69         void UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCallInfo>& activeCallsList);
70
71         //From IOrientationEventListener
72         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
73         //From IAppStateChangeListener
74         virtual void OnForeground(void);
75         virtual void OnBackground(void){};
76         virtual void OnScreenOff(void){};
77
78 private:
79         // Create the call buttons panel and add to form
80         result InitializeCallButtonsPanel(void);
81         // Set the correct bitmaps and action listeners for swap button
82         void InitializeSwapButton(void);
83         // Set the action listener for manage conf call button
84         void InitializeManageConfCallButton(void);
85         // Set the correct bitmaps and action listeners for hold button
86         void InitializeHoldButton(void);
87         // Set the state of the hold button according to call state
88         void SetHoldButtonStatus(bool toHoldCall);
89         // This function is used to fetch person details using phone number.
90         void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo);
91         // Method to show phone number on screen for all calls except conference call.
92         void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName);
93         // Method to show caller name for all calls.
94         void ShowCallerName(const Tizen::Base::String& callerName, const Tizen::Base::String& nameLblName);
95         // This function draws the caller's photo onto screen.
96         void ShowCallerPhoto(Tizen::Graphics::Bitmap* pPhotoId, bool isSecondCaller);
97         //This function is used to show small Thumbnail size photo of caller.
98         void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
99         // Method to show call duration/state(held) for call in progress
100         void ShowTimerInfo(const Tizen::Base::String& timerLblName, bool isOnHold, long long startTime = 0);
101         // Method to set the show state of all the labels when DTMF keypad is launched
102         void SetShowStateOnKeypad(bool showState);
103         // Method to populate the list shown on "More" option
104         void CreateMoreOptionsMenuList(void);
105         // Method to destroy the list shown on "More" option
106         void DestroyMoreOptionsMenuList(void);
107         //Used to Show DTMF keypad
108         void ShowDTMFKeypad(void);
109         //Used to hide DTMF Keypad
110         void HideDTMFKeypad(void);
111         //Used to show text in text field
112         void SetTextToDTMFTextField(const Tizen::Base::String& dtmfStr);
113         // Set hold button status
114         void SetHoldButtonShowState(bool showState);
115
116         //From IListViewItemEventListener
117         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
118         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
119         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
120         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
121
122         //From IListViewItemProvider
123         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
124         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
125         virtual int GetItemCount(void);
126         //Method to show thumbnail image
127         void ShowThumbnailImage(const Tizen::Graphics::Bitmap* pPhotoId,Tizen::Base::String& photoLabel);
128
129 private:
130         //Start time for Active call
131         long long __activeCallStartTime;
132         //Timer used to show call time
133         Tizen::Base::Runtime::Timer* __pActiveCallTimer;
134         //Custom Buttons Panel
135         CallButtonsPanel* __pCallButtonsPanel;
136         DtmfKeyPadPanel* __pDTMFKeypad;
137         //Option Menu List for conference call
138         Tizen::Ui::Controls::ListView* __pMoreOptionsList;
139         Tizen::Ui::Controls::Label* __pMoreOptionsListAnchor;
140         Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
141         Tizen::Base::String __DtmfString;
142         AppCallInfo* __pActiveCallInfo;
143         AppCallInfo* __pHeldCallInfo;
144 };
145
146 #endif  //_PHN_ACTIVE_CALL_FORM_H_