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 PhnLogsDetailForm.h
19 * @brief This is the header file for the %DlLogsDetailForm class.
21 * This header file contains the declarations for %DlLogsDetailForm class.
23 #ifndef _PHN_LOGS_DETAIL_FORM_H_
24 #define _PHN_LOGS_DETAIL_FORM_H_
27 #include <FSysSettingInfo.h>
29 #include "PhnCallLogPresentationModel.h"
30 #include "PhnCallLogViewByPopup.h"
31 #include "PhnIAppStateChangeListner.h"
32 #include "PhnICallLogViewByPopupListener.h"
33 #include "PhnLogsDetailItemProvider.h"
39 * @class DlLogsDetailForm
40 * @brief This class presents a form based UI for call log details scene.
43 class DlLogsDetailForm
44 : public Tizen::Ui::Controls::Form
45 , public Tizen::Ui::IActionEventListener
46 , public Tizen::App::IAppControlResponseListener
47 , public Tizen::Ui::Controls::IFormBackEventListener
48 , public Tizen::Ui::IOrientationEventListener
49 , public Tizen::Ui::Scenes::ISceneEventListener
50 , public Tizen::Ui::IWindowEventListener
51 , public Tizen::Base::Runtime::ITimerEventListener
52 , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
53 , public IAppStateChangeListener
54 , public ICalllogChangeListener
55 , public ICallLogViewByPopupListener
56 , public Tizen::Ui::Controls::IFormMenuEventListener
57 , public Tizen::Ui::IPropagatedKeyEventListener
58 , public Tizen::System::ISettingEventListener
63 ///DlLogsDetailForm constructor
64 DlLogsDetailForm(void);
66 ///DlLogsDetailForm destructor
67 virtual ~DlLogsDetailForm(void);
69 ///Initializes the DlLogsDetailForm form
71 * @param: Whether Initialize is success or not
75 ///This functions gets called during form OnInitializing
79 result OnInitializing(void);
81 ///This functions gets called during form terminating
85 result OnTerminating(void);
87 ///IActionEventListener
88 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
90 ///IFormBackEventListener method
91 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
93 void SetFormMode(bool mode);
95 void SetAllListItems(bool checked);
97 void UnCheckAllItems(void);
99 void GetUpdatedListFromDatabase();
101 bool DeleteSelectedCalllog(void);
103 /// IGroupedListViewItemEventListener
104 virtual void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus state){}
105 virtual void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus state);
106 virtual void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction){}
108 ///ISceneEventListener
109 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
110 ///ISceneEventListener
111 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
112 void UpdateForm(void);
114 * Called when the application control is completed.
116 virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
117 //IPropagatedKeyEventListener
118 virtual bool OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo);
119 virtual bool OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
120 virtual bool OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
121 virtual bool OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
122 virtual bool TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo) { return false; }
124 void ShowDeletePopup(void);
125 void HideDeletePopup(void);
126 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer &timer);
127 virtual void OnWindowActivated(const Tizen::Ui::Window &source);
128 virtual void OnWindowDeactivated(const Tizen::Ui::Window &source){}
129 result RemoveLogsList();
131 //Called when App comes to foreground
132 virtual void OnForeground(void);
133 //Called when App goes to background
134 virtual void OnBackground(void);
136 void SetListItemSelectStatus(bool status);
137 //Called when callog list changes
138 virtual void OnCalllogChanged(void);
140 void StoreItemselection(int groupIndex, int itemIndex, int elementId, ListItemStatus state);
141 void ManageItemSelection(void);
142 bool IsScecneVisible();
143 void SetSceneVisible(bool sceneMode);
144 void ShowBlockPopup(void);
\r
145 //Used to show error message box
146 void ShowDuplicateErrorMessageBox(Tizen::Base::String& message);
147 void ShowInvalidMessageNumberMessageBox(Tizen::Base::String& message);
148 void ShowInvalidNumberMessageBox(String& number);
150 virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
151 //From IPopupEventListener
152 void OnItemSelected();
153 void ViewContactDetail(void);
154 //void ShowContextMenu();
155 ///IOrientationEventListener
156 virtual void OnOrientationChanged(const Control& source, Tizen::Ui::OrientationStatus orientationStatus);
157 //ISettingEventListener
158 virtual void OnSettingChanged(Tizen::Base::String& key);
159 //IFormMenuEventListener
160 virtual void OnFormMenuRequested(Tizen::Ui::Controls::Form& source);
161 void ShowOptionsMenu();
162 void ManageUserDetail();
163 void GetTextWidthHeight(String str, float fontSize, float *width, float *height);
165 bool IsValidMessageNumber(const String& phoneNumber);
166 bool IsValidCallNumber(const String& phoneNumber);
167 void ShowDeleteConfirmationPopup();
170 Tizen::Ui::Controls::Button* __pButtonCall;
173 Tizen::Ui::Controls::Button* __pButtonMessage;
176 Tizen::Ui::Controls::Button* __pButtonContactImage;
179 Tizen::Ui::Controls::Panel* __pPanelName;
180 Tizen::Ui::Controls::Panel* __pPanelNumberUnsaved;
183 Tizen::Ui::Controls::Label* __pLabelNumber;
184 Tizen::Ui::Controls::Label* __pLabelBlocked;
187 Tizen::Ui::Controls::Footer* __pFormFooter;
189 ///More option footer item
190 Tizen::Ui::Controls::ButtonItem __footerItemMore;
192 ///Delete footer item
193 Tizen::Ui::Controls::FooterItem __pFooterItemDelete;
196 Tizen::Ui::Controls::GroupedListView* __pList;
198 Tizen::Ui::Controls::CheckButton* __pSelectAll;
200 //Selected pop up label
201 Tizen::Ui::Controls::Label* __pSelectedLabel;
203 LogsDetailItemProvider* __pDataProvider;
205 //Used only when device has HardWare key
206 Tizen::Ui::Controls::OptionMenu* __pOptionMenu;
215 bool __isPresentInContacts;
218 int __selectedItemCount;
219 Tizen::Base::Collection::ArrayListT<CallLogDetails>* __calllogListByNum;
220 CalLogPresentationModel* __pLogPresentor;
222 Tizen::Base::String __number;
223 bool __isMsgAppControlLaunched;
224 bool __isCallAppControlLaunched;
227 Tizen::Base::Runtime::Timer __deleteLogsTimer;
228 Tizen::Ui::Controls::Popup* __pDeletePopup;
229 Tizen::Ui::Controls::Popup* __pConfirmationDeletePopup;
231 int __deleteGroupIndex;
232 int __deleteItemIndex;
234 Tizen::Base::Collection::ArrayList* __pCallLogId;
235 CallLogViewByPopup* __pLogsBlockPopup;
\r
236 bool __isSceneVisible;
237 bool __isContactAppControlLaunched;
238 bool __isCallBeRejected;
239 bool __isMsgBeRejected;
240 Tizen::Base::String __contactName;
241 bool __isDeleteInProgress;
244 #endif /*_PHN_LOGS_DETAIL_FORM_H_*/