return false;
}
- if (GetRecordId() == pCategory->GetRecordId())
+ if (GetRecordId() != pCategory->GetRecordId())
{
- return true;
+ return false;
}
- return false;
+ return __pCategoryImpl->Equals(*pCategory->__pCategoryImpl);
}
int
contacts_record_get_int(recordHandle, _contacts_group.id, &intValue);
SysTryReturn(NID_SCL, intValue == categoryId, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] The category is not found.", GetErrorMessage(E_OBJ_NOT_FOUND));
- char* pCharValue = null;
- contacts_record_get_str_p(recordHandle, _contacts_group.extra_data, &pCharValue);
- SysTryReturn(NID_SCL, pCharValue == null, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified category is a default category.", GetErrorMessage(E_INVALID_ARG));
+ bool isReadOnly = false;
+ contacts_record_get_bool(recordHandle, _contacts_group.is_read_only, &isReadOnly);
+ SysTryReturn(NID_SCL, !isReadOnly, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified category is a default category.", GetErrorMessage(E_INVALID_ARG));
ret = contacts_db_delete_record(_contacts_group._uri, categoryId);
SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_NO_DATA, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] The category is not found.", GetErrorMessage(E_OBJ_NOT_FOUND));
contacts_record_get_int(recordHandle, _contacts_group.id, &intValue);
SysTryReturn(NID_SCL, intValue == categoryId, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] The category is not found.", GetErrorMessage(E_OBJ_NOT_FOUND));
- char* pCharValue = null;
- contacts_record_get_str_p(recordHandle, _contacts_group.extra_data, &pCharValue);
- SysTryReturn(NID_SCL, pCharValue == null, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified category is a default category.", GetErrorMessage(E_INVALID_ARG));
+ bool isReadOnly = false;
+ contacts_record_get_bool(recordHandle, _contacts_group.is_read_only, &isReadOnly);
+ SysTryReturn(NID_SCL, !isReadOnly, E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The specified category is a default category.", GetErrorMessage(E_INVALID_ARG));
ret = contacts_db_delete_record(_contacts_group._uri, categoryId);
SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
}
bool
+_CategoryImpl::Equals(const Tizen::Base::Object& rhs) const
+{
+ const _CategoryImpl* pCategoryImpl = dynamic_cast<const _CategoryImpl*>(&rhs);
+ if (pCategoryImpl == null)
+ {
+ return false;
+ }
+
+ if (GetName() != pCategoryImpl->GetName())
+ {
+ return false;
+ }
+
+ if (GetRingtonePath() != pCategoryImpl->GetRingtonePath())
+ {
+ return false;
+ }
+
+ if (GetThumbnailPath() != pCategoryImpl->GetThumbnailPath())
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool
_CategoryImpl::IsDefault(void) const
{
- char* pCharValue = null;
+ bool isReadOnly = false;
- contacts_record_get_str_p(__recordHandle, _contacts_group.extra_data, &pCharValue);
- if (pCharValue != null)
+ contacts_record_get_bool(__recordHandle, _contacts_group.is_read_only, &isReadOnly);
+ if (isReadOnly)
{
return true;
}
*/
virtual ~_CategoryImpl(void);
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
void SetRecordHandle(contacts_record_h recordHandle);
contacts_record_h GetRecordHandle(void) const;