Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnTabLogsItemProvider.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                PhnTabLogsItemProvider.h
19  * @brief               This is the header file for the %CustomDataProvider class.
20  *
21  * This header file contains the declarations for %CustomDataProvider class.
22  */
23 #include <FBase.h>
24 #include <FUi.h>
25 #include <FSocial.h>
26 #include "PhnCalllogManager.h"
27
28 #ifndef _PHN_TAB_LOGS_ITEM_PROVIDER_H_
29 #define _PHN_TAB_LOGS_ITEM_PROVIDER_H_
30
31 using namespace Tizen::Ui;
32 using namespace Tizen::Ui::Controls;
33
34 class GroupItemClass;
35
36 /**
37  * @class CustomDataProvider
38  * @brief This class provides base class for item providers of calllog application
39  *
40  */
41 class CustomDataProvider
42         : public Tizen::Ui::Controls::IGroupedListViewItemProvider
43 {
44 public:
45         CustomDataProvider(void);
46         virtual ~CustomDataProvider(void);
47
48         void SetListItemStyle(bool mode);
49
50         // IGroupedListViewItemProvider
51         virtual int GetGroupCount(void);
52         virtual int GetItemCount(int groupIndex);
53         virtual Tizen::Ui::Controls::GroupItem* CreateGroupItem(int groupIndex, int itemWidth);
54         virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::GroupItem* pItem, int itemWidth);
55         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int groupIndex, int itemIndex, int itemWidth);
56         virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
57
58         bool GetCurrentDateTime(Tizen::Base::DateTime& dt);
59         void CreateGroupItems(void);
60         bool IsGroupPresent(GroupItemClass* group);
61         GroupItemClass* GetGroupWithTitle(Tizen::Base::String title);
62         int GetDaysDifferenceBetweenDates(Tizen::Base::DateTime date1, Tizen::Base::DateTime date2);
63         void GetItemAtGroupIndex(int groupIndex, int itemIndex, CallLogDetails** pCalllogDetails);
64         void DeleteItemAtGroupIndex(int groupIndex, int itemIndex);
65         void DeleteAllItems(void);
66
67 private:
68         bool __isEditStyle;
69         Tizen::Base::Collection::ArrayList* __pGroupData;
70         Tizen::Social::Addressbook* __pAddressBook;
71         Tizen::Ui::Controls::ListContextItem* __pItemContext;
72
73 };
74
75 /**
76  * @class GroupItemClass
77  * @brief This class helps in storing group item data
78  *
79  */
80 class GroupItemClass
81         :public Tizen::Base::Object
82 {
83 private:
84         Tizen::Base::String __titleText;
85         Tizen::Base::Collection::ArrayList* __pData;
86
87 public:
88         GroupItemClass(void);
89         virtual ~GroupItemClass(void);
90
91         /**
92          * This function sets the titleText for the History object
93          *
94          * @return      No return type
95          * @param               titleText                               The titleText for the History
96          */
97         void SetTitleText(Tizen::Base::String titleText);
98
99         /**
100          * This function sets the data for the History object
101          *
102          * @return      No return type
103          * @param               pData                           The data for the History
104          */
105         void SetLogData(Tizen::Base::Collection::ArrayList* pData);
106
107         /**
108          * This function gets the GetTitleText of History
109          *
110          * @return      A String
111          * @param               No parameter
112          */
113         Tizen::Base::String GetTitleText(void);
114
115         /**
116          * This function gets the GetHistoryData of History
117          *
118          * @return      A Pointer to ArrayList
119          * @param               No parameter
120          */
121         Tizen::Base::Collection::ArrayList* GetLogData(void);
122 };
123 #endif /* _PHN_TAB_LOGS_ITEM_PROVIDER_H_ */