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 CtFavoriteListPresentationModel.h
19 * @brief This is the header file for the FavoriteListPresentationModel class.
22 #ifndef _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_
23 #define _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_
29 class IContactEventListener;
31 class FavoriteListPresentationModel
32 : public Tizen::Social::IAddressbookChangeEventListener
35 FavoriteListPresentationModel(void);
36 virtual ~FavoriteListPresentationModel(void);
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);
53 static FavoriteListPresentationModel* GetInstance(void);
55 virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
56 virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList);
59 static void CreateInstance(void);
60 static void DestroyInstance(void);
63 Tizen::Base::Collection::IList* __pFavoriteList;
64 Tizen::Base::Collection::ArrayList* __pContactListenerList;
65 Tizen::Social::Addressbook* __pAddressbook;
67 static FavoriteListPresentationModel* __pInstance;
71 #endif /* _CT_FAVORITE_LIST_PRESENTATION_MODEL_H_ */