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