Tizen 2.1 base
[framework/osp/social.git] / src / inc / FScl_CalendarImpl.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_CalendarImpl.h
19  * @brief       This is the header file for the _CalendarImpl class.
20  *
21  * This header file contains the declarations of the _CalendarImpl class.
22  */
23
24 #ifndef _FSCL_INTERNAL_CALENDAR_IMPL_H_
25 #define _FSCL_INTERNAL_CALENDAR_IMPL_H_
26
27 #include <unique_ptr.h>
28 #include <calendar2.h>
29 #include <FBaseObject.h>
30 #include <FBaseDataType.h>
31 #include <FSclTypes.h>
32 #include "FScl_CalendarbookUtil.h"
33
34 namespace Tizen { namespace Base
35 {
36 class String;
37 } }
38
39 namespace Tizen { namespace Social
40 {
41
42 class Calendar;
43
44 /**
45  *      @class  _CalendarImpl
46  */
47 class _CalendarImpl
48         : public Tizen::Base::Object
49 {
50 public:
51         /**
52          * This is the default constructor for this class.
53          *
54          * @param[in]   itemType                                The calendar item type
55          */
56         _CalendarImpl(CalendarItemType itemType);
57
58         /**
59          * Copying of objects using this copy constructor is allowed.
60          *
61          * @param[in]   rhs             An instance of _CalendarImpl
62          */
63         _CalendarImpl(const _CalendarImpl& rhs);
64
65         /**
66          * This destructor overrides Tizen::Base::Object::~Object().
67          */
68         virtual ~_CalendarImpl(void);
69
70         /**
71          * Gets the calendar name.
72          *
73          * @return              The calendar name
74          */
75         Tizen::Base::String GetName(void) const;
76
77         /**
78          * Gets the calendar item type.
79          *
80          * @return              The calendar item type
81          */
82         CalendarItemType GetItemType(void) const;
83
84         /**
85          * Gets the account ID.
86          *
87          * @return              The account ID
88          */
89         AccountId GetAccountId(void) const;
90
91         /**
92          * Gets the calendar color.
93          * If the color is unset, the color components will be set to 0x0.
94          *
95          * @param[out]          red                     The red component
96          * @param[out]          green           The green component
97          * @param[out]          blue                    The blue component
98          * @exception           E_SUCCESS                                       The method is successful.
99          * @exception           E_DATA_NOT_FOUND                The color is unset.
100          */
101         result GetColor(byte& red, byte& green, byte& blue) const;
102
103         /**
104          * Sets the calendar name.
105          *
106          * @param[in]   name                            The calendar name
107          */
108         void SetName(const Tizen::Base::String& name);
109
110         /**
111          * Sets the calendar color.
112          *
113          * @param[in]           red                     The red component
114          * @param[in]           green           The green component
115          * @param[in]           blue                    The blue component
116          */
117         void SetColor(byte red, byte green, byte blue);
118
119         /**
120          * Clears the calendar color.
121          */
122         void ClearColor(void);
123
124         /**
125          * Sets the account ID.
126          *
127          * @param[in]   accountId                       The account ID
128          */
129         void SetAccountId(AccountId accountId);
130
131         //
132         // Sets the record handle
133         //
134         void SetRecordHandle(calendar_record_h calendarHandle);
135
136         //
137         // Gets the record handle
138         //
139         calendar_record_h GetRecordHandle(void) const;
140
141         static Calendar* CreateDefaultInstanceN(void);
142
143         /**
144          * Gets the Impl instance.
145          *
146          * @return                      The pointer to const _CalendarImpl
147          * @param[in]   calendar                A const instance of %Calendar class
148          */
149         static _CalendarImpl* GetInstance(Calendar& calendar);
150
151         /**
152          * Gets the Impl instance.
153          *
154          * @return                      The pointer to const _CalendarImpl
155          * @param[in]   calendar                A const instance of %Calendar class
156          */
157         static const _CalendarImpl* GetInstance(const Calendar& calendar);
158
159         /**
160          * Copying of objects using this copy assignment operator is allowed.
161          *
162          * @param[in]   rhs             An instance of _CalendarImpl
163          */
164         _CalendarImpl& operator =(const _CalendarImpl& rhs);
165
166 private:
167
168         _CalendarRecord __calendarRecord;
169
170 };      // _CalendarImpl
171
172 }}      // Tizen::Social
173
174 #endif //_FSCL_INTERNAL_CALENDAR_IMPL_H_