2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FCntPlayList.h
18 * @brief This is the header file for the %PlayList class.
20 * This header file contains the declarations of the %PlayList class.
23 #ifndef _FCNT_CONTENT_PLAYLIST_H_
24 #define _FCNT_CONTENT_PLAYLIST_H_
26 #include <FBaseString.h>
27 #include <FCntTypes.h>
29 namespace Tizen { namespace Base { namespace Collection
34 namespace Tizen { namespace Content
41 * @brief This class provides methods for a playlist information.
45 * @final This class is not intended for extension.
47 * The %PlayList class provides methods to access a playlist information.
48 * The methods of this class are immediately access to the database and update.
50 * The following example demonstrates how to use the %PlayList class.
53 * #include <FContent.h>
55 * using namespace Tizen::Base;
56 * using namespace Tizen::Base::Collection;
57 * using namespace Tizen::Content;
62 * // Get an instance of PlayList
64 * result r = playList.Construct("my_playlist_1");
70 * IList* pList = playList.GetContentInfoListN();
77 * pList->RemoveAll(true);
84 class _OSP_EXPORT_ PlayList
85 : public Tizen::Base::Object
91 * The object is not fully constructed after this constructor is called. @n
92 * For full construction, the Construct() method must be called right after calling this constructor.
99 * This destructor overrides Tizen::Base::Object::~Object().
103 virtual ~PlayList(void);
106 * Initializes this instance of %PlayList with the specified parameter.
110 * @return An error code
111 * @param[in] playListName The playlist name
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_INVALID_ARG The specified input parameter is invalid.
114 * @exception E_OUT_OF_MEMORY The memory is insufficient.
115 * @exception E_SERVICE_BUSY The database is busy.
116 * @exception E_DATABASE The method cannot access the database.
118 result Construct(const Tizen::Base::String& playListName);
121 * Gets the count of playlist items.
125 * @return The item count
126 * @exception E_SUCCESS The method is successful.
127 * @exception E_SERVICE_BUSY The database is busy.
128 * @exception E_DATABASE The method cannot access the database.
129 * @remarks The specific error code can be accessed using the GetLastResult() method.
131 int GetPlayListItemCount(void) const;
134 * Gets the list of playlist items.
138 * @return The list that contains playlist items as ContentInfo class
139 * @exception E_SUCCESS The method is successful.
140 * @exception E_OUT_OF_MEMORY The memory is insufficient.
141 * @exception E_SERVICE_BUSY The database is busy.
142 * @exception E_DATABASE The method cannot access the database.
143 * @remarks The specific error code can be accessed using the GetLastResult() method.
145 Tizen::Base::Collection::IList* GetContentInfoListN(void) const;
148 * Adds the item to the playlist.
152 * @return An error code
153 * @param[in] contentId The content ID
154 * @exception E_SUCCESS The method is successful.
155 * @exception E_INVALID_ARG The specified input parameter is invalid.
156 * @exception E_SERVICE_BUSY The database is busy.
157 * @exception E_DATABASE The method cannot access the database.
158 * @see AddItems(const Tizen::Base::Collection::IList&)
160 result AddItem(const ContentId& contentId);
163 * Adds the items to the playlist.
167 * @return An error code
168 * @param[in] contentIdList The list that contains ContentId
169 * @exception E_SUCCESS The method is successful.
170 * @exception E_INVALID_ARG The specified input parameter is invalid.
171 * @exception E_SERVICE_BUSY The database is busy.
172 * @exception E_DATABASE The method cannot access the database.
173 * @see AddItem(const ContentId&)
175 result AddItems(const Tizen::Base::Collection::IList& contentIdList);
178 * Removes the item from the playlist.
182 * @return An error code
183 * @param[in] contentId The content ID
184 * @exception E_SUCCESS The method is successful.
185 * @exception E_INVALID_ARG The specified input parameter is invalid.
186 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
187 * @exception E_SERVICE_BUSY The database is busy.
188 * @exception E_DATABASE The method cannot access the database.
189 * @see RemoveItems(const Tizen::Base::Collection::IList&)
191 result RemoveItem(const ContentId& contentId);
194 * Removes the items from the playlist.
198 * @return An error code
199 * @param[in] contentIdList The list that contains ContentId
200 * @exception E_SUCCESS The method is successful.
201 * @exception E_INVALID_ARG The specified input parameter is invalid.
202 * @exception E_OBJ_NOT_FOUND The specified @c contentId in the list is not found.
203 * @exception E_SERVICE_BUSY The database is busy.
204 * @exception E_DATABASE The method cannot access the database.
205 * @see RemoveItem(const ContentId&)
207 result RemoveItems(const Tizen::Base::Collection::IList& contentIdList);
210 * Gets the playlist name.
214 * @return The playlist name
216 Tizen::Base::String GetPlayListName(void) const;
219 * Sets the playlist name.
223 * @return An error code
224 * @param[in] playListName The playlist name
225 * @exception E_SUCCESS The method is successful.
226 * @exception E_INVALID_ARG The specified input parameter is invalid.
227 * @exception E_OUT_OF_MEMORY The memory is insufficient.
228 * @exception E_SERVICE_BUSY The database is busy.
229 * @exception E_DATABASE The method cannot access the database.
231 result SetPlayListName(const Tizen::Base::String& playListName);
234 * Gets the play order.
238 * @return The play order
239 * @param[in] contentId The content ID
240 * @exception E_SUCCESS The method is successful.
241 * @exception E_INVALID_ARG The specified input parameter is invalid.
242 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
243 * @exception E_SERVICE_BUSY The database is busy.
244 * @exception E_DATABASE The method cannot access the database.
245 * @remarks The specific error code can be accessed using the GetLastResult() method.
247 int GetPlayOrder(const ContentId& contentId) const;
252 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
254 PlayList(const PlayList& rhs);
257 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
259 PlayList& operator =(const PlayList& rhs);
261 friend class _PlayListImpl;
262 _PlayListImpl* __pImpl;
264 Tizen::Base::String __playListName;
266 friend class _PlayListManagerImpl;
268 result ConstructPlayList(const Tizen::Base::String& playListName);
274 #endif // _FCNT_CONTENT_PLAYLIST_H_