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"
30 class CallButtonsPanel;
31 class DtmfKeyPadPanel;
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.
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 , public Tizen::Ui::IOrientationEventListener
49 ActiveCallForm(FormType formType);
50 virtual ~ActiveCallForm(void);
52 virtual void Initialize(void);
55 virtual result OnInitializing(void);
56 virtual result OnTerminating(void);
57 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
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);
62 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
64 // Handle the changes(e.g. participant ended) in conference call
65 void HandleConfCallChanged(void);
66 // Used to update multiple call screen
67 void UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCallInfo>& activeCallsList);
69 //From IOrientationEventListener
70 virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
73 // Create the call buttons panel and add to form
74 result InitializeCallButtonsPanel(void);
75 // Set the correct bitmaps and action listeners for swap button
76 void InitializeSwapButton(void);
77 // Set the action listener for manage conf call button
78 void InitializeManageConfCallButton(void);
79 // Set the correct bitmaps and action listeners for hold button
80 void InitializeHoldButton(void);
81 // Set the state of the hold button according to call state
82 void SetHoldButtonStatus(bool toHoldCall);
83 // This function is used to fetch person details using phone number.
84 void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo);
85 // Method to show phone number on screen for all calls except conference call.
86 void ShowPhoneNumber(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName);
87 // Method to show caller name for all calls.
88 void ShowCallerName(const Tizen::Base::String& callerName, const Tizen::Base::String& nameLblName);
89 // This function draws the caller's photo onto screen.
90 void ShowCallerPhoto(Tizen::Graphics::Bitmap* pPhotoId, bool isSecondCaller);
91 //This function is used to show small Thumbnail size photo of caller.
92 void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
93 // Method to show call duration/state(held) for call in progress
94 void ShowTimerInfo(const Tizen::Base::String& timerLblName, bool isOnHold, long long startTime = 0);
95 // Method to set the show state of all the labels when DTMF keypad is launched
96 void SetShowStateOnKeypad(bool showState);
97 // Method to populate the list shown on "More" option
98 void CreateMoreOptionsMenuList(void);
99 // Method to destroy the list shown on "More" option
100 void DestroyMoreOptionsMenuList(void);
101 //Used to Show DTMF keypad
102 void ShowDTMFKeypad(void);
103 //Used to hide DTMF Keypad
104 void HideDTMFKeypad(void);
105 //Used to show text in text field
106 void SetTextToDTMFTextField(const Tizen::Base::String& dtmfStr);
108 //From IListViewItemEventListener
109 virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
110 virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
111 virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
112 virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
114 //From IListViewItemProvider
115 virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
116 virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
117 virtual int GetItemCount(void);
118 //Method to show thumbnail image
119 void ShowThumbnailImage(const Tizen::Graphics::Bitmap* pPhotoId,Tizen::Base::String& photoLabel);
122 //Start time for Active call
123 long long __activeCallStartTime;
124 //Timer used to show call time
125 Tizen::Base::Runtime::Timer* __pActiveCallTimer;
126 //Custom Buttons Panel
127 CallButtonsPanel* __pCallButtonsPanel;
128 DtmfKeyPadPanel* __pDTMFKeypad;
129 //Option Menu List for conference call
130 Tizen::Ui::Controls::ListView* __pMoreOptionsList;
131 Tizen::Ui::Controls::Label* __pMoreOptionsListAnchor;
132 Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
133 Tizen::Base::String __DtmfString;
134 AppCallInfo* __pActiveCallInfo;
135 AppCallInfo* __pHeldCallInfo;
138 #endif //_PHN_ACTIVE_CALL_FORM_H_