[content] Fix description in DownloadManager
[platform/framework/native/content.git] / inc / FCntPlayListManager.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                FCntPlayListManager.h
19  * @brief               This is the header file for the %PlayListManager class.
20  *
21  * This header file contains the declarations of the %PlayListManager class.
22  */
23
24 #ifndef _FCNT_CONTENT_PLAYLIST_MANAGER_H_
25 #define _FCNT_CONTENT_PLAYLIST_MANAGER_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 PlayList;
39 class _PlayListManagerImpl;
40
41 /**
42  *      @class       PlayListManager
43  *      @brief       This class provides methods to manage the playlist.
44  *
45  *      @since      2.0
46  *
47  *      @final       This class is not intended for extension.
48  *
49  *      The %PlayListManager class provides methods to manage the playlist.
50  *      The methods of this class are immediately access to the database and update.
51  *
52  *      The following example demonstrates how to use the %PlayListManager class.
53  *
54  *      @code
55  *      #include <FContent.h>
56  *
57  *      using namespace Tizen::Base;
58  *      using namespace Tizen::Base::Collection;
59  *      using namespace Tizen::Content;
60  *
61  *      void
62  *      MyClass::Test(void)
63  *      {
64  *              // Call an instance of PlayListManager
65  *              PlayListManager* pManager = PlayListManager::GetInstance();
66  *              if (IsFailed(GetLastResult()))
67  *              {
68  *
69  *              }
70  *
71  *              IList* pList = pManager->GetAllPlayListNameN();
72  *              if (IsFailed(GetLastResult()))
73  *              {
74  *
75  *              }
76  *
77  *              // Delete resource
78  *              pList->RemoveAll(true);
79  *              delete pList;
80  *      }
81  *
82  *      @endcode
83  */
84 class _OSP_EXPORT_ PlayListManager
85         : public Tizen::Base::Object
86 {
87
88 public:
89
90         /**
91          * Gets the playlist.
92          *
93          * @since 2.0
94          *
95          * @return     A pointer to the PlayList instance
96          * @param[in] playListName The playlist name
97          * @exception E_SUCCESS             The method is successful.
98          * @exception E_INVALID_ARG       The specified input parameter is invalid.
99          * @exception E_OUT_OF_MEMORY The memory is insufficient.
100          * @exception E_SERVICE_BUSY      The database is busy.
101          * @exception E_DATABASE              The method cannot access the database.
102          * @remarks The specific error code can be accessed using the GetLastResult() method.
103          */
104         PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
105
106         /**
107          * Removes the playlist.
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_SERVICE_BUSY  The database is busy.
116          * @exception E_DATABASE          The method cannot access the database.
117          */
118         result RemovePlayList(const Tizen::Base::String& playListName);
119
120         /**
121          * Gets the count of all playlists.
122          *
123          * @since 2.0
124          *
125          * @return     The count of all playlists
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 GetAllPlayListCount(void) const;
132
133         /**
134          * Gets all playlist names.
135          *
136          * @since 2.0
137          *
138          * @return      The list that contains playlist names as Tizen::Base::String 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* GetAllPlayListNameN(void) const;
146
147         /**
148          * Gets the playlist manager instance.
149          *
150          * @since 2.0
151          *
152          * @return      A pointer to the %PlayListManager instance
153          * @exception E_SUCCESS              The method is successful.
154          * @exception E_OUT_OF_MEMORY  The memory is insufficient.
155          * @remarks The specific error code can be accessed using the GetLastResult() method.
156          */
157         static PlayListManager* GetInstance(void);
158
159 private:
160
161         static PlayListManager* __pPlayListManager;
162
163         /**
164          * This default constructor is intentionally declared as private to implement the Singleton semantic.
165          */
166         PlayListManager(void);
167
168         /**
169          * This destructor is intentionally declared as private to implement the Singleton semantic.
170          */
171         virtual ~PlayListManager(void);
172
173         /**
174          * This constructor is intentionally declared as private so that only the platform can create an instance.
175          */
176         result Construct(void);
177
178         /**
179          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
180          */
181         PlayListManager(const PlayListManager& rhs);
182
183         /**
184          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
185          */
186         PlayListManager & operator =(const PlayListManager& rhs);
187
188         friend class _PlayListManagerImpl;
189         _PlayListManagerImpl* __pImpl;
190
191         static void InitSingleton(void);
192         static void DestroySingleton(void);
193
194 };  // class PlayListManager
195
196 }}  // Tizen::Content
197
198 #endif  // _FCNT_CONTENT_PLAYLIST_MANAGER_H_