merge with master
[platform/framework/native/content.git] / src / inc / FCnt_PlayListManagerImpl.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                FCnt_PlayListManagerImpl.h
19  * @brief               This is the header file for the %_PlayListManagerImpl class.
20  *
21  * This header file contains the declarations of the %_PlayListManagerImpl class.
22  */
23
24 #ifndef _FCNT_INTERNAL_CONTENT_PLAYLIST_MANAGER_IMPL_H_
25 #define _FCNT_INTERNAL_CONTENT_PLAYLIST_MANAGER_IMPL_H_
26
27 #include <unique_ptr.h>
28 #include <media_content.h>
29 #include <FBaseColAllElementsDeleter.h>
30
31 namespace Tizen { namespace Content
32 {
33
34 class PlayListManager;
35 class PlayList;
36
37 struct FilterDeleter
38 {
39         void operator()(filter_h* filterHandle)
40         {
41                 media_filter_destroy(*filterHandle);
42         }
43 };
44
45 class _PlayListManagerImpl
46         : public Tizen::Base::Object
47 {
48 public:
49
50         /**
51          * This is the default constructor for this class.
52          *
53          * @since 2.1
54          */
55         _PlayListManagerImpl(void);
56
57         /**
58          * This is the destructor for this class.
59          *
60          * @since 2.1
61          */
62         virtual ~_PlayListManagerImpl(void);
63
64         result Construct(void);
65         PlayList* GetPlayListN(const Tizen::Base::String& playListName) const;
66         result RemovePlayList(const Tizen::Base::String& playListName);
67         int GetAllPlayListCount(void) const;
68         Tizen::Base::Collection::IList* GetAllPlayListNameN(void) const;
69
70         static _PlayListManagerImpl* GetInstance(PlayListManager& playListManager);
71
72         static const _PlayListManagerImpl* GetInstance(const PlayListManager& playListManager);
73
74 private:
75         _PlayListManagerImpl(const _PlayListManagerImpl& rhs);
76         _PlayListManagerImpl& operator =(const _PlayListManagerImpl& rhs);
77
78         result CreateFilter(const Tizen::Base::String& playListName) const;
79
80         result MapCoreErrorToNativeResult(int reason) const;
81         result MapCoreDatabaseErrorToNativeResult(int reason) const;
82
83         mutable std::unique_ptr<filter_h, FilterDeleter> __pFilterHandle;
84
85 };      // class _PlayListManagerImpl
86
87 }}      // Tizen::Content
88
89 #endif  // _FCNT_INTERNAL_CONTENT_PLAYLIST_MANAGER_IMPL_H_