merge wrt-plugins-tizen_0.2.0-3
[platform/framework/web/wrt-plugins-tizen.git] / src / platform / API / Contact / IContact.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 /**
18  * @file        IContact.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief
22  * ##
23  */
24
25 #ifndef _API_CONTACT_ICONTACT_H_
26 #define _API_CONTACT_ICONTACT_H_
27
28 #include <ctime>
29 #include <string>
30 #include <vector>
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"
42
43 namespace TizenApis {
44 namespace Api {
45 namespace Contact {
46
47 class IContact;
48 typedef DPL::SharedPtr<IContact> ContactPtr;
49
50 typedef std::vector<ContactPtr> ContactArray;
51 typedef DPL::SharedPtr<ContactArray> ContactArrayPtr;
52
53 class IContact
54 {
55 public:
56         IContact();
57         IContact(const std::string &vObjectStr, const std::string &format);
58         virtual ~IContact();
59
60         virtual std::string convertToString(const std::string &format) = 0;
61
62         std::string getId() const;
63         void setId(const std::string value);
64         void setId(const int value);
65         bool getIdIsSet() const;
66
67         std::tm getLastUpdated() const;
68         void setLastUpdated(const std::tm &value);
69         bool getLastUpdatedIsSet() const;
70
71         ContactNamePtr getName() const;
72         void setName(const ContactNamePtr &value);
73         bool getNameIsSet() const;
74
75         ContactAccountPtr getAccount() const;
76         void setAccount(const ContactAccountPtr &value);
77         bool getAccountIsSet() const;
78
79         ContactAddressArrayPtr getAddresses() const;
80         void setAddresses(const ContactAddressArrayPtr &value);
81         void addAddress(const ContactAddressPtr &value);
82         int  getAddressesNum() const;
83
84         std::string getPhotoURI() const;
85         void setPhotoURI(const std::string &value);
86         bool getPhotoURIIsSet() const;
87
88         ContactPhoneNumberArrayPtr getPhoneNumbers() const;
89         void setPhoneNumbers(const ContactPhoneNumberArrayPtr &value);
90         void addPhoneNumber(const ContactPhoneNumberPtr &value);
91         int  getPhoneNumbersNum() const;
92
93         ContactEmailAddressArrayPtr getEmails() const;
94         void setEmails(const ContactEmailAddressArrayPtr &value);
95         void addEmail(const ContactEmailAddressPtr& value);
96         int  getEmailsNum() const;
97
98         std::tm getBirthday() const;
99         void setBirthday(const std::tm &value);
100         bool getBirthdayIsSet() const;
101
102         ContactAnniversaryArrayPtr getAnniversaries() const;
103         void setAnniversaries(const ContactAnniversaryArrayPtr &value);
104         void addAnniversary(const ContactAnniversaryPtr &value);
105         int  getAnniversariesNum() const;
106
107         ContactOrganizationPtr getOrganization() const;
108         void setOrganization(const ContactOrganizationPtr &value);
109         bool getOrganizationIsSet() const;
110
111         StringArrayPtr getNotes() const;
112         void setNotes(const StringArrayPtr &value);
113         void addNote(const std::string &value);
114         int  getNotesNum() const;
115
116         ContactWebSiteArrayPtr getUrls() const;
117         void setUrls(const ContactWebSiteArrayPtr &value);
118         void addUrl(const ContactWebSitePtr &value);
119         int  getUrlsNum() const;
120
121         bool getIsFavorite() const;
122         void setIsFavorite(const bool &value);
123
124         std::string getRingtoneURI() const;
125         void setRingtoneURI(const std::string &value);
126         bool getRingtoneURIIsSet() const;
127
128         StringArrayPtr getCategories() const;
129         void setCategories(const StringArrayPtr &value);
130         void addCategory(const std::string &value);
131         int  getCategoriesNum() const;
132
133         virtual void copy(const ContactPtr &contact);
134         virtual void clear();
135         virtual ContactPtr clone() const;
136
137 protected:
138         std::string                 m_id;
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;
146         std::tm                     m_birthday;
147         ContactAnniversaryArrayPtr  m_anniversaries;
148         ContactOrganizationPtr      m_organization;
149         StringArrayPtr              m_notes;
150         ContactWebSiteArrayPtr      m_urls;
151         bool                        m_isFavorite;
152         std::string                 m_ringtoneURI;
153         StringArrayPtr              m_categories;
154
155         bool m_idIsSet;
156         bool m_lastUpdatedIsSet;
157         bool m_nameIsSet;
158         bool m_accountIsSet;
159         bool m_photoURIIsSet;
160         bool m_birthdayIsSet;
161         bool m_organizationIsSet;
162         bool m_ringtoneURIIsSet;
163 };
164
165 } // Contact
166 } // Api
167 } // TizenApis
168
169 #endif // _API_CONTACT_CONTACT_H_