Tizen 2.1 base
[framework/osp/social.git] / inc / FSclCalendar.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        FSclCalendar.h
19  * @brief       This is the header file for the %Calendar class.
20  *
21  * This header file contains the declarations of the %Calendar class.
22  */
23 #ifndef _FSCL_CALENDAR_H_
24 #define _FSCL_CALENDAR_H_
25
26 #include <FBaseDataType.h>
27 #include <FSclTypes.h>
28 #include <FSclRecord.h>
29
30 namespace Tizen { namespace Base
31 {
32 class Object;
33 class String;
34 }}
35
36 namespace Tizen { namespace Social
37 {
38
39 /**
40  * @class       Calendar
41  * @brief       This class represents calendar information.
42  *
43  * @since       2.0
44  *
45  * @final       This class is not intended for extension.
46  *
47  * The %Calendar class represents calendar information. @n
48  * Multiple calendars can be created, each of which can have its own events and to-dos. An event or to-do can be retrieved using the respective calendar ID.
49  */
50 class _OSP_EXPORT_ Calendar
51         : public Record
52 {
53 public:
54         /**
55          * This is the default constructor for this class.
56          *
57          * @since       2.0
58          *
59          * @param[in]   itemType                        The calendar item type to specify which kind of item the calendar can contain
60          */
61         explicit Calendar(CalendarItemType itemType);
62
63         /**
64          * Copying of objects using this copy constructor is allowed.
65          *
66          * @since       2.0
67          *
68          * @param[in]   rhs             An instance of %Calendar
69          */
70         Calendar(const Calendar& rhs);
71
72         /**
73          * This destructor overrides Tizen::Social::Record::~Record().
74          *
75          * @since       2.0
76          */
77         virtual ~Calendar(void);
78
79         /**
80          * Compares the input Tizen::Base::Object with the calling %Calendar instance.
81          *
82          * @since       2.0
83          *
84          * @return              @c true if the input object equals the calling %Calendar instance, @n
85          *                              else @c false
86          * @param[in]   rhs     The object instance to compare with the calling object
87          * @see                 GetHashCode()
88          */
89         virtual bool Equals(const Tizen::Base::Object& rhs) const;
90
91         /**
92          * Gets the hash value of the current instance.
93          *
94          * @since       2.0
95          *
96          * @return              The hash value of the current instance
97          */
98         virtual int GetHashCode(void) const;
99
100         /**
101          * Gets the calendar name.
102          *
103          * @since       2.0
104          *
105          * @return              The calendar name
106          */
107         Tizen::Base::String GetName(void) const;
108
109         /**
110          * Gets the calendar item type.
111          *
112          * @since       2.0
113          *
114          * @return              The calendar item type
115          */
116         CalendarItemType GetItemType(void) const;
117
118         /**
119          * Gets the account ID.
120          *
121          * @since       2.0
122          *
123          * @return              The account ID
124          */
125         AccountId GetAccountId(void) const;
126
127         /**
128          * Gets the calendar color. @n
129          * If the color has not been set, all color components are set with 0x0 and E_DATE_NOT_FOUND exception is returned.
130          *
131          * @since       2.0
132          *
133          * @param[out]          r               The red component
134          * @param[out]          g               The green component
135          * @param[out]          b               The blue component
136          * @exception           E_SUCCESS                                       The method is successful.
137          * @exception           E_DATA_NOT_FOUND                The color has not been set.
138          */
139         result GetColor(byte& r, byte& g, byte& b) const;
140
141         /**
142          * Sets the calendar name.
143          *
144          * @since       2.0
145          *
146          * @param[in]   name                                    The calendar name
147          */
148         void SetName(const Tizen::Base::String& name);
149
150         /**
151          * Sets the calendar color.
152          *
153          * @since       2.0
154          *
155          * @param[in]           r               The red component
156          * @param[in]           g               The green component
157          * @param[in]           b               The blue component
158          */
159         void SetColor(byte r, byte g, byte b);
160
161         /**
162          * Clears the calendar color.
163          *
164          * @since       2.0
165          */
166         void ClearColor(void);
167
168         /**
169          * Copying of objects using this copy assignment operator is allowed.
170          *
171          * @since       2.0
172          *
173          * @param[in]   rhs             An instance of %Calendar
174          */
175         Calendar& operator =(const Calendar& rhs);
176
177 private:
178         friend class _CalendarImpl;
179         class _CalendarImpl* __pCalendarImpl;
180
181 };      // Calendar
182
183 }}      // Tizen::Social
184
185 #endif // _FSCL_CALENDAR_H_