Initialize Tizen 2.3
[apps/osp/Contacts.git] / inc / CtGroupListPresentationModel.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
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        CtGroupListPresentationModel.h
19  * @brief       This is the header file for the GroupListPresentationModel class.
20  */
21
22 #ifndef _CT_GROUP_LIST_PRESENTATION_MODEL_H_
23 #define _CT_GROUP_LIST_PRESENTATION_MODEL_H_
24
25 #include <FBase.h>
26 #include <FSocial.h>
27 #include "CtTypes.h"
28
29 class IContactEventListener;
30
31 class GroupListPresentationModel
32         : public Tizen::Social::IAddressbookChangeEventListener
33 {
34 public:
35         virtual ~GroupListPresentationModel(void);
36         result Construct(void);
37         result RemoveCategory(int index);
38         Tizen::Base::String GetCategoryName(int index);
39         Tizen::Base::Collection::IList* GetContactIdListInCategory(int index);
40         bool IsContactInCategory(const Tizen::Base::Collection::IList& categoryIdList, int categoryIndex);
41         bool IsDefaultCategory(int index);
42         Tizen::Social::RecordId GetCategoryId(int index);
43         int GetContactCountInCategoryN(int index, Tizen::Base::Collection::IList*& pList, AppControlReturnType returnType = APP_CONTROL_RETURN_TYPE_NONE);
44         int GetContactCountInNotAssignedCategory(AppControlReturnType returnType = APP_CONTROL_RETURN_TYPE_NONE);
45         int GetCategoryCount(void);
46         int GetContactCount(void);
47         Tizen::Graphics::Bitmap* GetThumbnailN(int index, Tizen::Base::Collection::IList* pList);
48         result UpdatePersonList(int categoryIndex);
49         result UpdateCategoryList(void);
50         result AddContactToCategory(int index, Tizen::Base::Collection::IList* pList);
51         void AddGroupChangeListener(const IContactEventListener& listener);
52         void RemoveGroupChangeListener(const IContactEventListener& listener);
53
54         virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
55         virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList);
56
57         static GroupListPresentationModel* GetInstance(void);
58
59 private:
60         GroupListPresentationModel(void);
61
62         static void CreateInstance(void);
63         static void DestroyInstance(void);
64
65 private:
66         Tizen::Social::Addressbook* __pAddressbook;
67         Tizen::Base::Collection::IList* __pCategoryList;
68         Tizen::Base::Collection::IList* __pPersonList;
69         Tizen::Base::Collection::ArrayList* __pCategoryChangeListener;
70
71         static GroupListPresentationModel* __pInstance;
72 };
73
74 #endif /* _CT_GROUP_LIST_PRESENTATION_MODEL_H_ */