2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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 CallIncomingCallForm.h
19 * @brief This is the header file for the %IncomingCallForm class.
21 * This header file contains the declarations for %IncomingCallForm class.
23 #ifndef _PHN_INCOMING_CALL_FORM_H_
24 #define _PHN_INCOMING_CALL_FORM_H_
29 #include "CallBaseForm.h"
30 #include "CallTypes.h"
31 #include "CallIPopupItemSelectListener.h"
32 #include "CallOptionPopup.h"
33 #include "CallIAppStateChangeListner.h"
36 * @class IncomingCallForm
37 * @brief This class presents a form based UI for incoming call scenarios.
40 class IncomingCallForm
42 , public IAppStateChangeListener
43 , public Tizen::Ui::Controls::IFormBackEventListener
44 , public Tizen::Ui::Controls::ITableViewItemEventListener
45 , public Tizen::Ui::Controls::ITableViewItemProvider
46 , public Tizen::Ui::Scenes::ISceneEventListener
47 , public Tizen::Ui::ITouchEventListener
48 , public Tizen::Ui::IOrientationEventListener
49 , public IPopupItemSelectListener
52 IncomingCallForm(void);
53 virtual ~IncomingCallForm(void);
55 virtual void Initialize(void);
58 virtual result OnInitializing(void);
59 virtual result OnTerminating(void);
60 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
62 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
63 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
66 * Called when the container needs to draw itself. @n
67 * Users can override this method to display user-specific drawings. @n
68 * This method is called after the container has drawn itself, but just before the container draws its child controls.
70 virtual result OnDraw(void);
72 // From 'ITableViewItemProvider' - Gets the total number of items in the specified group.
73 virtual int GetItemCount(void);
74 // From 'ITableViewItemProvider' - Creates the specified item.
75 virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int itemIndex, int itemWidth);
76 // From 'ITableViewItemProvider' - Deletes the specified item.
77 virtual bool DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
78 // From 'ITableViewItemProvider' - Updates the specified item.
79 virtual void UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem){};
80 // From 'ITableViewItemProvider' - Gets the default height of an item.
81 virtual int GetDefaultItemHeight(void);
82 //Handles call disconnect
83 void CallDisconnected(void);
84 // From 'ITableViewItemEventListener' - Called when the state of a TableViewItem in the TableView is changed.
85 virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status){};
86 // From 'ITableViewItemEventListener' - Called when the TableViewContextItem is opened or closed.
87 virtual void OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated){};
88 // From 'ITableViewItemEventListener' - Called when the item is reordered.
89 virtual void OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo){};
91 //From ITouchEventListener
92 virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
93 virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
94 virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
95 virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo){};
96 virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo){};
97 virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {};
98 virtual void OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {};
99 virtual void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {};
100 virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
101 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
102 //From IOrientationEventListener
103 virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
105 //From IPopupEventListener
106 void OnItemSelected(int itemIndex);
107 //From IAppStateChangeListener
108 virtual void OnForeground(void);
109 virtual void OnBackground(void){};
110 virtual void OnScreenOff(void);
113 // Method to fetch person details using phone number.
114 void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, AppCallInfo* pCallInfo);
115 // Method to show caller name for all calls.
116 void SetTextToLabel(const Tizen::Base::String& textToBeSet, const Tizen::Base::String& lblName);
117 // This function draws the caller's photo onto screen.
118 void ShowCallerPhoto(const Tizen::Graphics::Bitmap* pPhotoId);
119 //This function is used to show small Thumbnail size photo of caller.
120 void ShowCallersPhotoThumbnail(const Tizen::Graphics::Bitmap& pPhotoId);
121 // Method to show call duration/state(held) for call in progress
122 void ShowTimerInfo(const Tizen::Base::String& timerLblName, const Tizen::Base::String& textToBeDisplayed);
123 // Method to hide the "Reject with Message" panel
124 void HideRejectPanel(void);
125 // Method to create the Tableview to show the list of messages for the "Reject with Message" panel
126 void InitializeTableView(void);
127 // Method to create the canvas for the "Reject with Message" Button
128 void SetBitmapToRejectMessageButton(const Tizen::Base::String& btnName, const Tizen::Base::String& bgBitmap
129 , const Tizen::Base::String& arrowBitmap, const Tizen::Base::String& messageIconBitmap, bool isButtonInPanel, bool setButtonPressBitmap);
130 void HandleMultipleCallSelection(int itemIndex);
131 // Method to initialize footer
132 void InitializeFooter(void);
133 // Method to show footer
134 void ShowRejectMessageFooter(void);
135 // Method to hide footer
136 void HideRejectMessageFooter(void);
137 //Method used to show thumbnail image
138 void ShowThumbnailImage(const Tizen::Graphics::Bitmap* pPhotoId);
139 //Hides the rejetec message panel
140 void HideRejectMessagePanel(void);
141 //Shows reject message panel
142 void ShowRejectMessagePanel(void);
145 //contact number for incoming call
146 Tizen::Base::String* __pActiveContactNo;
147 //Call Handle for the incoming call
148 int __incomingCallHandle;
149 //List for holding the rejectMessages from settings
150 Tizen::Base::Collection::IListT<Tizen::Base::String>* __pRejectMessageList;
151 bool __isAnswerCallStarted;
152 bool __isRejectCallStarted;
153 Tizen::Base::Collection::ArrayList* __pAcceptArrowLabelsList;
154 Tizen::Base::Collection::ArrayList* __pRejectArrowLabelsList;
155 Tizen::Graphics::Bitmap* __pRejectCircle;
156 Tizen::Graphics::Bitmap* __pAcceptCircle;
157 Tizen::Graphics::Bitmap* __pAcceptDial;
158 Tizen::Graphics::Bitmap* __pRejectDial;
159 Tizen::Graphics::Bitmap* __pAcceptArrow;
160 Tizen::Graphics::Bitmap* __pRejectArrow;
161 Tizen::Ui::Controls::Label* __pAcceptLabel; //for dial
162 Tizen::Ui::Controls::Label* __pRejectLabel;
163 Tizen::Ui::Controls::Label* __pAcceptArrowLabel;
164 Tizen::Ui::Controls::Label* __pRejectArrowLabel;
165 Tizen::Ui::Controls::Panel* __pCallHandlePanel;
166 Tizen::Ui::Animations::VisualElement* __pAcceptVisElem;
167 Tizen::Ui::Animations::VisualElement* __pRejectVisElem;
168 Tizen::Ui::Animations::VisualElement* __pRejectFinalVisElem;
169 Tizen::Ui::Animations::VisualElement* __pAcceptFinalVisElem;
170 Tizen::Ui::Animations::VisualElement* __pAcceptArrowVisElem;
171 Tizen::Ui::Animations::VisualElement* __pRejectArrowVisElem;
172 CallOptionPopup* __pOptionPopup;
173 Tizen::Ui::Controls::Label* __pSmallPhotoLabel;
176 #endif // _PHN_INCOMING_CALL_FORM_H_