2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FScl_ContactImpl.h
18 * @brief This is the header file for the _ContactImpl class.
20 * This header file contains the declarations of the _ContactImpl class.
22 #ifndef _FSCL_INTERNAL_CONTACT_IMPL_H_
23 #define _FSCL_INTERNAL_CONTACT_IMPL_H_
26 #include <unique_ptr.h>
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseColAllElementsDeleter.h>
31 #include <FSclTypes.h>
33 namespace Tizen { namespace Base
44 namespace Tizen { namespace Graphics
49 namespace Tizen { namespace Social
63 * @brief This class provides a contact.
69 : public Tizen::Base::Object
73 * This is the default constructor of the class
80 * Copying of objects using this copy constructor is allowed.
84 _ContactImpl(const _ContactImpl& rhs);
87 * This destructor overrides Tizen::Base::Object::~Object().
91 virtual ~_ContactImpl(void);
93 void SetContactRecordHandle(contacts_record_h contactHandle);
95 _OSP_EXPORT_ contacts_record_h GetContactRecordHandle(void) const;
97 result SetThumbnailPath(const Tizen::Base::String& filePath);
99 Tizen::Base::String GetThumbnailPath(void) const;
101 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
103 result GetValue(const ContactPropertyId id, Tizen::Base::String& value) const;
105 result GetValue(const ContactPropertyId id, Tizen::Base::DateTime& value) const;
107 result SetValue(ContactPropertyId id, const Tizen::Base::String& value);
109 result SetValue(ContactPropertyId id, const Tizen::Base::DateTime& value);
111 result AddPhoneNumber(const Tizen::Social::PhoneNumber& phoneNumber);
113 result AddNickname(const Tizen::Base::String& nickname);
115 result AddNote(const Tizen::Base::String& note);
117 result AddEmail(const Tizen::Social::Email& email);
119 result AddUrl(const Tizen::Social::Url& url);
121 result AddAddress(const Tizen::Social::Address& address);
123 result AddImAddress(const Tizen::Social::ImAddress& imAddress);
125 result AddEvent(const ContactEvent& event);
127 result AddOrganization(const Organization& organization);
129 result AddRelationship(const Relationship& relationship);
131 result RemoveAt(ContactMultiPropertyId id, int index);
133 Tizen::Base::Collection::IList* GetValuesN(const ContactMultiPropertyId id);
135 result SetNoteAt(int index, const Tizen::Base::String& note);
137 result SetNicknameAt(int index, const Tizen::Base::String& nickname);
139 result SetEmailAt(int index, const Tizen::Social::Email& email);
141 result SetPhoneNumberAt(int index, const Tizen::Social::PhoneNumber& phoneNumber);
143 result SetUrlAt(int index, const Tizen::Social::Url& url);
145 result SetAddressAt(int index, const Tizen::Social::Address& address);
147 result SetImAddressAt(int index, const Tizen::Social::ImAddress& imAddress);
149 result SetRelationshipAt(int index, const Tizen::Social::Relationship& relationship);
151 result SetEventAt(int index, const Tizen::Social::ContactEvent& event);
153 result SetOrganizationAt(int index, const Tizen::Social::Organization& organization);
155 bool IsEmpty(void) const;
157 AddressbookId GetAddressbookId(void) const;
159 PersonId GetPersonId(void) const;
161 void SetAsRemoved(void);
163 bool IsRemoved(void) const;
165 result Invalidate(void);
167 bool IsFavorite(void) const;
169 void SetAsFavorite(bool isFavorite = true);
171 PhoneNumberType GetNativePhoneNumberType(int coreType) const;
173 _OSP_EXPORT_ static const _ContactImpl* GetInstance(const Contact& contact);
175 _OSP_EXPORT_ static _ContactImpl* GetInstance(Contact& contact);
178 * Copying of objects using this copy assignment operator is allowed.
182 _ContactImpl& operator =(const _ContactImpl& rhs);
185 bool IsEmptyName(contacts_record_h nameHandle);
186 bool IsEmptyCompany(contacts_record_h companyHandle);
187 int GetMaxLength(ContactPropertyId id);
189 Tizen::Base::Collection::IList* GetPhoneNumbersN(void) const;
190 Tizen::Base::Collection::IList* GetEmailsN(void) const;
191 Tizen::Base::Collection::IList* GetUrlsN(void) const;
192 Tizen::Base::Collection::IList* GetAddressesN(void) const;
193 Tizen::Base::Collection::IList* GetImAddressesN(void) const;
194 Tizen::Base::Collection::IList* GetOrganizationsN(void) const;
195 Tizen::Base::Collection::IList* GetRelationshipsN(void) const;
196 Tizen::Base::Collection::IList* GetEventsN(void) const;
197 Tizen::Base::Collection::IList* GetNotesN(void) const;
198 Tizen::Base::Collection::IList* GetNicknamesN(void) const;
201 contacts_record_h __contactHandle;
208 #endif //_FSCL_INTERNAL_CONTACT_IMPL_H_