Fixed the issue that IsDefault() returns false for default categories
[framework/osp/social.git] / src / FScl_CategoryImpl.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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  * @file                FScl_CategoryImpl.cpp
18  * @brief               This is the implementation for _CategoryImpl class.
19  *
20  * This file contains definitions of _CategoryImpl class.
21  */
22
23 #include <new>
24 #include <FBaseString.h>
25 #include <FBaseColArrayListT.h>
26 #include <FSclAddressbook.h>
27 #include <FSclCategory.h>
28 #include <FBaseSysLog.h>
29 #include <FIoFile.h>
30 #include <FBase_StringConverter.h>
31 #include <FApp_AppInfo.h>
32 #include "FScl_RecordImpl.h"
33 #include "FScl_AddressbookImpl.h"
34 #include "FScl_AddressbookUtil.h"
35 #include "FScl_CategoryImpl.h"
36 #include "FScl_ContactDbConnector.h"
37
38 using namespace Tizen::App;
39 using namespace Tizen::Base;
40 using namespace Tizen::Base::Collection;
41 using namespace Tizen::Io;
42
43 namespace Tizen { namespace Social
44 {
45 _CategoryImpl::_CategoryImpl(void)
46         : __hasMemberList(false)
47         , __memberCount(0)
48         , __pMembers(null)
49         , __pAddedMembers(null)
50         , __pRemovedMembers(null)
51 {
52         result r = E_SUCCESS;
53         int ret = CONTACTS_ERROR_NONE;
54         contacts_record_h recordHandle = null;
55
56         SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
57
58         std::unique_ptr< ArrayListT<int> > pMembers (new (std::nothrow) ArrayListT<int>());
59         SysTryReturnVoidResult(NID_SCL, pMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
60
61         r = pMembers->Construct();
62         SysTryReturnVoidResult(NID_SCL, !IsFailed(r), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
63
64         std::unique_ptr< ArrayListT<int> > pAddedMembers (new (std::nothrow) ArrayListT<int>());
65         SysTryReturnVoidResult(NID_SCL, pAddedMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
66
67         r = pAddedMembers->Construct();
68         SysTryReturnVoidResult(NID_SCL, !IsFailed(r), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
69
70         std::unique_ptr< ArrayListT<int> > pRemovedMembers (new (std::nothrow) ArrayListT<int>());
71         SysTryReturnVoidResult(NID_SCL, pRemovedMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
72
73         r = pRemovedMembers->Construct();
74         SysTryReturnVoidResult(NID_SCL, !IsFailed(r), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
75
76         ret = contacts_record_create(_contacts_group._uri, &recordHandle);
77         SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
78
79         __pMembers = std::move(pMembers);
80         __pAddedMembers = std::move(pAddedMembers);
81         __pRemovedMembers = std::move(pRemovedMembers);
82
83         __recordHandle = recordHandle;
84
85         return;
86 }
87
88 _CategoryImpl::_CategoryImpl(const _CategoryImpl& rhs)
89         : __hasMemberList(false)
90         , __memberCount(0)
91         , __pMembers(null)
92         , __pAddedMembers(null)
93         , __pRemovedMembers(null)
94 {
95         int ret = CONTACTS_ERROR_NONE;
96         contacts_record_h recordHandle = null;
97
98         SysTryReturnVoidResult(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
99
100         std::unique_ptr< IListT<int> > pMembers (rhs.GetMembersN());
101         SysTryReturnVoidResult(NID_SCL, pMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
102
103         std::unique_ptr< IListT<int> > pAddedMembers (rhs.GetAddedMembersN());
104         SysTryReturnVoidResult(NID_SCL, pAddedMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
105
106         std::unique_ptr< IListT<int> > pRemovedMembers (rhs.GetRemovedMembersN());
107         SysTryReturnVoidResult(NID_SCL, pRemovedMembers != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
108
109         ret = contacts_record_clone(rhs.__recordHandle, &recordHandle);
110         SysTryReturnVoidResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
111
112         __hasMemberList = rhs.__hasMemberList;
113         __memberCount = rhs.__memberCount;
114
115         __pMembers = std::move(pMembers);
116         __pAddedMembers = std::move(pAddedMembers);
117         __pRemovedMembers = std::move(pRemovedMembers);
118
119         __recordHandle = recordHandle;
120
121         return;
122 }
123
124 _CategoryImpl::~_CategoryImpl(void)
125 {
126         if (__recordHandle != null)
127         {
128                 contacts_record_destroy(__recordHandle, true);
129         }
130 }
131
132 _CategoryImpl&
133 _CategoryImpl::operator =(const _CategoryImpl& rhs)
134 {
135         if (this == &rhs)
136         {
137                 return *this;
138         }
139
140         int ret = CONTACTS_ERROR_NONE;
141         contacts_record_h recordHandle = null;
142
143         std::unique_ptr< IListT<int> > pMembers (rhs.GetMembersN());
144         SysTryReturn(NID_SCL, pMembers != null, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
145
146         std::unique_ptr< IListT<int> > pAddedMembers (rhs.GetAddedMembersN());
147         SysTryReturn(NID_SCL, pAddedMembers != null, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
148
149         std::unique_ptr< IListT<int> > pRemovedMembers (rhs.GetRemovedMembersN());
150         SysTryReturn(NID_SCL, pRemovedMembers != null, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
151
152         ret = contacts_record_clone(rhs.__recordHandle, &recordHandle);
153         SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, *this, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
154
155         __hasMemberList = rhs.__hasMemberList;
156         __memberCount = rhs.__memberCount;
157
158         __pMembers = std::move(pMembers);
159         __pAddedMembers = std::move(pAddedMembers);
160         __pRemovedMembers = std::move(pRemovedMembers);
161
162
163         contacts_record_destroy(__recordHandle, true);
164         __recordHandle = recordHandle;
165
166         return *this;
167 }
168
169 bool
170 _CategoryImpl::IsDefault(void) const
171 {
172         char* pCharValue = null;
173
174         contacts_record_get_str_p(__recordHandle, _contacts_group.extra_data, &pCharValue);
175         if (pCharValue != null)
176         {
177                 return true;
178         }
179
180         return false;
181 }
182
183 void
184 _CategoryImpl::SetRecordHandle(contacts_record_h recordHandle)
185 {
186         contacts_record_destroy(__recordHandle, true);
187
188         __recordHandle = recordHandle;
189 }
190
191 contacts_record_h
192 _CategoryImpl::GetRecordHandle(void) const
193 {
194         return __recordHandle;
195 }
196
197 result
198 _CategoryImpl::AddMember(RecordId contactId)
199 {
200         SysTryReturn(NID_SCL, contactId != INVALID_RECORD_ID, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. contactId = %d.", GetErrorMessage(E_INVALID_ARG), contactId);
201
202         result r = E_SUCCESS;
203         int tableId = contactId;
204
205         if (!__hasMemberList)
206         {
207                 r = LoadMemberList();
208                 SysTryReturn(NID_SCL, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
209         }
210
211         SysTryReturn(NID_SCL, !HasMember(contactId), E_OBJ_ALREADY_EXIST, E_OBJ_ALREADY_EXIST, "[%s] The member already exist in the category.", GetErrorMessage(E_OBJ_ALREADY_EXIST));
212
213         r = __pMembers->Add(tableId);
214         SysTryReturnResult(NID_SCL, !IsFailed(r), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
215
216         if (__pRemovedMembers->Contains(tableId))
217         {
218                 __pRemovedMembers->Remove(tableId);
219         }
220         else
221         {
222                 result r = __pAddedMembers->Add(tableId);
223                 if (IsFailed(r))
224                 {
225                         __pMembers->Remove(tableId);
226
227                         SysLogException(NID_SCL, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
228
229                         return r;
230                 }
231         }
232
233         __memberCount++;
234
235         return E_SUCCESS;
236 }
237
238 int
239 _CategoryImpl::GetMemberCount(void) const
240 {
241         return __memberCount;
242 }
243
244 void
245 _CategoryImpl::SetMemberCount(int memberCount)
246 {
247         __memberCount = memberCount;
248 }
249
250 String
251 _CategoryImpl::GetName(void) const
252 {
253         char* pCharValue = null;
254
255         contacts_record_get_str_p(__recordHandle, _contacts_group.name, &pCharValue);
256
257         return String(pCharValue);
258 }
259
260 bool
261 _CategoryImpl::HasMember(RecordId contactId) const
262 {
263         SysTryReturn(NID_SCL, contactId != INVALID_RECORD_ID, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. contactId = %d.", GetErrorMessage(E_INVALID_ARG), contactId);
264
265         result r = E_SUCCESS;
266         int tableId = contactId;
267
268         if (!__hasMemberList)
269         {
270                 _CategoryImpl* pThis = const_cast<_CategoryImpl*>(this);
271                 r = pThis->LoadMemberList();
272                 SysTryReturn(NID_SCL, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
273         }
274
275         return __pMembers->Contains(tableId);
276 }
277
278 result
279 _CategoryImpl::RemoveMember(RecordId contactId)
280 {
281         SysTryReturn(NID_SCL, contactId != INVALID_RECORD_ID, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. contactId = %d.", GetErrorMessage(E_INVALID_ARG), contactId);
282
283         result r = E_SUCCESS;
284         int tableId = contactId;
285
286         if (!__hasMemberList)
287         {
288                 r = LoadMemberList();
289                 SysTryReturn(NID_SCL, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
290         }
291
292         if (!_AppInfo::IsOspCompat())
293         {
294                 SysTryReturn(NID_SCL, HasMember(contactId), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid arguemnt is used. The contact does not exist in the category.", GetErrorMessage(E_INVALID_ARG));
295         }
296
297         // check pended delete list
298         if (__pRemovedMembers->Contains(tableId))
299         {
300                 return E_SUCCESS;
301         }
302
303         if (!HasMember(contactId))
304         {
305                 return E_SUCCESS;
306         }
307
308         r = __pMembers->Remove(tableId);
309         SysTryReturn(NID_SCL, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
310
311         if (__pAddedMembers->Contains(tableId))
312         {
313                 __pAddedMembers->Remove(tableId);
314         }
315         else
316         {
317                 result r = __pRemovedMembers->Add(tableId);
318                 if (IsFailed(r))
319                 {
320                         __pMembers->Add(tableId);
321                         SysLogException(NID_SCL, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
322
323                         return r;
324                 }
325         }
326
327         __memberCount--;
328
329         return E_SUCCESS;
330 }
331
332 result
333 _CategoryImpl::SetName(const String& name)
334 {
335         if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
336         {
337                 SysTryReturn(NID_SCL, !IsDefault(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. This category is a default category.", GetErrorMessage(E_INVALID_ARG));
338                 SysTryReturn(NID_SCL, name.GetLength() <= 100, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified name exceeds the max length.", GetErrorMessage(E_INVALID_ARG));
339         }
340         else
341         {
342                 SysTryReturn(NID_SCL, !IsDefault(), E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] This category is a default category.", GetErrorMessage(E_INVALID_OPERATION));
343         }
344
345         SysTryReturn(NID_SCL, !name.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified file path is an empty string", GetErrorMessage(E_INVALID_ARG));
346
347         std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(name));
348         SysTryReturnResult(NID_SCL, pCharArray != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
349         contacts_record_set_str(__recordHandle, _contacts_group.name, pCharArray.get());
350
351         return E_SUCCESS;
352 }
353
354 result
355 _CategoryImpl::SetRingtonePath(const String& filePath)
356 {
357         SysTryReturn(NID_SCL, filePath.IsEmpty() || File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[%s] The specified file is not found.", GetErrorMessage(E_FILE_NOT_FOUND));
358
359         if (!filePath.IsEmpty())
360         {
361                 std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(filePath));
362                 SysTryReturnResult(NID_SCL, pCharArray != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
363
364                 contacts_record_set_str(__recordHandle, _contacts_group.ringtone_path, pCharArray.get());
365         }
366         else
367         {
368                 contacts_record_set_str(__recordHandle, _contacts_group.ringtone_path, null);
369         }
370
371         return E_SUCCESS;
372 }
373
374 String
375 _CategoryImpl::GetRingtonePath(void) const
376 {
377         char* pCharValue = null;
378
379         contacts_record_get_str_p(__recordHandle, _contacts_group.ringtone_path, &pCharValue);
380
381         return String(pCharValue);
382 }
383
384 IListT<int>*
385 _CategoryImpl::GetMembersN(void) const
386 {
387         std::unique_ptr<ArrayListT<int> > pList(new (std::nothrow) ArrayListT<int>());
388         SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
389
390         result r = pList->Construct(*__pMembers);
391         SysTryReturn(NID_SCL, !IsFailed(r), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
392
393         return pList.release();
394 }
395
396 IListT<int>*
397 _CategoryImpl::GetAddedMembersN(void) const
398 {
399         std::unique_ptr<ArrayListT<int> > pList(new (std::nothrow) ArrayListT<int>());
400         SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
401
402         result r = pList->Construct(*__pAddedMembers);
403         SysTryReturn(NID_SCL, !IsFailed(r), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
404
405         return pList.release();
406 }
407
408 IListT<int>*
409 _CategoryImpl::GetRemovedMembersN(void) const
410 {
411         std::unique_ptr<ArrayListT<int> > pList(new (std::nothrow) ArrayListT<int>());
412         SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
413
414         result r = pList->Construct(*__pRemovedMembers);
415         SysTryReturn(NID_SCL, !IsFailed(r), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
416
417         return pList.release();
418 }
419
420 result
421 _CategoryImpl::LoadMemberList(void)
422 {
423         SysTryReturn(NID_SCL, _ContactDbConnector::EnsureDbConnection() == E_SUCCESS, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
424
425         int intValue = 0;
426         result r = E_SUCCESS;
427         std::unique_ptr< ArrayListT<RecordId> > pMembers;
428
429         contacts_record_get_int(__recordHandle, _contacts_group.id, &intValue);
430         if (intValue <= 0)
431         {
432                 __hasMemberList = true;
433
434                 return E_SUCCESS;
435         }
436
437         contacts_record_h currentRecord = null;
438
439         __Filter<__ContactsContactGroupRel> filter;
440         filter.Construct();
441         filter.AddInt(_contacts_contact_grouprel.group_id, CONTACTS_MATCH_EQUAL, intValue);
442
443         __Query<__ContactsContactGroupRel> query;
444         query.Construct();
445         query.SetFilter(filter);
446
447         std::unique_ptr<__SearchResult<__ContactsContactGroupRel> > pSearchResult(_AddressbookUtil::ExecuteQuery(query));
448         SysTryReturn(NID_SCL, pSearchResult != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
449
450         while (pSearchResult->MoveNext() == E_SUCCESS)
451         {
452                 currentRecord = pSearchResult->GetCurrentRecord();
453                 SysTryReturn(NID_SCL, currentRecord != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
454
455                 contacts_record_get_int(currentRecord, _contacts_contact_grouprel.contact_id, &intValue);
456
457                 if (intValue > 0)
458                 {
459                         r = __pMembers->Add(intValue);
460                         SysTryReturn(NID_SCL, !IsFailed(r), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
461                 }
462         }
463
464         __memberCount = __pMembers->GetCount();
465         __hasMemberList = true;
466
467         return E_SUCCESS;
468 }
469
470 void
471 _CategoryImpl::ClearAddedMemberList(void)
472 {
473         __pAddedMembers->RemoveAll();
474 }
475
476 void
477 _CategoryImpl::ClearRemovedMemberList(void)
478 {
479         __pRemovedMembers->RemoveAll();
480 }
481
482 AddressbookId
483 _CategoryImpl::GetAddressbookId(void) const
484 {
485         int intValue = 0;
486
487         contacts_record_get_int(__recordHandle, _contacts_group.address_book_id, &intValue);
488
489         return intValue;
490 }
491
492 result
493 _CategoryImpl::SetThumbnail(const String& filePath)
494 {
495         SysTryReturn(NID_SCL, filePath.IsEmpty() || File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[%s] The specified file is not found.", GetErrorMessage(E_FILE_NOT_FOUND));
496
497         if (!filePath.IsEmpty())
498         {
499                 std::unique_ptr<char[]> pCharArray( _StringConverter::CopyToCharArrayN(filePath));
500                 SysTryReturnResult(NID_SCL, pCharArray != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
501
502                 contacts_record_set_str(__recordHandle, _contacts_group.image_path, pCharArray.get());
503         }
504         else
505         {
506                 contacts_record_set_str(__recordHandle, _contacts_group.image_path, null);
507         }
508
509         return E_SUCCESS;
510 }
511
512 String
513 _CategoryImpl::GetThumbnailPath(void) const
514 {
515         char* pCharValue = null;
516
517         contacts_record_get_str_p(__recordHandle, _contacts_group.image_path, &pCharValue);
518
519         return String(pCharValue);
520 }
521
522 result
523 _CategoryImpl::Invalidate(void)
524 {
525         contacts_record_h recordHandle = null;
526         int ret = CONTACTS_ERROR_NONE;
527         char* pCharValue = null;
528
529         ret = contacts_record_create(_contacts_group._uri, &recordHandle);
530         SysTryReturnResult(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
531
532         contacts_record_get_str_p(__recordHandle, _contacts_group.name, &pCharValue);
533         contacts_record_set_str(recordHandle, _contacts_group.name, pCharValue);
534
535         contacts_record_get_str_p(__recordHandle, _contacts_group.ringtone_path, &pCharValue);
536         contacts_record_set_str(recordHandle, _contacts_group.ringtone_path, pCharValue);
537
538         contacts_record_get_str_p(__recordHandle, _contacts_group.image_path, &pCharValue);
539         contacts_record_set_str(recordHandle, _contacts_group.image_path, pCharValue);
540
541         contacts_record_get_str_p(__recordHandle, _contacts_group.vibration, &pCharValue);
542         contacts_record_set_str(recordHandle, _contacts_group.vibration, pCharValue);
543
544         contacts_record_destroy(__recordHandle, true);
545         __recordHandle = recordHandle;
546
547         return E_SUCCESS;
548 }
549
550 const _CategoryImpl*
551 _CategoryImpl::GetInstance(const Category& category)
552 {
553         return category.__pCategoryImpl;
554 }
555
556 _CategoryImpl*
557 _CategoryImpl::GetInstance(Category& category)
558 {
559         return category.__pCategoryImpl;
560 }
561
562 }}  // Tizen::Social