Fix code for TDIS-5396
[framework/osp/social.git] / src / FScl_PhoneNumberImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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 * @file         FScl_PhoneNumberImpl.h
19 * @brief        This is the header file for the %_PhoneNumberImpl class.
20 *
21 * This header file contains the declarations of the %_PhoneNumberImpl class.
22 */
23 #ifndef _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_
24 #define _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_
25
26 #include <contacts.h>
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
29 #include <FSclTypes.h>
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34 }}
35
36 namespace Tizen { namespace Social
37 {
38 class PhoneNumber;
39
40 /**
41 * @class        _PhoneNumberImpl
42 * @brief        This class stores the information of a phone number.
43 *
44 * @since        2.0
45 *
46 * The %_PhoneNumberImpl class consists of the phone number and phone number type.
47 *
48 */
49 class _PhoneNumberImpl
50         : public Tizen::Base::Object
51 {
52 public:
53         _PhoneNumberImpl(void);
54
55         _PhoneNumberImpl(PhoneNumberType type, const Tizen::Base::String& number);
56
57         _PhoneNumberImpl(const _PhoneNumberImpl& rhs);
58
59         virtual ~_PhoneNumberImpl(void);
60
61         virtual bool Equals(const Tizen::Base::Object& rhs) const;
62
63         virtual int GetHashCode(void) const;
64
65         // setter       
66         void SetRecordId(int recordId);
67
68         void SetType(PhoneNumberType type);
69
70         void SetLabel(const Tizen::Base::String& label);
71
72         result SetPhoneNumber(const Tizen::Base::String& number);
73
74
75         // getter
76         int GetRecordId(void) const;
77
78         PhoneNumberType GetType(void) const;
79         
80         Tizen::Base::String GetLabel(void) const;
81
82         Base::String GetPhoneNumber(void) const;
83
84         bool IsEmpty(void) const;
85
86         static _PhoneNumberImpl* GetInstance(PhoneNumber& phoneNUmber);
87
88         static const _PhoneNumberImpl* GetInstance(const PhoneNumber& phoneNUmber);
89
90         _PhoneNumberImpl& operator =(const _PhoneNumberImpl& rhs);
91
92         bool operator ==(const _PhoneNumberImpl& rhs) const;
93
94         bool operator !=(const _PhoneNumberImpl& rhs) const;
95
96 private:
97         contacts_record_h __recordHandle;
98         int __recordId;
99         PhoneNumberType __type;
100         Tizen::Base::String __label;
101         Tizen::Base::String __number;
102 }; // _PhoneNumberImpl
103
104 }} // Tizen::Social
105
106 #endif // _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_