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 to access the playlist information.
45 * @final This class is not intended for extension.
47 * The %PlayList class provides methods to access the playlist information.
48 * The methods of this class help to immediately access the database and update it.
50 * The following example demonstrates how to use the %PlayList class.
54 * #include <FContent.h>
56 * using namespace Tizen::Content;
62 * result r = playList.Construct("my_playlist_1");
64 * Tizen::Base::Collection::IList* pList = playList.GetContentInfoListN();
65 * r = GetLastResult();
67 * pList->RemoveAll(true);
74 class _OSP_EXPORT_ PlayList
75 : public Tizen::Base::Object
81 * The object is not fully constructed after this constructor is called. @n
82 * For full construction, the Construct() method must be called right after calling this constructor.
89 * This destructor overrides Tizen::Base::Object::~Object().
93 virtual ~PlayList(void);
96 * Initializes this instance of %PlayList with the specified parameter.
100 * @return An error code
101 * @param[in] playListName The playlist name
102 * @exception E_SUCCESS The method is successful.
103 * @exception E_INVALID_ARG The specified input parameter is invalid.
104 * @exception E_OUT_OF_MEMORY The memory is insufficient.
105 * @exception E_SERVICE_BUSY The database is busy.
106 * @exception E_DATABASE The method cannot access the database.
108 result Construct(const Tizen::Base::String& playListName);
111 * Gets the count of the playlist items.
115 * @return The item count
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_SERVICE_BUSY The database is busy.
118 * @exception E_DATABASE The method cannot access the database.
119 * @remarks The specific error code can be accessed using the GetLastResult() method.
121 int GetPlayListItemCount(void) const;
124 * Gets the list of playlist items.
128 * @return The list that contains the playlist items as ContentInfo
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_OUT_OF_MEMORY The memory is insufficient.
131 * @exception E_SERVICE_BUSY The database is busy.
132 * @exception E_DATABASE The method cannot access the database.
133 * @remarks The specific error code can be accessed using the GetLastResult() method.
135 Tizen::Base::Collection::IList* GetContentInfoListN(void) const;
138 * Adds an item to the playlist.
142 * @return An error code
143 * @param[in] contentId The content ID
144 * @exception E_SUCCESS The method is successful.
145 * @exception E_INVALID_ARG The specified input parameter is invalid.
146 * @exception E_SERVICE_BUSY The database is busy.
147 * @exception E_DATABASE The method cannot access the database.
148 * @see AddItems(const Tizen::Base::Collection::IList&)
150 result AddItem(const ContentId& contentId);
153 * Adds items to the playlist.
157 * @return An error code
158 * @param[in] contentIdList The list that contains content IDs
159 * @exception E_SUCCESS The method is successful.
160 * @exception E_INVALID_ARG The specified input parameter is invalid.
161 * @exception E_SERVICE_BUSY The database is busy.
162 * @exception E_DATABASE The method cannot access the database.
163 * @see AddItem(const ContentId&)
165 result AddItems(const Tizen::Base::Collection::IList& contentIdList);
168 * Removes an item from the playlist.
172 * @return An error code
173 * @param[in] contentId The content ID
174 * @exception E_SUCCESS The method is successful.
175 * @exception E_INVALID_ARG The specified input parameter is invalid.
176 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
177 * @exception E_SERVICE_BUSY The database is busy.
178 * @exception E_DATABASE The method cannot access the database.
179 * @see RemoveItems(const Tizen::Base::Collection::IList&)
181 result RemoveItem(const ContentId& contentId);
184 * Removes items from the playlist.
188 * @return An error code
189 * @param[in] contentIdList The list that contains content IDs
190 * @exception E_SUCCESS The method is successful.
191 * @exception E_INVALID_ARG The specified input parameter is invalid.
192 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
193 * @exception E_SERVICE_BUSY The database is busy.
194 * @exception E_DATABASE The method cannot access the database.
195 * @see RemoveItem(const ContentId&)
197 result RemoveItems(const Tizen::Base::Collection::IList& contentIdList);
200 * Gets the playlist name.
204 * @return The playlist name
206 Tizen::Base::String GetPlayListName(void) const;
209 * Sets the playlist name.
213 * @return An error code
214 * @param[in] playListName The playlist name
215 * @exception E_SUCCESS The method is successful.
216 * @exception E_INVALID_ARG The specified input parameter is invalid.
217 * @exception E_OUT_OF_MEMORY The memory is insufficient.
218 * @exception E_SERVICE_BUSY The database is busy.
219 * @exception E_DATABASE The method cannot access the database.
221 result SetPlayListName(const Tizen::Base::String& playListName);
224 * Gets the play order.
228 * @return The play order
229 * @param[in] contentId The content ID
230 * @exception E_SUCCESS The method is successful.
231 * @exception E_INVALID_ARG The specified input parameter is invalid.
232 * @exception E_OBJ_NOT_FOUND The specified @c contentId is not found.
233 * @exception E_SERVICE_BUSY The database is busy.
234 * @exception E_DATABASE The method cannot access the database.
235 * @remarks The specific error code can be accessed using the GetLastResult() method.
237 int GetPlayOrder(const ContentId& contentId) const;
242 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
244 PlayList(const PlayList& rhs);
247 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
249 PlayList& operator =(const PlayList& rhs);
251 friend class _PlayListImpl;
252 _PlayListImpl* __pImpl;
254 Tizen::Base::String __playListName;
256 friend class _PlayListManagerImpl;
258 result ConstructPlayList(const Tizen::Base::String& playListName);
264 #endif // _FCNT_CONTENT_PLAYLIST_H_