X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FFScl_AddressbookUtil.cpp;h=aba153d84611a37630c2b7e18e5862ec2de02b98;hb=0d1d45f713adce1df579f47b2d06c193c7a8cc80;hp=195c59dae462af784a47278993b7d5c711090e69;hpb=36e3c247badebd781c9038e2d14590fc05847d64;p=platform%2Fframework%2Fnative%2Fsocial.git diff --git a/src/FScl_AddressbookUtil.cpp b/src/FScl_AddressbookUtil.cpp index 195c59d..aba153d 100644 --- a/src/FScl_AddressbookUtil.cpp +++ b/src/FScl_AddressbookUtil.cpp @@ -915,4 +915,40 @@ _AddressbookUtil::GetRwAbIdListN(void) return pAbIdList.release(); } +result +_AddressbookUtil::GetAbListN(IListT& rwAbIdList, IListT& roAbIdList) +{ + ClearLastResult(); + + __Query<__ContactsAddressbook> query; + query.Construct(); + + std::unique_ptr<__SearchResult<__ContactsAddressbook> > pSearchResult(_AddressbookUtil::ExecuteQuery(query, 0, 0)); + if (pSearchResult == null) + { + return E_SUCCESS; + } + + while (pSearchResult->MoveNext() == E_SUCCESS) + { + int intValue = 0; + contacts_record_h currentRecord = pSearchResult->GetCurrentRecord(); + + contacts_record_get_int(currentRecord, _contacts_address_book.mode, &intValue); + if (intValue == CONTACTS_ADDRESS_BOOK_MODE_NONE) + { + contacts_record_get_int(currentRecord, _contacts_address_book.id, &intValue); + + rwAbIdList.Add(intValue); + } + else + { + contacts_record_get_int(currentRecord, _contacts_address_book.id, &intValue); + roAbIdList.Add(intValue); + } + } + + return E_SUCCESS; +} + }} // Tizen::Social