70e71897febb6f0cd2e8ec6bb34c11b8fcf8412c
[framework/web/wrt-plugins-common.git] / src / modules / API / Contact / Contact.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  * @file        Contact.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  */
21
22 #ifndef WRTDEVICEAPIS_CONTACT_CONTACT_H_
23 #define WRTDEVICEAPIS_CONTACT_CONTACT_H_
24
25 #include <string>
26 #include <vector>
27 #include <dpl/log/log.h>
28 #include <dpl/shared_ptr.h>
29 #include <Contact/ContactAddress.h>
30 #include <Contact/ContactEmail.h>
31 #include <Contact/ContactPhoneNumber.h>
32
33 namespace WrtDeviceApis {
34 namespace Contact {
35 namespace Api {
36
37 class Contact;
38
39 typedef DPL::SharedPtr<Contact> ContactPtr;
40
41 /* This object represents a single contact in address book */
42 class Contact
43 {
44   public:
45     Contact();
46     ~Contact();
47
48     int getId() const;
49     void setId(int value);
50
51     std::string getFullName() const;
52     void setFullName(const std::string &value);
53
54     std::string getFirstName() const;
55     void setFirstName(const std::string &value);
56
57     std::string getLastName() const;
58     void setLastName(const std::string &value);
59
60     const std::vector<std::string> &getNickNames() const;
61     void setNickNames(const std::vector<std::string> &value);
62
63     std::string getPhoneticName() const;
64     void setPhoneticName(const std::string &value);
65
66     const std::vector<ContactAddressPtr> &getAddresses() const;
67     void setAddresses(const std::vector<ContactAddressPtr> &value);
68
69     std::string getPhotoUri() const;
70     void setPhotoUri(const std::string &value);
71
72     std::string getRingTonePath() const;
73     void setRingTonePath(const std::string &value);
74
75     const std::vector<ContactPhoneNumberPtr> &getPhoneNumbers() const;
76     void setPhoneNumbers(const std::vector<ContactPhoneNumberPtr> &value);
77
78     const std::vector<ContactEmailPtr> &getEmails() const;
79     void setEmails(const std::vector<ContactEmailPtr> &value);
80
81     std::string getCompany() const;
82     void setCompany(const std::string &value);
83
84     std::string getTitle() const;
85     void setTitle(const std::string &value);
86
87     const std::vector<std::string> &getGroups() const;
88     void setGroups(const std::vector<std::string> &value);
89
90     void clear();
91     ContactPtr clone();
92
93     bool getIdIsSet() const;
94     bool getFullNameIsSet() const;
95     bool getFirstNameIsSet() const;
96     bool getLastNameIsSet() const;
97     bool getCompanyIsSet() const;
98     bool getTitleIsSet() const;
99     bool getPhotoIsSet() const;
100     bool getNicknameIsSet() const;
101     bool getPhoneticIsSet() const;
102     bool getAddressIsSet() const;
103     bool getPhoneNumberIsSet() const;
104     bool getEmailIsSet() const;
105     bool getRingPathIsSet() const;
106
107   private:
108     int m_id;
109     std::string m_fullName; //display name e.g. m_firstName + m_lastName
110     std::string m_firstName;
111     std::string m_lastName;
112     std::vector<std::string> m_nicknames;
113     std::string m_phoneticName;
114     std::vector<ContactAddressPtr> m_addresses;
115     std::string m_photoUri;
116     std::string m_ringTonePath;
117     std::vector<ContactPhoneNumberPtr> m_phoneNumbers;
118     std::vector<ContactEmailPtr> m_emails;
119     std::string m_company;
120     std::string m_title;
121     std::vector<std::string> m_groups;
122
123     bool m_fullNameIsSet;
124     bool m_firstNameIsSet;
125     bool m_lastNameIsSet;
126     bool m_phoneticNameIsSet;
127     bool m_companyIsSet;
128     bool m_titleIsSet;
129     bool m_photoUriIsSet;
130     bool m_ringTonePathIsSet;
131 };
132
133 }
134 }
135 }
136
137 #endif // WRTDEVICEAPIS_CONTACT_CONTACT_H_