4d0a0afc92d84b9be214d3d7e5dcd213b5c34f8e
[platform/framework/native/content.git] / inc / FCntPlayListManager.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                FCntPlayListManager.h
18  * @brief               This is the header file for the %PlayListManager class.
19  *
20  * This header file contains the declarations of the %PlayListManager class.
21  */
22
23 #ifndef _FCNT_CONTENT_PLAYLIST_MANAGER_H_
24 #define _FCNT_CONTENT_PLAYLIST_MANAGER_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 PlayList;
38 class _PlayListManagerImpl;
39
40 /**
41  *      @class       PlayListManager
42  *      @brief       This class provides methods to manage the playlist.
43  *
44  *      @since      2.0
45  *
46  *      @final       This class is not intended for extension.
47  *
48  *      The %PlayListManager class provides methods to manage the playlist.
49  *      The methods of this class are immediately access to the database and update.
50  *
51  *      The following example demonstrates how to use the %PlayListManager 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  *              // Call an instance of PlayListManager
64  *              PlayListManager* pManager = PlayListManager::GetInstance();
65  *              if (IsFailed(GetLastResult()))
66  *              {
67  *
68  *              }
69  *
70  *              IList* pList = pManager->GetAllPlayListNameN();
71  *              if (IsFailed(GetLastResult()))
72  *              {
73  *
74  *              }
75  *
76  *              // Delete resource
77  *              pList->RemoveAll(true);
78  *              delete pList;
79  *      }
80  *
81  *      @endcode
82  */
83 class _OSP_EXPORT_ PlayListManager
84         : public Tizen::Base::Object
85 {
86
87 public:
88
89         /**
90          * Gets the playlist.
91          *
92          * @since 2.0
93          *
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.
102          */
103         PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
104
105         /**
106          * Removes the playlist.
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_SERVICE_BUSY  The database is busy.
115          * @exception E_DATABASE          The method cannot access the database.
116          */
117         result RemovePlayList(const Tizen::Base::String& playListName);
118
119         /**
120          * Gets the count of all playlists.
121          *
122          * @since 2.0
123          *
124          * @return     The count of all 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.
129          */
130         int GetAllPlayListCount(void) const;
131
132         /**
133          * Gets all playlist names.
134          *
135          * @since 2.0
136          *
137          * @return      The list that contains playlist names as Tizen::Base::String class
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.
143          */
144         Tizen::Base::Collection::IList* GetAllPlayListNameN(void) const;
145
146         /**
147          * Gets the playlist manager instance.
148          *
149          * @since 2.0
150          *
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.
155          */
156         static PlayListManager* GetInstance(void);
157
158 private:
159
160         static PlayListManager* __pPlayListManager;
161
162         /**
163          * This default constructor is intentionally declared as private to implement the Singleton semantic.
164          */
165         PlayListManager(void);
166
167         /**
168          * This destructor is intentionally declared as private to implement the Singleton semantic.
169          */
170         virtual ~PlayListManager(void);
171
172         /**
173          * This constructor is intentionally declared as private so that only the platform can create an instance.
174          */
175         result Construct(void);
176
177         /**
178          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
179          */
180         PlayListManager(const PlayListManager& rhs);
181
182         /**
183          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
184          */
185         PlayListManager & operator =(const PlayListManager& rhs);
186
187         friend class _PlayListManagerImpl;
188         _PlayListManagerImpl* __pImpl;
189
190         static void InitSingleton(void);
191         static void DestroySingleton(void);
192
193 };  // class PlayListManager
194
195 }}  // Tizen::Content
196
197 #endif  // _FCNT_CONTENT_PLAYLIST_MANAGER_H_