[content] Fix a description for ContentManager
[platform/framework/native/content.git] / inc / FCntPlayList.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file                FCntPlayList.h
19  * @brief               This is the header file for the %PlayList class.
20  *
21  * This header file contains the declarations of the %PlayList class.
22  */
23
24 #ifndef _FCNT_CONTENT_PLAYLIST_H_
25 #define _FCNT_CONTENT_PLAYLIST_H_
26
27 #include <FBaseString.h>
28 #include <FCntTypes.h>
29
30 namespace Tizen { namespace Base { namespace Collection
31 {
32 class IList;
33 }}}
34
35 namespace Tizen { namespace Content
36 {
37
38 class _PlayListImpl;
39
40 /**
41  *      @class          PlayList
42  *      @brief          This class provides methods for a playlist information.
43  *
44  *      @since         2.0
45  *
46  *      @final       This class is not intended for extension.
47  *
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.
50  *
51  *      The following example demonstrates how to use the %PlayList class.
52  *
53  *      @code
54  *      #include <FContent.h>
55  *
56  *      using namespace Tizen::Base;
57  *      using namespace Tizen::Base::Collection;
58  *      using namespace Tizen::Content;
59  *
60  *      void
61  *      MyClass::Test(void)
62  *      {
63  *              // Get an instance of PlayList
64  *              PlayList playList;
65  *              result r = playList.Construct("my_playlist_1");
66  *              if (IsFailed(r))
67  *              {
68  *
69  *              }
70  *
71  *              IList* pList = playList.GetContentInfoListN();
72  *              if (IsFailed(r))
73  *              {
74  *
75  *              }
76  *
77  *              // Delete resource
78  *              pList->RemoveAll(true);
79  *              delete pList;
80  *      }
81  *
82  *      @endcode
83  *
84  */
85 class _OSP_EXPORT_ PlayList
86         : public Tizen::Base::Object
87 {
88
89 public:
90
91         /**
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.
94          *
95          * @since 2.0
96          */
97         PlayList(void);
98
99         /**
100          * This destructor overrides Tizen::Base::Object::~Object().
101          *
102          * @since 2.0
103          */
104         virtual ~PlayList(void);
105
106         /**
107          * Initializes this instance of %PlayList with the specified parameter.
108          *
109          * @since 2.0
110          *
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.
118          */
119         result Construct(const Tizen::Base::String& playListName);
120
121         /**
122          * Gets the count of playlist items.
123          *
124          * @since 2.0
125          *
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.
131          */
132         int GetPlayListItemCount(void) const;
133
134         /**
135          * Gets the list of playlist items.
136          *
137          * @since 2.0
138          *
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.
145          */
146         Tizen::Base::Collection::IList* GetContentInfoListN(void) const;
147
148         /**
149          * Adds the item to the playlist.
150          *
151          * @since 2.0
152          *
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&)
160          */
161         result AddItem(const ContentId& contentId);
162
163         /**
164          * Adds the items to the playlist.
165          *
166          * @since 2.0
167          *
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&)
175          */
176         result AddItems(const Tizen::Base::Collection::IList& contentIdList);
177
178         /**
179          * Removes the item from the playlist.
180          *
181          * @since 2.0
182          *
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&)
191          */
192         result RemoveItem(const ContentId& contentId);
193
194         /**
195          * Removes the items from the playlist.
196          *
197          * @since 2.0
198          *
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&)
207          */
208         result RemoveItems(const Tizen::Base::Collection::IList& contentIdList);  
209
210         /**
211          * Gets the playlist name.
212          *
213          * @since 2.0
214          *
215          * @return    The playlist name
216          */
217         Tizen::Base::String GetPlayListName(void) const;   
218
219         /**
220          * Sets the playlist name.
221          *
222          * @since 2.0
223          *
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.
231          */
232         result SetPlayListName(const Tizen::Base::String& playListName);
233
234         /**
235          * Gets the play order.
236          *
237          * @since 2.0
238          *
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.
247          */
248         int GetPlayOrder(const ContentId& contentId) const;
249
250 private:
251
252         /**
253          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
254          */
255         PlayList(const PlayList& rhs);
256
257         /**
258          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
259          */
260         PlayList& operator =(const PlayList& rhs);
261
262         friend class _PlayListImpl;
263         _PlayListImpl* __pImpl;
264
265         Tizen::Base::String __playListName;
266
267         friend class _PlayListManagerImpl;
268
269         result ConstructPlayList(const Tizen::Base::String& playListName);
270
271 };  // class PlayList
272
273 }}  // Tizen::Content
274
275 #endif  // _FCNT_CONTENT_PLAYLIST_H_