Fix code for TDIS-5396
[framework/osp/social.git] / src / FScl_PersonImpl.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_PersonImpl.h
19  * @brief               This is the header file for the %_PersonImpl class.
20  *
21  * This header file contains the declarations of the %_PersonImpl class.
22  */
23 #ifndef _FSCL_PERSON_IMPL_H_
24 #define _FSCL_PERSON_IMPL_H_
25
26 #include <unique_ptr.h>
27 #include <contacts.h>
28 #include <FBaseObject.h>
29 #include <FSclRecord.h>
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34
35 namespace Collection
36 {
37 template<typename Type>
38 class IListT;
39
40 template<typename Type>
41 class ArrayListT;
42 }
43
44 } }
45
46 namespace Tizen { namespace Graphics
47 {
48 class Bitmap;
49 } }
50
51 namespace Tizen { namespace Social
52 {
53
54 class PhoneNumber;
55 class Email;
56
57 class _OSP_EXPORT_ _PersonImpl
58         : public Tizen::Base::Object
59 {
60 public:
61         _PersonImpl(void);
62
63         virtual ~_PersonImpl(void);
64
65         virtual bool Equals(const Tizen::Base::Object& rhs) const;
66
67         virtual int GetHashCode(void) const;
68
69         // setter
70         void SetId(int personId);
71         
72         void SetDisplayName(const Tizen::Base::String& displayName);
73         
74         void SetThumbnailPath(const Tizen::Base::String& thumbnailPath);
75         
76         void SetRingtonePath(const Tizen::Base::String& ringtonePath);
77
78         void SetHasPhoneNumber(bool hasPhoneNumber);
79
80         void SetHasEmail(bool hasEmail);
81
82         void SetIsFavorite(bool isFavorite);
83
84         void SetAddressbookIdString(const Tizen::Base::String& addressbookIdString);
85
86         // getter
87         Tizen::Base::String GetDisplayName(void) const;
88
89         Tizen::Base::String GetThumbnailPath(void) const;
90
91         Tizen::Base::String GetRingtonePath(void) const;
92
93         bool HasPhoneNumber(void) const;
94
95         bool HasEmail(void) const;
96
97         bool IsFavorite(void) const;
98
99         Tizen::Base::Collection::IListT<AccountId>* GetAccountIdsN(void) const;
100
101         PersonId GetId(void) const;
102
103         result SetAsFavorite(bool isFavorite);
104
105         result SetAsPrimaryPhoneNumber(const PhoneNumber& phoneNumber);
106
107         result SetAsPrimaryEmail(const Email& email);
108
109         PhoneNumber GetPrimaryPhoneNumber(void) const;
110
111         Email GetPrimaryEmail(void) const;
112
113         static _PersonImpl* GetInstance(Person& person);
114
115         static const _PersonImpl* GetInstance(const Person& person);
116
117 private:
118         _PersonImpl(const _PersonImpl& rhs);
119
120         _PersonImpl& operator =(const _PersonImpl& rhs);
121
122 private:
123         bool __isFavorite;
124         bool __hasPhoneNumber;
125         bool __hasEmail;
126         int __personId;
127         int __accountId1;
128         int __accountId2;
129         int __accountId3;
130         Tizen::Base::String __displayName;
131         Tizen::Base::String __thumbnailPath;
132         Tizen::Base::String __ringtonePath;
133         Tizen::Base::String __addressbookIdString;
134         mutable std::unique_ptr<Tizen::Base::Collection::ArrayListT<AccountId> > __pAccountIds;
135                 
136         friend class _AddressbookManagerImpl;
137 };      // _PersonImpl
138
139 }}      // Tizen::Social
140
141 #endif // _FSCL_PERSON_IMPL_H_