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 CtGroupListPresentationModel.h
19 * @brief This is the header file for the GroupListPresentationModel class.
22 #ifndef _CT_GROUP_LIST_PRESENTATION_MODEL_H_
23 #define _CT_GROUP_LIST_PRESENTATION_MODEL_H_
29 class IContactEventListener;
31 class GroupListPresentationModel
32 : public Tizen::Social::IAddressbookChangeEventListener
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);
54 virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
55 virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList);
57 static GroupListPresentationModel* GetInstance(void);
60 GroupListPresentationModel(void);
62 static void CreateInstance(void);
63 static void DestroyInstance(void);
66 Tizen::Social::Addressbook* __pAddressbook;
67 Tizen::Base::Collection::IList* __pCategoryList;
68 Tizen::Base::Collection::IList* __pPersonList;
69 Tizen::Base::Collection::ArrayList* __pCategoryChangeListener;
71 static GroupListPresentationModel* __pInstance;
74 #endif /* _CT_GROUP_LIST_PRESENTATION_MODEL_H_ */