2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
19 * @author Kisub Song (kisubs.song@samsung.com)
25 #ifndef _API_CONTACT_ICONTACT_H_
26 #define _API_CONTACT_ICONTACT_H_
31 #include <dpl/log/log.h>
32 #include <dpl/shared_ptr.h>
33 #include "ContactTypes.h"
34 #include "ContactName.h"
35 #include "ContactAccount.h"
36 #include "ContactAddress.h"
37 #include "ContactPhoneNumber.h"
38 #include "ContactEmailAddress.h"
39 #include "ContactAnniversary.h"
40 #include "ContactOrganization.h"
41 #include "ContactWebSite.h"
48 typedef DPL::SharedPtr<IContact> ContactPtr;
50 typedef std::vector<ContactPtr> ContactArray;
51 typedef DPL::SharedPtr<ContactArray> ContactArrayPtr;
57 IContact(const std::string &vObjectStr, const std::string &format);
60 virtual std::string convertToString(const std::string &format) = 0;
62 std::string getId() const;
63 void setId(const std::string value);
64 void setId(const int value);
65 bool getIdIsSet() const;
67 std::tm getLastUpdated() const;
68 void setLastUpdated(const std::tm &value);
69 bool getLastUpdatedIsSet() const;
71 ContactNamePtr getName() const;
72 void setName(const ContactNamePtr &value);
73 bool getNameIsSet() const;
75 ContactAccountPtr getAccount() const;
76 void setAccount(const ContactAccountPtr &value);
77 bool getAccountIsSet() const;
79 ContactAddressArrayPtr getAddresses() const;
80 void setAddresses(const ContactAddressArrayPtr &value);
81 void addAddress(const ContactAddressPtr &value);
82 int getAddressesNum() const;
84 std::string getPhotoURI() const;
85 void setPhotoURI(const std::string &value);
86 bool getPhotoURIIsSet() const;
88 ContactPhoneNumberArrayPtr getPhoneNumbers() const;
89 void setPhoneNumbers(const ContactPhoneNumberArrayPtr &value);
90 void addPhoneNumber(const ContactPhoneNumberPtr &value);
91 int getPhoneNumbersNum() const;
93 ContactEmailAddressArrayPtr getEmails() const;
94 void setEmails(const ContactEmailAddressArrayPtr &value);
95 void addEmail(const ContactEmailAddressPtr& value);
96 int getEmailsNum() const;
98 std::tm getBirthday() const;
99 void setBirthday(const std::tm &value);
100 bool getBirthdayIsSet() const;
102 ContactAnniversaryArrayPtr getAnniversaries() const;
103 void setAnniversaries(const ContactAnniversaryArrayPtr &value);
104 void addAnniversary(const ContactAnniversaryPtr &value);
105 int getAnniversariesNum() const;
107 ContactOrganizationPtr getOrganization() const;
108 void setOrganization(const ContactOrganizationPtr &value);
109 bool getOrganizationIsSet() const;
111 StringArrayPtr getNotes() const;
112 void setNotes(const StringArrayPtr &value);
113 void addNote(const std::string &value);
114 int getNotesNum() const;
116 ContactWebSiteArrayPtr getUrls() const;
117 void setUrls(const ContactWebSiteArrayPtr &value);
118 void addUrl(const ContactWebSitePtr &value);
119 int getUrlsNum() const;
121 bool getIsFavorite() const;
122 void setIsFavorite(const bool &value);
124 std::string getRingtoneURI() const;
125 void setRingtoneURI(const std::string &value);
126 bool getRingtoneURIIsSet() const;
128 StringArrayPtr getCategories() const;
129 void setCategories(const StringArrayPtr &value);
130 void addCategory(const std::string &value);
131 int getCategoriesNum() const;
133 virtual void copy(const ContactPtr &contact);
134 virtual void clear();
135 virtual ContactPtr clone() const;
139 std::tm m_lastUpdated;
140 ContactNamePtr m_name;
141 ContactAccountPtr m_account;
142 ContactAddressArrayPtr m_addresses;
143 std::string m_photoURI;
144 ContactPhoneNumberArrayPtr m_phoneNumbers;
145 ContactEmailAddressArrayPtr m_emails;
147 ContactAnniversaryArrayPtr m_anniversaries;
148 ContactOrganizationPtr m_organization;
149 StringArrayPtr m_notes;
150 ContactWebSiteArrayPtr m_urls;
152 std::string m_ringtoneURI;
153 StringArrayPtr m_categories;
156 bool m_lastUpdatedIsSet;
159 bool m_photoURIIsSet;
160 bool m_birthdayIsSet;
161 bool m_organizationIsSet;
162 bool m_ringtoneURIIsSet;
169 #endif // _API_CONTACT_CONTACT_H_