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