tizen 2.3.1 release
[framework/web/mobile/wrt-plugins-tizen.git] / src / Contact / ContactAnniversary.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        ContactAnniversary.h
20  */
21
22 #ifndef _TIZEN_CONTACT_CONTACT_ANNIVERSARY_H_
23 #define _TIZEN_CONTACT_CONTACT_ANNIVERSARY_H_
24
25 #include <memory>
26 #include <ctime>
27 #include <string>
28 #include <vector>
29 #include <contacts.h>
30
31 namespace DeviceAPI {
32 namespace Contact {
33
34 class ContactAnniversary;
35 typedef std::shared_ptr<ContactAnniversary> ContactAnniversaryPtr;
36 typedef std::vector<ContactAnniversaryPtr> ContactAnniversaryPtrVector;
37
38 /* This object represents an anniversary data of a contact */
39 class ContactAnniversary {
40 public:
41     ContactAnniversary();
42     virtual ~ContactAnniversary();
43
44     std::tm getDate();
45     void setDate(const std::tm& value);
46     std::string getLabel();
47     void setLabel(const std::string &value);
48     bool isLabelSet();
49     void unsetLabel();
50     bool importFromContactsRecord(contacts_record_h contacts_record,
51             unsigned int index);
52     void exportToContactsRecord(contacts_record_h contacts_record);
53
54 private:
55     tm m_tm;
56     std::string m_label;
57     bool m_is_label_set;
58 };
59
60 } // Contact
61 } // DeviceAPI
62
63 #endif // _TIZEN_CONTACT_CONTACT_ANNIVERSARY_H_