Tizen 2.0 Release
[platform/framework/native/social.git] / src / inc / FScl_CategoryImpl.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_CategoryImpl.h
19  * @brief               This is the header file for the %_CategoryImpl class.
20  *
21  * This header file contains the declarations of the %_CategoryImpl class.
22  */
23
24 #ifndef _FSCL_INTERNAL_CATEGORY_IMPL_H_
25 #define _FSCL_INTERNAL_CATEGORY_IMPL_H_
26
27 #include <contacts.h>
28
29 #include <unique_ptr.h>
30 #include <FBaseObject.h>
31
32 namespace Tizen { namespace Base {
33
34 class String;
35
36 namespace Collection
37 {
38 class IList;
39 template <typename Type>
40 class IListT;
41 }}}
42
43 namespace Tizen { namespace Social
44 {
45 class Category;
46 class Record;
47
48 /**
49  * @class       _CategoryImpl
50  * @since       2.0
51  * @see Category
52  */
53 class _CategoryImpl
54         : public Tizen::Base::Object
55 {
56 public:
57         /**
58          * This is default constructor.
59          *
60          * @since       2.0
61          */
62         _CategoryImpl(void);
63
64         /**
65          * Copying of objects using this copy constructor is allowed.
66          *
67          * @since       2.0
68          */
69         _CategoryImpl(const _CategoryImpl& rhs);
70
71         /**
72          * This destructor overrides Tizen::Base::Object::~Object().
73          *
74          * @since       2.0
75          */
76         virtual ~_CategoryImpl(void);
77
78         void SetRecordHandle(contacts_record_h recordHandle);
79
80         contacts_record_h GetRecordHandle(void) const;
81
82         result AddMember(RecordId contactId);
83
84         int GetMemberCount(void) const;
85
86         Tizen::Base::String GetName(void) const;
87
88         bool HasMember(RecordId contactId) const;
89
90         result RemoveMember(RecordId contactId);
91
92         result SetName(const Tizen::Base::String& name);
93
94         result SetRingtonePath(const Tizen::Base::String& ringtone);
95
96         Tizen::Base::String GetRingtonePath(void) const;
97
98         void SetAddressbookId(AddressbookId addressbookId);
99
100         AddressbookId GetAddressbookId(void) const;
101
102         result SetThumbnail(const Tizen::Base::String& filePath);
103
104         Tizen::Base::String GetThumbnailPath(void) const;
105
106         bool IsDefault(void) const;
107
108         void SetMemberCount(int memberCount);
109
110         void SetRecord(const Record& record);
111
112         void ClearAddedMemberList(void);
113
114         void ClearRemovedMemberList(void);
115
116         Tizen::Base::Collection::IListT<int>* GetMembersN(void) const;
117
118         Tizen::Base::Collection::IListT<int>* GetAddedMembersN(void) const;
119
120         Tizen::Base::Collection::IListT<int>* GetRemovedMembersN(void) const;
121
122         result Invalidate(void);
123
124         static const _CategoryImpl* GetInstance(const Category& category);
125
126         static _CategoryImpl* GetInstance(Category& category);
127
128         /**
129          * Copying of objects using this copy assignment operator is allowed.
130          *
131          * @since       2.0
132          */
133         _CategoryImpl& operator =(const _CategoryImpl& rhs);
134
135 private:
136         result LoadMemberList(void);
137
138 private:
139         contacts_record_h __recordHandle;
140         bool __hasMemberList;
141         int __memberCount;
142         std::unique_ptr< Tizen::Base::Collection::IListT<int> > __pMembers;
143         std::unique_ptr< Tizen::Base::Collection::IListT<int> > __pAddedMembers;
144         std::unique_ptr< Tizen::Base::Collection::IListT<int> > __pRemovedMembers;
145 }; // _CategoryImpl
146
147 }} // Tizen::Social
148
149 #endif //_FSCL_INTERNAL_CATEGORY_IMPL_H_