6072a59e6292827b47eaba9b3cabe3569dafa978
[apps/osp/Calendar.git] / inc / ClNodes.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 /**
18  * @file        ClNodes.h
19  * @brief       This is the header file for the EventInstanceNode class, EventInstanceListNode class, EventPtr class, and EventListNode class.
20  */
21
22 #ifndef _CL_NODES_H_
23 #define _CL_NODES_H_
24
25 #include <FBase.h>
26 #include <FSocial.h>
27
28 class EventInstanceNode
29         : public Tizen::Base::Object
30 {
31 public:
32         void AddRef(void);
33         void RemoveRef(void);
34         Tizen::Social::CalEventInstance* GetEvent(void);
35
36         EventInstanceNode(Tizen::Social::CalEventInstance& event);
37 private:
38         EventInstanceNode(void);
39         EventInstanceNode(const EventInstanceNode&);
40         virtual ~EventInstanceNode(void);
41         EventInstanceNode& operator=(const EventInstanceNode&);
42
43         Tizen::Social::CalEventInstance* __pEvent;
44         int __refCount;
45 }; // EventInstanceNode
46
47
48 class EventInstanceListNode
49         : public Tizen::Base::Object
50 {
51 public:
52         void Add(EventInstanceNode& eventNode);
53
54         const Tizen::Base::DateTime& GetDate(void) const;
55         int GetAllDayEventCount(void) const;
56         int GetEventCount(void) const;
57         int GetWholeEventCount(void) const;
58         Tizen::Social::CalEventInstance* GetAllDayEvent(int index) const;
59         Tizen::Social::CalEventInstance* GetEvent(int index) const;
60         Tizen::Social::CalEventInstance* GetEventWithWholeIndex(int index) const;
61
62         EventInstanceListNode(const Tizen::Base::DateTime& date);
63         virtual ~EventInstanceListNode(void);
64
65 private:
66         Tizen::Base::DateTime __date;
67         Tizen::Base::Collection::ArrayList* __pAllDayEvents;
68         Tizen::Base::Collection::ArrayList* __pEvents;
69 }; // EventInstanceListNode
70
71
72 class EventPtr
73         : public Tizen::Base::Object
74 {
75 public:
76         EventPtr(Tizen::Social::CalEvent& event);
77         EventPtr(const EventPtr& eventPtr);
78         virtual ~EventPtr(void);
79
80         virtual EventPtr& operator=(const EventPtr& eventPtr);
81         virtual Tizen::Social::CalEvent& operator*(void);
82         virtual Tizen::Social::CalEvent* operator->(void);
83
84 private:
85         EventPtr(void);
86
87 private:
88         Tizen::Social::CalEvent* __pEvent;
89         int* __pRefCount;
90 }; // EventPtr
91
92
93 class EventListNode
94         : public Tizen::Base::Object
95 {
96 public:
97         void Add(EventPtr& eventPtr);
98
99         const Tizen::Base::DateTime& GetDate(void) const;
100         int GetEventCount(void) const;
101         Tizen::Social::CalEvent* GetEvent(int index) const;
102
103         EventListNode(const Tizen::Base::DateTime& date);
104         virtual ~EventListNode(void);
105
106 private:
107         Tizen::Base::DateTime __date;
108         Tizen::Base::Collection::ArrayList* __pAllDayEvents;
109         Tizen::Base::Collection::ArrayList* __pEvents;
110 }; // EventListNode
111
112 #endif // _CL_NODES_H_