tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / Contact / ContactPhoneNumber.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        ContactPhoneNumber.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  */
21
22 #ifndef WRTDEVICEAPIS_CONTACT_CONTACT_PHONE_NUMBER_H_
23 #define WRTDEVICEAPIS_CONTACT_CONTACT_PHONE_NUMBER_H_
24
25 #include <algorithm>
26 #include <string>
27 #include <vector>
28 #include <dpl/shared_ptr.h>
29
30 namespace WrtDeviceApis {
31 namespace Contact {
32 namespace Api {
33
34 class ContactPhoneNumber;
35
36 typedef DPL::SharedPtr<ContactPhoneNumber> ContactPhoneNumberPtr;
37 typedef std::vector<ContactPhoneNumberPtr> ContactPhoneNumberPtrList;
38 typedef DPL::SharedPtr<ContactPhoneNumberPtrList> ContactPhoneNumberPtrListPtr;
39
40 /* This object represents a phone number data of a contact */
41 class ContactPhoneNumber
42 {
43   public:
44
45     typedef enum
46     {
47         CONTACT_PHONE_NUMBER_TYPE_WORK,
48         CONTACT_PHONE_NUMBER_TYPE_PREF,
49         CONTACT_PHONE_NUMBER_TYPE_HOME,
50         CONTACT_PHONE_NUMBER_TYPE_VOICE,
51         CONTACT_PHONE_NUMBER_TYPE_FAX,
52         CONTACT_PHONE_NUMBER_TYPE_MSG,
53         CONTACT_PHONE_NUMBER_TYPE_CELL,
54         CONTACT_PHONE_NUMBER_TYPE_PAGER,
55         CONTACT_PHONE_NUMBER_TYPE_BBS,
56         CONTACT_PHONE_NUMBER_TYPE_MODEM,
57         CONTACT_PHONE_NUMBER_TYPE_CAR,
58         CONTACT_PHONE_NUMBER_TYPE_ISDN,
59         CONTACT_PHONE_NUMBER_TYPE_VIDEO,
60         CONTACT_PHONE_NUMBER_TYPE_PCS
61     } ContactPhoneNumberType;
62
63     ContactPhoneNumber();
64     ~ContactPhoneNumber();
65     std::string getNumber() const;
66     void setNumber(const std::string &value);
67     std::vector<ContactPhoneNumberType> getTypes() const;
68     void addType(const ContactPhoneNumberType value);
69     void setTypes(const std::vector<ContactPhoneNumberType> value);
70     bool isTypeOf(ContactPhoneNumberType value) const;
71     //methods to use when object is used as filter, not email data container
72     ContactPhoneNumberType getTypeFilter() const;
73     void setTypeFilter(ContactPhoneNumberType value);
74     ContactPhoneNumberPtr clone() const;
75
76   private:
77     std::string m_number;
78     std::vector<ContactPhoneNumberType> m_types;
79 };
80
81 }
82 }
83 }
84
85 #endif