2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FCntPlayList.h
19 * @brief This is the header file for the %PlayList class.
21 * This header file contains the declarations of the %PlayList class.
24 #ifndef _FCNT_CONTENT_PLAYLIST_H_
25 #define _FCNT_CONTENT_PLAYLIST_H_
27 #include <FBaseString.h>
28 #include <FCntTypes.h>
30 namespace Tizen { namespace Base { namespace Collection
35 namespace Tizen { namespace Content
42 * @brief This class provides methods for a playlist information.
46 * @final This class is not intended for extension.
48 * The %PlayList class provides methods to access a playlist information.
49 * The methods of this class are immediately access to the database and update.
51 * The following example demonstrates how to use the %PlayList class.
54 * #include <FContent.h>
56 * using namespace Tizen::Base;
57 * using namespace Tizen::Base::Collection;
58 * using namespace Tizen::Content;
63 * // Get an instance of PlayList
65 * result r = playList.Construct("my_playlist_1");
71 * IList* pList = playList.GetContentInfoListN();
78 * pList->RemoveAll(true);
85 class _OSP_EXPORT_ PlayList
86 : public Tizen::Base::Object
92 * The object is not fully constructed after this constructor is called. @n
93 * For full construction, the Construct() method must be called right after calling this constructor.
100 * This destructor overrides Tizen::Base::Object::~Object().
104 virtual ~PlayList(void);
107 * Initializes this instance of %PlayList with the specified parameter.
111 * @return An error code
112 * @param[in] playListName The playlist name
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_INVALID_ARG The specified input parameter is invalid.
115 * @exception E_OUT_OF_MEMORY The memory is insufficient.
116 * @exception E_SERVICE_BUSY The database is busy.
117 * @exception E_DATABASE The method cannot access the database.
119 result Construct(const Tizen::Base::String& playListName);
122 * Gets the count of playlist items.
126 * @return The item count
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_SERVICE_BUSY The database is busy.
129 * @exception E_DATABASE The method cannot access the database.
130 * @remarks The specific error code can be accessed using the GetLastResult() method.
132 int GetPlayListItemCount(void) const;
135 * Gets the list of playlist items.
139 * @return The list that contains playlist items as ContentInfo class
140 * @exception E_SUCCESS The method is successful.
141 * @exception E_OUT_OF_MEMORY The memory is insufficient.
142 * @exception E_SERVICE_BUSY The database is busy.
143 * @exception E_DATABASE The method cannot access the database.
144 * @remarks The specific error code can be accessed using the GetLastResult() method.
146 Tizen::Base::Collection::IList* GetContentInfoListN(void) const;
149 * Adds the item to the playlist.
153 * @return An error code
154 * @param[in] contentId The content ID
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_INVALID_ARG The specified input parameter is invalid.
157 * @exception E_SERVICE_BUSY The database is busy.
158 * @exception E_DATABASE The method cannot access the database.
159 * @see AddItems(const Tizen::Base::Collection::IList&)
161 result AddItem(const ContentId& contentId);
164 * Adds the items to the playlist.
168 * @return An error code
169 * @param[in] contentIdList The list that contains ContentId
170 * @exception E_SUCCESS The method is successful.
171 * @exception E_INVALID_ARG The specified input parameter is invalid.
172 * @exception E_SERVICE_BUSY The database is busy.
173 * @exception E_DATABASE The method cannot access the database.
174 * @see AddItem(const ContentId&)
176 result AddItems(const Tizen::Base::Collection::IList& contentIdList);
179 * Removes the item from the playlist.
183 * @return An error code
184 * @param[in] contentId The content ID
185 * @exception E_SUCCESS The method is successful.
186 * @exception E_INVALID_ARG The specified input parameter is invalid.
187 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
188 * @exception E_SERVICE_BUSY The database is busy.
189 * @exception E_DATABASE The method cannot access the database.
190 * @see RemoveItems(const Tizen::Base::Collection::IList&)
192 result RemoveItem(const ContentId& contentId);
195 * Removes the items from the playlist.
199 * @return An error code
200 * @param[in] contentIdList The list that contains ContentId
201 * @exception E_SUCCESS The method is successful.
202 * @exception E_INVALID_ARG The specified input parameter is invalid.
203 * @exception E_OBJ_NOT_FOUND The specified @c contentId in the list is not found.
204 * @exception E_SERVICE_BUSY The database is busy.
205 * @exception E_DATABASE The method cannot access the database.
206 * @see RemoveItem(const ContentId&)
208 result RemoveItems(const Tizen::Base::Collection::IList& contentIdList);
211 * Gets the playlist name.
215 * @return The playlist name
217 Tizen::Base::String GetPlayListName(void) const;
220 * Sets the playlist name.
224 * @return An error code
225 * @param[in] playListName The playlist name
226 * @exception E_SUCCESS The method is successful.
227 * @exception E_INVALID_ARG The specified input parameter is invalid.
228 * @exception E_OUT_OF_MEMORY The memory is insufficient.
229 * @exception E_SERVICE_BUSY The database is busy.
230 * @exception E_DATABASE The method cannot access the database.
232 result SetPlayListName(const Tizen::Base::String& playListName);
235 * Gets the play order.
239 * @return The play order
240 * @param[in] contentId The content ID
241 * @exception E_SUCCESS The method is successful.
242 * @exception E_INVALID_ARG The specified input parameter is invalid.
243 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
244 * @exception E_SERVICE_BUSY The database is busy.
245 * @exception E_DATABASE The method cannot access the database.
246 * @remarks The specific error code can be accessed using the GetLastResult() method.
248 int GetPlayOrder(const ContentId& contentId) const;
253 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
255 PlayList(const PlayList& rhs);
258 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
260 PlayList& operator =(const PlayList& rhs);
262 friend class _PlayListImpl;
263 _PlayListImpl* __pImpl;
265 Tizen::Base::String __playListName;
267 friend class _PlayListManagerImpl;
269 result ConstructPlayList(const Tizen::Base::String& playListName);
275 #endif // _FCNT_CONTENT_PLAYLIST_H_