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.
19 * @brief This is the header file for the %DialTabLogs class.
21 * This header file contains the declarations for %DialTabLogs class.
23 #ifndef _PHN_TAB_LOGS_H_
24 #define _PHN_TAB_LOGS_H_
28 #include <FSysSettingInfo.h>
30 #include "PhnTabLogsItemProvider.h"
31 #include "PhnICalllogChangeListener.h"
32 #include "PhnCallLogPresentationModel.h"
33 #include "PhnIAppStateChangeListner.h"
34 #include "PhnCallLogViewByPopup.h"
35 #include "PhnICallLogViewByPopupListener.h"
36 //#include "calllog.h"
43 * @brief This class provides tab based UI for Call Log.
47 : public Tizen::Ui::Controls::Panel
48 , public Tizen::Ui::Scenes::ISceneEventListener
49 , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
50 , public Tizen::Ui::IActionEventListener
51 , public ICalllogChangeListener
52 , public Tizen::Ui::IWindowEventListener
53 , public Tizen::Ui::IOrientationEventListener
54 , public Tizen::Base::Runtime::ITimerEventListener
55 , public Tizen::Social::IAddressbookChangeEventListener
56 , public IAppStateChangeListener
57 , public ICallLogViewByPopupListener
58 , public Tizen::Ui::IPropagatedKeyEventListener
59 , public Tizen::System::ISettingEventListener
62 ///DialTabLogs constructor
65 ///DialTabLogs destructor
66 virtual ~DialTabLogs(void);
68 ///Initializes the DialTabLogs form
70 * @param: Whether Initialize is success or not
72 bool Initialize(void);
74 ///This functions gets called during form OnInitializing
78 virtual result OnInitializing(void);
80 ///This functions gets called during form terminating
84 virtual result OnTerminating(void);
86 void SetCallLogDisplayMode(bool isEdit);
88 void UnCheckAllItems(void);
90 ///IActionEventListener
91 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
92 ///ISceneEventListener
93 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
95 ///ISceneEventListener
96 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
98 /// IGroupedListViewItemEventListener
99 virtual void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
100 /// IGroupedListViewItemEventListener
101 virtual void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus state);
102 /// IGroupedListViewItemEventListener
103 virtual void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction);
104 /// ICalllogChangeListener
105 virtual void OnCalllogChanged(void);
107 void SetListItemSelectStatus(bool status);
109 void DeleteSelectedCalllog(void);
111 void ShowDeletePopup(void);
112 void HideDeletePopup(void);
113 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer &timer);
114 virtual void OnWindowActivated(const Tizen::Ui::Window &source);
115 virtual void OnWindowDeactivated(const Tizen::Ui::Window &source){}
116 result RemoveLogsList(void);
118 virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
120 //Called when App comes to foreground
121 virtual void OnForeground(void);
122 //Called when App goes to background
123 virtual void OnBackground(void);
125 void StoreItemselection(int groupIndex, int itemIndex, int elementId, ListItemStatus state);
126 void ManageItemSelection(void);
127 bool IsScecneVisible();
128 void SetSceneVisible(bool sceneMode);
129 void ShowLogsViewByPopup(void);
131 //From IPopupEventListener
132 void OnItemSelected();
133 void ShowContextMenu();
134 ///IOrientationEventListener
135 virtual void OnOrientationChanged(const Control& source, Tizen::Ui::OrientationStatus orientationStatus);
136 //From IAddressbookEventListener
137 virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
138 virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList){};
139 void UpdateCallLogList(void);
140 //ISettingEventListener
141 virtual void OnSettingChanged(Tizen::Base::String& key);
142 void ShowOptionsMenu();
144 void HandleFormBackRequest();
145 void ShowDeleteConfirmationPopup(int deleteCommandIdYes);
147 //IPropagatedKeyEventListener
148 virtual bool OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo);
149 virtual bool OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
150 virtual bool OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
151 virtual bool OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo){ return false; }
152 virtual bool TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo) { return false; }
155 //used to handle 'IDA_CHECKBUTTON_SELECT_ALL'
156 void HandleAllItemSelection(void);
159 //static const int IDA_FOOTER_LOG_MORE = 103;
160 static const int IDA_CONTEXTMENU_VIEWBY = 104;
161 static const int IDA_FOOTER_LOG_DELETE = 105;
162 static const int IDA_FOOTER_LOG_CANCEL = 106;
163 static const int IDA_CHECKBUTTON_SELECT_ALL = 108;
164 static const int IDA_CHECKBUTTON_UNSELECT_ALL = 109;
165 static const int IDA_POPUP_DELETE_CANCEL = 110;
166 static const int IDA_POPUP_DELETE_YES = 111;
167 static const int IDA_POPUP_DELETE_NO = 112;
168 static const int IDA_POPUP_DELETEALL_YES = 113;
172 Tizen::Ui::Controls::Footer* __pFormFooter;
174 ///More option footer item
175 Tizen::Ui::Controls::ButtonItem __footerItemMore;
177 ///Delete footer item
178 Tizen::Ui::Controls::FooterItem __footerItemDelete;
181 Tizen::Ui::Controls::GroupedListView* __plogsListView;
184 Tizen::Ui::Controls::CheckButton* __pButtonSelectAll;
186 //Selected pop up label
187 Tizen::Ui::Controls::Label* __pSelectedLabel;
189 //Used only when device has HardWare key
190 Tizen::Ui::Controls::OptionMenu* __pOptionMenu;
192 Tizen::Social::Addressbook* __pAddressbook;
194 ///Grouped list view item provider
195 CustomDataProvider* __pDataProvider;
197 CalLogPresentationModel* __pLogPresentor;
201 int __selectedItemCount;
204 Tizen::Base::Collection::ArrayList* __pArgs;
205 Tizen::Base::Runtime::Timer __deleteLogsTimer;
206 Tizen::Ui::Controls::Popup* __pDeletePopup;
207 Tizen::Ui::Controls::Popup* __pConfirmationDeletePopup;
208 int __deleteGroupIndex;
209 int __deleteItemIndex;
210 Tizen::Base::Collection::ArrayList* __pCallLogId;
211 bool __isSceneVisible;
212 CallLogViewByPopup* __pLogsViewbyPopup;
213 bool __isMsgAppControlLaunched;
214 bool __isCallAppControlLaunched;
215 bool __isDeleteInProgress;
220 #endif // _PHN_TAB_LOGS_H_