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 FCntPlayListManager.h
18 * @brief This is the header file for the %PlayListManager class.
20 * This header file contains the declarations of the %PlayListManager class.
23 #ifndef _FCNT_CONTENT_PLAYLIST_MANAGER_H_
24 #define _FCNT_CONTENT_PLAYLIST_MANAGER_H_
26 #include <FBaseString.h>
27 #include <FCntTypes.h>
29 namespace Tizen { namespace Base { namespace Collection
34 namespace Tizen { namespace Content
38 class _PlayListManagerImpl;
41 * @class PlayListManager
42 * @brief This class provides methods to manage the playlist.
46 * @final This class is not intended for extension.
48 * The %PlayListManager class provides methods to manage the playlist.
49 * The methods of this class help to immediately access the database and update it.
51 * The following example demonstrates how to use the %PlayListManager class.
54 * #include <FContent.h>
56 * using namespace Tizen::Base;
57 * using namespace Tizen::Base::Collection;
58 * using namespace Tizen::Content;
63 * // Call an instance of PlayListManager
64 * PlayListManager* pManager = PlayListManager::GetInstance();
65 * if (IsFailed(GetLastResult()))
70 * IList* pList = pManager->GetAllPlayListNameN();
71 * if (IsFailed(GetLastResult()))
77 * pList->RemoveAll(true);
83 class _OSP_EXPORT_ PlayListManager
84 : public Tizen::Base::Object
94 * @return A pointer to the PlayList instance
95 * @param[in] playListName The playlist name
96 * @exception E_SUCCESS The method is successful.
97 * @exception E_INVALID_ARG The specified input parameter is invalid.
98 * @exception E_OUT_OF_MEMORY The memory is insufficient.
99 * @exception E_SERVICE_BUSY The database is busy.
100 * @exception E_DATABASE The method cannot access the database.
101 * @remarks The specific error code can be accessed using the GetLastResult() method.
103 PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
106 * Removes the playlist.
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_SERVICE_BUSY The database is busy.
115 * @exception E_DATABASE The method cannot access the database.
117 result RemovePlayList(const Tizen::Base::String& playListName);
120 * Gets the count of all the playlists.
124 * @return The count of all the playlists
125 * @exception E_SUCCESS The method is successful.
126 * @exception E_SERVICE_BUSY The database is busy.
127 * @exception E_DATABASE The method cannot access the database.
128 * @remarks The specific error code can be accessed using the GetLastResult() method.
130 int GetAllPlayListCount(void) const;
133 * Gets all the playlist names.
137 * @return The list that contains the playlist names as Tizen::Base::String
138 * @exception E_SUCCESS The method is successful.
139 * @exception E_OUT_OF_MEMORY The memory is insufficient.
140 * @exception E_SERVICE_BUSY The database is busy.
141 * @exception E_DATABASE The method cannot access the database.
142 * @remarks The specific error code can be accessed using the GetLastResult() method.
144 Tizen::Base::Collection::IList* GetAllPlayListNameN(void) const;
147 * Gets the playlist manager instance.
151 * @return A pointer to the %PlayListManager instance
152 * @exception E_SUCCESS The method is successful.
153 * @exception E_OUT_OF_MEMORY The memory is insufficient.
154 * @remarks The specific error code can be accessed using the GetLastResult() method.
156 static PlayListManager* GetInstance(void);
160 static PlayListManager* __pPlayListManager;
163 * This default constructor is intentionally declared as private to implement the Singleton semantic.
165 PlayListManager(void);
168 * This destructor is intentionally declared as private to implement the Singleton semantic.
170 virtual ~PlayListManager(void);
173 * This constructor is intentionally declared as private so that only the platform can create an instance.
175 result Construct(void);
178 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
180 PlayListManager(const PlayListManager& rhs);
183 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
185 PlayListManager & operator =(const PlayListManager& rhs);
187 friend class _PlayListManagerImpl;
188 _PlayListManagerImpl* __pImpl;
190 static void InitSingleton(void);
191 static void DestroySingleton(void);
193 }; // class PlayListManager
197 #endif // _FCNT_CONTENT_PLAYLIST_MANAGER_H_