Initialize Tizen 2.3
[framework/osp/social.git] / src / FScl_PhoneNumberImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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         FScl_PhoneNumberImpl.h
18 * @brief        This is the header file for the %_PhoneNumberImpl class.
19 *
20 * This header file contains the declarations of the %_PhoneNumberImpl class.
21 */
22 #ifndef _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_
23 #define _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_
24
25 #include <contacts.h>
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FSclTypes.h>
29
30 namespace Tizen { namespace Base
31 {
32 class String;
33 }}
34
35 namespace Tizen { namespace Social
36 {
37 class PhoneNumber;
38
39 /**
40 * @class        _PhoneNumberImpl
41 * @brief        This class stores the information of a phone number.
42 *
43 * @since        2.0
44 *
45 * The %_PhoneNumberImpl class consists of the phone number and phone number type.
46 *
47 */
48 class _PhoneNumberImpl
49         : public Tizen::Base::Object
50 {
51 public:
52         _PhoneNumberImpl(void);
53
54         _PhoneNumberImpl(PhoneNumberType type, const Tizen::Base::String& number);
55
56         _PhoneNumberImpl(const _PhoneNumberImpl& rhs);
57
58         virtual ~_PhoneNumberImpl(void);
59
60         virtual bool Equals(const Tizen::Base::Object& rhs) const;
61
62         virtual int GetHashCode(void) const;
63
64         // setter       
65         void SetRecordId(int recordId);
66
67         void SetType(PhoneNumberType type);
68
69         void SetLabel(const Tizen::Base::String& label);
70
71         result SetPhoneNumber(const Tizen::Base::String& number);
72
73         // getter
74         int GetRecordId(void) const;
75
76         PhoneNumberType GetType(void) const;
77         
78         Tizen::Base::String GetLabel(void) const;
79
80         Base::String GetPhoneNumber(void) const;
81
82         bool IsEmpty(void) const;
83
84         bool IsPhoneNumberTypeChanged(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         bool __isPhoneTypeChanged;
103 }; // _PhoneNumberImpl
104
105 }} // Tizen::Social
106
107 #endif // _FSCL_INTERNAL_PHONE_NUMBER_IMPL_H_