Initialize Tizen 2.3
[apps/osp/Contacts.git] / inc / CtFavoriteListPresentationModel.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        CtFavoriteListPresentationModel.h
19  * @brief       This is the header file for the FavoriteListPresentationModel class.
20  */
21
22 #ifndef _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_
23 #define _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_
24
25 #include <FBase.h>
26 #include <FSocial.h>
27 #include "CtTypes.h"
28
29 class IContactEventListener;
30
31 class FavoriteListPresentationModel
32 : public Tizen::Social::IAddressbookChangeEventListener
33 {
34 public:
35         FavoriteListPresentationModel(void);
36         virtual ~FavoriteListPresentationModel(void);
37
38         result Construct(void);
39         result InitializeFavoriteList(AppControlReturnType returnType = APP_CONTROL_RETURN_TYPE_NONE);
40         int GetFavoriteCount(void);
41         int GetContactCount(void);
42         result GetFavoriteItemInfo(int index, Tizen::Base::String& name, Tizen::Graphics::Bitmap*& pThumbnail);
43         Tizen::Base::Collection::IList* GetMultiValuesN(AppControlReturnType returnType, int index);
44         Tizen::Social::RecordId GetContactId(int index);
45         result SetAsFavorite(Tizen::Social::RecordId contactId, bool isFavorite);
46         Tizen::Base::String GetDefaultPhoneNumber(int index);
47         Tizen::Base::String GetDefaultEmail(int index);
48         Tizen::Base::String ExportToVcard(int index);
49         Tizen::Base::String ExportToVcard(const Tizen::Base::Collection::IList& contactList);
50         void AddContactChangeListener(const IContactEventListener& listener);
51         void RemoveContactChangeListener(const IContactEventListener& listener);
52
53         static FavoriteListPresentationModel* GetInstance(void);
54
55         virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
56         virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList);
57
58 private:
59         static void CreateInstance(void);
60         static void DestroyInstance(void);
61
62 private:
63         Tizen::Base::Collection::IList* __pFavoriteList;
64         Tizen::Base::Collection::ArrayList* __pContactListenerList;
65         Tizen::Social::Addressbook* __pAddressbook;
66
67         static FavoriteListPresentationModel* __pInstance;
68 };
69
70
71 #endif /* _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_ */