Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnTabLogs.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file                PhnTabLogs.h
19  * @brief               This is the header file for the %DialTabLogs class.
20  *
21  * This header file contains the declarations for %DialTabLogs class.
22  */
23 #ifndef _PHN_TAB_LOGS_H_
24 #define _PHN_TAB_LOGS_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28 #include "PhnTabLogsItemProvider.h"
29 #include "PhnICalllogChangeListener.h"
30 //#include "calllog.h"
31
32 class CallLogDetails;
33 class CallLogManager;
34
35 /**
36  * @class DialTabLogs
37  * @brief This class provides tab based UI for Call Log.
38  *
39  */
40 class DialTabLogs
41         : public Tizen::Ui::Controls::Panel
42         , public Tizen::Ui::Scenes::ISceneEventListener
43         , public Tizen::Ui::Controls::IGroupedListViewItemEventListener
44         , public Tizen::Ui::IActionEventListener
45         , public ICalllogChangeListener
46 {
47 public:
48         ///DialTabLogs constructor
49         DialTabLogs(void);
50
51         ///DialTabLogs destructor
52         virtual ~DialTabLogs(void);
53
54         ///Initializes the DialTabLogs form
55         /*
56          * @param: Whether Initialize is success or not
57          */
58         bool Initialize(void);
59
60         ///This functions gets called during form OnInitializing
61         /*
62          * @param: result
63          */
64         virtual result OnInitializing(void);
65
66         ///This functions gets called during form terminating
67         /*
68          * @param: result
69          */
70         virtual result OnTerminating(void);
71
72         void SetCallLogDisplayMode(bool isEdit);
73
74         void UnCheckAllItems(void);
75
76         ///IActionEventListener
77         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
78         ///ISceneEventListener
79         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
80
81         ///ISceneEventListener
82         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
83
84         /// IGroupedListViewItemEventListener
85         virtual void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
86         /// IGroupedListViewItemEventListener
87         virtual void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus state);
88         /// IGroupedListViewItemEventListener
89         virtual void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction);
90         /// ICalllogChangeListener
91         virtual void OnCalllogChanged(void);
92
93         void SetListItemSelectStatus(bool status);
94
95         void DeleteSelectedCalllog(void);
96
97 private:
98         //used to handle 'IDA_CHECKBUTTON_SELECT_ALL'
99         void HandleAllItemSelection(void);
100
101 protected:
102         static const int IDA_FOOTER_LOG_DELETE = 105;
103         static const int IDA_FOOTER_LOG_CANCEL = 106;
104         static const int IDA_CHECKBUTTON_SELECT_ALL = 108;
105         static const int IDA_CHECKBUTTON_UNSELECT_ALL = 109;
106
107 private:
108         ///Form Footer
109         Tizen::Ui::Controls::Footer* __pFormFooter;
110
111         ///Delete footer item
112         Tizen::Ui::Controls::FooterItem __footerItemDelete;
113
114         ///Cancel footer item
115         Tizen::Ui::Controls::FooterItem __footerItemCancel;
116
117         ///Grouped list view
118         Tizen::Ui::Controls::GroupedListView* __plogsListView;
119
120         ///Grouped list view
121         Tizen::Ui::Controls::CheckButton* __pButtonSelectAll;
122
123         //Selected pop up label
124         Tizen::Ui::Controls::Label* __pSelectedLabel;
125
126         ///Grouped list view item provider
127         CustomDataProvider* __pDataProvider;
128
129         CallLogManager* __pCallMgr;
130         int __groupCount;
131         int __itemCount;
132         bool __isSelectAll;
133         int __selectedItemCount;
134         bool __isEditMode;
135         int calllogCount;
136         Tizen::Base::Collection::ArrayList* __pArgs;
137 };
138
139 #endif // _PHN_TAB_LOGS_H_