Fix : Remove exception handling codes at the sample code
[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 help to immediately access the database and update it.
50  *
51  * The following example demonstrates how to use the %PlayListManager class.
52  *
53  * @code
54  * #include <FBase.h>
55  * #include <FContent.h>
56  *
57  * using namespace Tizen::Content;
58  *
59  * void
60  * MyClass::Test(void)
61  * {
62  *              PlayListManager* pManager = PlayListManager::GetInstance();
63  *
64  *              Tizen::Base::Collection::IList* pList = pManager->GetAllPlayListNameN();
65  *              result r = GetLastResult();
66  *
67  *              pList->RemoveAll(true);
68  *              delete pList;
69  * }
70  * @endcode
71  */
72 class _OSP_EXPORT_ PlayListManager
73         : public Tizen::Base::Object
74 {
75
76 public:
77
78         /**
79          * Gets the playlist.
80          *
81          * @since               2.0
82          *
83          * @return      A pointer to the PlayList instance
84          * @param[in]   playListName                    The playlist name
85          * @exception   E_SUCCESS               The method is successful.
86          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
87          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
88          * @exception   E_SERVICE_BUSY          The database is busy.
89          * @exception   E_DATABASE              The method cannot access the database.
90          * @remarks     The specific error code can be accessed using the GetLastResult() method.
91          */
92         PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
93
94         /**
95          * Removes the playlist.
96          *
97          * @since               2.0
98          *
99          * @return      An error code
100          * @param[in]   playListName                    The playlist name
101          * @exception   E_SUCCESS                       The method is successful.
102          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
103          * @exception   E_SERVICE_BUSY                  The database is busy.
104          * @exception   E_DATABASE              The method cannot access the database.
105          */
106         result RemovePlayList(const Tizen::Base::String& playListName);
107
108         /**
109          * Gets the count of all the playlists.
110          *
111          * @since               2.0
112          *
113          * @return      The count of all the playlists
114          * @exception   E_SUCCESS                       The method is successful.
115          * @exception   E_SERVICE_BUSY                  The database is busy.
116          * @exception   E_DATABASE              The method cannot access the database.
117          * @remarks     The specific error code can be accessed using the GetLastResult() method.
118          */
119         int GetAllPlayListCount(void) const;
120
121         /**
122          * Gets all the playlist names.
123          *
124          * @since               2.0
125          *
126          * @return      The list that contains the playlist names as Tizen::Base::String
127          * @exception   E_SUCCESS               The method is successful.
128          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
129          * @exception   E_SERVICE_BUSY          The database is busy.
130          * @exception   E_DATABASE              The method cannot access the database.
131          * @remarks     The specific error code can be accessed using the GetLastResult() method.
132          */
133         Tizen::Base::Collection::IList* GetAllPlayListNameN(void) const;
134
135         /**
136          * Gets the playlist manager instance.
137          *
138          * @since               2.0
139          *
140          * @return      A pointer to the %PlayListManager instance
141          * @exception   E_SUCCESS               The method is successful.
142          * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
143          * @remarks     The specific error code can be accessed using the GetLastResult() method.
144          */
145         static PlayListManager* GetInstance(void);
146
147 private:
148
149         static PlayListManager* __pPlayListManager;
150
151         /**
152          * This default constructor is intentionally declared as private to implement the Singleton semantic.
153          */
154         PlayListManager(void);
155
156         /**
157          * This destructor is intentionally declared as private to implement the Singleton semantic.
158          */
159         virtual ~PlayListManager(void);
160
161         /**
162          * This constructor is intentionally declared as private so that only the platform can create an instance.
163          */
164         result Construct(void);
165
166         /**
167          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
168          */
169         PlayListManager(const PlayListManager& rhs);
170
171         /**
172          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
173          */
174         PlayListManager & operator =(const PlayListManager& rhs);
175
176         friend class _PlayListManagerImpl;
177         _PlayListManagerImpl* __pImpl;
178
179         static void InitSingleton(void);
180         static void DestroySingleton(void);
181
182 };  // class PlayListManager
183
184 }}  // Tizen::Content
185
186 #endif  // _FCNT_CONTENT_PLAYLIST_MANAGER_H_