Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Mediacontent / IEventFindMedia.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
18 #ifndef _ABSTRACT_LAYER_IEVENT_FIND_MEDIA_H_
19 #define _ABSTRACT_LAYER_IEVENT_FIND_MEDIA_H_
20
21 #include <vector>
22 #include <Commons/IEvent.h>
23 #include <API/Filter/IFilter.h>
24 #include <API/Filter/SortMode.h>
25
26 #include <dpl/shared_ptr.h>
27 #include "MediacontentMedia.h"
28
29 using namespace TizenApis::Api::Tizen;
30
31 namespace TizenApis {
32 namespace Api {
33 namespace Mediacontent {
34
35 class IEventFindMedia : public WrtDeviceApis::Commons::IEvent<IEventFindMedia>
36 {
37
38         public:
39                 
40         IEventFindMedia()
41         {
42                 m_result = false;
43                 m_filterIsSet = false;
44                 m_sortModesIsSet = false;
45                 m_limitIsSet = false;
46                 m_offsetIsSet = false;
47
48         }
49         
50                 
51         virtual ~IEventFindMedia(){}
52
53         void addMedia(MediacontentMedia *value)
54         {
55                 MediacontentMediaPtr mediaItem(value);
56                 m_media.push_back(mediaItem);   
57         }
58
59         vector<MediacontentMediaPtr> getMedia()
60         {       
61                 return m_media; 
62         }
63         
64
65         void setLimit(const unsigned long value)
66         {
67                 m_limitIsSet = true;
68                 m_limit = value;
69         }
70         void setOffset(const unsigned long value)
71         {
72                 m_offsetIsSet = true;
73                 m_offset = value;
74         }
75
76         void setFilter(const Tizen::FilterPtr &value)
77         {
78                 m_filter = value;
79                 m_filterIsSet = true;
80         }
81
82         void setSortModes(const Tizen::SortModeArrayPtr &value)
83         {
84                 m_sortModes = value;
85                 m_sortModesIsSet = true;
86         }
87
88         void setResult(bool value)
89         {
90                 m_result = value;
91         }
92
93         bool getLimitIsSet() const
94         {
95                 return m_limitIsSet;
96         }
97         
98         bool getOffsetIsSet() const
99         {
100                 return m_offsetIsSet;
101         }
102
103         bool getResult()const
104         {
105                 return m_result; 
106         }
107
108         bool getFilterIsSet()const
109         {
110                 return m_filterIsSet; 
111         }
112         
113         bool getSortModesIsSet()const
114         {
115                 return m_sortModesIsSet; 
116         }
117
118         unsigned long getLimit() const
119         {
120                 return m_limit;
121         }
122         
123         unsigned long getOffset() const
124         {
125                 return m_offset;
126         }       
127
128         FilterPtr getFilter() const
129         {
130                 return m_filter;
131         }
132         
133         SortModeArrayPtr getSortModes() const
134         {
135                 return m_sortModes;
136         }
137
138
139         private:
140         bool m_filterIsSet;
141         bool m_sortModesIsSet;
142
143         bool m_result;                                                                  //OUTPUT: operation result
144         bool m_limitIsSet;
145         bool m_offsetIsSet;
146
147         unsigned long m_limit;
148         unsigned long m_offset;
149         FilterPtr m_filter;
150         SortModeArrayPtr m_sortModes;
151
152         vector<MediacontentMediaPtr> m_media;  
153
154 };
155
156 typedef DPL::SharedPtr<IEventFindMedia> IEventFindMediaPtr;
157
158 }
159 }
160 }
161 #endif /* _ABSTRACT_LAYER_IEVENT_FIND_MEDIA_H_ */