2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FCntPlayListManager.h
19 * @brief This is the header file for the %PlayListManager class.
21 * This header file contains the declarations of the %PlayListManager class.
24 #ifndef _FCNT_CONTENT_PLAYLIST_MANAGER_H_
25 #define _FCNT_CONTENT_PLAYLIST_MANAGER_H_
27 #include <FBaseString.h>
28 #include <FCntTypes.h>
30 namespace Tizen { namespace Base { namespace Collection
35 namespace Tizen { namespace Content
39 class _PlayListManagerImpl;
42 * @class PlayListManager
43 * @brief This class provides methods to manage the playlist.
47 * @final This class is not intended for extension.
49 * The %PlayListManager class provides methods to manage the playlist.
50 * The methods of this class are immediately access to the database and update.
52 * The following example demonstrates how to use the %PlayListManager class.
55 * #include <FContent.h>
57 * using namespace Tizen::Base;
58 * using namespace Tizen::Base::Collection;
59 * using namespace Tizen::Content;
64 * // Call an instance of PlayListManager
65 * PlayListManager* pManager = PlayListManager::GetInstance();
66 * if (IsFailed(GetLastResult()))
71 * IList* pList = pManager->GetAllPlayListNameN();
72 * if (IsFailed(GetLastResult()))
78 * pList->RemoveAll(true);
84 class _OSP_EXPORT_ PlayListManager
85 : public Tizen::Base::Object
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.
104 PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
107 * Removes the playlist.
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.
118 result RemovePlayList(const Tizen::Base::String& playListName);
121 * Gets the count of all playlists.
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.
131 int GetAllPlayListCount(void) const;
134 * Gets all playlist names.
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.
145 Tizen::Base::Collection::IList* GetAllPlayListNameN(void) const;
148 * Gets the playlist manager instance.
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.
157 static PlayListManager* GetInstance(void);
161 static PlayListManager* __pPlayListManager;
164 * This default constructor is intentionally declared as private to implement the Singleton semantic.
166 PlayListManager(void);
169 * This destructor is intentionally declared as private to implement the Singleton semantic.
171 virtual ~PlayListManager(void);
174 * This constructor is intentionally declared as private so that only the platform can create an instance.
176 result Construct(void);
179 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
181 PlayListManager(const PlayListManager& rhs);
184 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
186 PlayListManager & operator =(const PlayListManager& rhs);
188 friend class _PlayListManagerImpl;
189 _PlayListManagerImpl* __pImpl;
191 static void InitSingleton(void);
192 static void DestroySingleton(void);
194 }; // class PlayListManager
198 #endif // _FCNT_CONTENT_PLAYLIST_MANAGER_H_