1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
//
// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
* @file FScl_AddressbookImpl.h
* @brief This is the header file for the _AddressbookImpl class.
*
* This header file contains the declarations of the _AddressbookImpl class.
*/
#ifndef _FSCL_INTERNAL_ADDRESSBOOK_IMPL_H_
#define _FSCL_INTERNAL_ADDRESSBOOK_IMPL_H_
#include <unique_ptr.h>
#include <contacts.h>
#include <FBaseObject.h>
#include "FScl_IContactDbChangeEventListener.h"
namespace Tizen { namespace Base {
class String;
namespace Collection {
class IList;
template<class Type> class IListT;
}
}}
namespace Tizen { namespace Social
{
class Addressbook;
class Contact;
class Category;
class IRecordEventListener;
class IAddressbookEventListener;
/**
* @class _AddressbookImpl
* @brief This class handles the _AddressbookImpl operations.
* @since 2.0
* @see Addressbook
*
*/
class _AddressbookImpl
: public Tizen::Base::Object
, virtual public _IContactDbChangeEventListener
{
public:
/**
* This is default constructor for the class.
*
* @since 2.0
*/
_AddressbookImpl(void);
/**
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
*/
virtual ~_AddressbookImpl(void);
result Construct(void);
result SetRecordEventListener(IRecordEventListener* pListener);
result SetAddressbookEventListener(IAddressbookEventListener* pListener);
void SetId(AddressbookId addressbookId);
void SetAccountId(AccountId accountId);
void SetName(const Tizen::Base::String& name);
AddressbookId GetId(void) const;
AccountId GetAccountId(void) const;
Tizen::Base::String GetName(void) const;
result AddContact(Contact& contact);
result AddCategory(Category& category);
result RemoveContact(RecordId contactId);
result RemoveContact(Contact& contact);
result RemoveCategory(RecordId categoryId);
result UpdateContact(const Contact& contact);
result UpdateCategory(const Category& category);
Tizen::Base::Collection::IList* GetAllContactsN(void) const;
Tizen::Base::Collection::IList* GetContactsByCategoryN(RecordId categoryId) const;
Tizen::Base::Collection::IListT<RecordId>* GetContactIdsByCategoryN(RecordId categoryId) const;
result AddMemberToCategory(RecordId categoryId, RecordId contactId);
result RemoveMemberFromCategory(RecordId categoryId, RecordId contactId);
Tizen::Base::Collection::IList* GetAllCategoriesN(void) const;
Tizen::Base::Collection::IList* GetCategoriesByContactN(RecordId contactId) const;
Tizen::Base::Collection::IList* GetContactsN(int pageNo, int countPerPage) const;
Tizen::Base::Collection::IList* GetContactsInN(const Category& category, int pageNo, int countPerPage) const;
Tizen::Base::Collection::IList* SearchContactsByEmailN(const Tizen::Base::String& email) const;
Tizen::Base::Collection::IList* SearchContactsByNameN(const Tizen::Base::String& name) const;
Tizen::Base::Collection::IList* SearchContactsByPhoneNumberN(const Tizen::Base::String& phoneNumber) const;
int GetCategoryCount(void) const;
int GetContactCount(void) const;
Contact* GetContactN(RecordId contactId) const;
Category* GetCategoryN(RecordId categoryId) const;
int GetLatestVersion(void) const;
Tizen::Base::Collection::IList* GetChangedContactsAfterN(int version, int& latestVersion) const;
Tizen::Base::Collection::IList* GetChangedCategoriesAfterN(int version, int& latestVersion) const;
virtual void OnContactChanged(void);
virtual void OnCategoryChanged(void);
virtual void OnRelationChanged(void);
static _AddressbookImpl* GetInstance(Addressbook& addressbook);
static const _AddressbookImpl* GetInstance(const Addressbook& addressbook);
private:
/**
* The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
*
* @since 2.0
*/
_AddressbookImpl(const _AddressbookImpl& rhs);
Tizen::Base::Collection::IList* GetChangedGroupsAfterN(int, int&) const;
Tizen::Base::Collection::IList* GetChangedRelationsAfterN(int, int&) const;
/**
* The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
*
* @since 2.0
*/
_AddressbookImpl& operator =(const _AddressbookImpl& rhs);
private:
IRecordEventListener* __pIRecordEventListener;
IAddressbookEventListener* __pIAddressbookEventListener;
int __dbVersionForContact;
int __dbVersionForGroup;
int __dbVersionForRelation;
AddressbookId __addressbookId;
AccountId __accountId;
Tizen::Base::String __name;
}; // _AddressbookImpl
}} // Tizen::Social
#endif //_FSCL_INTERNAL_ADDRESSBOOK_IMPL_H_
|