2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file CallActiveCallForm.h
19 * @brief This is the header file for the %ActiveCallForm class.
21 * This header file contains the declarations for %ActiveCallForm class.
23 #ifndef _PHN_ACTIVE_CALL_FORM_H_
24 #define _PHN_ACTIVE_CALL_FORM_H_
28 #include "CallBaseForm.h"
29 #include "CallIAppStateChangeListner.h"
31 class CallButtonsPanel;
32 class DtmfKeyPadPanel;
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.
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
51 ActiveCallForm(FormType formType);
52 virtual ~ActiveCallForm(void);
54 virtual void Initialize(void);
57 virtual result OnInitializing(void);
58 virtual result OnTerminating(void);
59 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
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);
64 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
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);
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){};
78 // Create the call buttons panel and add to form
79 result InitializeCallButtonsPanel(void);
80 // Set the correct bitmaps and action listeners for swap button
81 void InitializeSwapButton(void);
82 // Set the action listener for manage conf call button
83 void InitializeManageConfCallButton(void);
84 // Set the correct bitmaps and action listeners for hold button
85 void InitializeHoldButton(void);
86 // Set the state of the hold button according to call state
87 void SetHoldButtonStatus(bool toHoldCall);
88 // This function is used to fetch person details using phone number.
89 void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo);
90 // Method to show phone number on screen for all calls except conference call.
91 void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName);
92 // Method to show caller name for all calls.
93 void ShowCallerName(const Tizen::Base::String& callerName, const Tizen::Base::String& nameLblName);
94 // This function draws the caller's photo onto screen.
95 void ShowCallerPhoto(Tizen::Graphics::Bitmap* pPhotoId, bool isSecondCaller);
96 //This function is used to show small Thumbnail size photo of caller.
97 void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
98 // Method to show call duration/state(held) for call in progress
99 void ShowTimerInfo(const Tizen::Base::String& timerLblName, bool isOnHold, long long startTime = 0);
100 // Method to set the show state of all the labels when DTMF keypad is launched
101 void SetShowStateOnKeypad(bool showState);
102 // Method to populate the list shown on "More" option
103 void CreateMoreOptionsMenuList(void);
104 // Method to destroy the list shown on "More" option
105 void DestroyMoreOptionsMenuList(void);
106 //Used to Show DTMF keypad
107 void ShowDTMFKeypad(void);
108 //Used to hide DTMF Keypad
109 void HideDTMFKeypad(void);
110 //Used to show text in text field
111 void SetTextToDTMFTextField(const Tizen::Base::String& dtmfStr);
113 //From IListViewItemEventListener
114 virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
115 virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
116 virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
117 virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
119 //From IListViewItemProvider
120 virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
121 virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
122 virtual int GetItemCount(void);
123 //Method to show thumbnail image
124 void ShowThumbnailImage(const Tizen::Graphics::Bitmap* pPhotoId,Tizen::Base::String& photoLabel);
127 //Start time for Active call
128 long long __activeCallStartTime;
129 //Timer used to show call time
130 Tizen::Base::Runtime::Timer* __pActiveCallTimer;
131 //Custom Buttons Panel
132 CallButtonsPanel* __pCallButtonsPanel;
133 DtmfKeyPadPanel* __pDTMFKeypad;
134 //Option Menu List for conference call
135 Tizen::Ui::Controls::ListView* __pMoreOptionsList;
136 Tizen::Ui::Controls::Label* __pMoreOptionsListAnchor;
137 Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
138 Tizen::Base::String __DtmfString;
139 AppCallInfo* __pActiveCallInfo;
140 AppCallInfo* __pHeldCallInfo;
143 #endif //_PHN_ACTIVE_CALL_FORM_H_