42b239f9b2b28625d2064ca21ae321d2828d7557
[framework/web/wrt-plugins-tizen.git] / src / Content / IContentManager.h
1 //
2 // Tizen Web Device API
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
19 #ifndef _ABSTRACT_LAYER_ICONTENT_MANAGER_H_
20 #define _ABSTRACT_LAYER_ICONTENT_MANAGER_H_
21
22 #include <media_content.h>
23 #include <dpl/shared_ptr.h>
24 #include <string>
25 #include <dpl/log/log.h>
26 #include <dpl/shared_ptr.h>
27 #include "IEventGetDirectories.h"
28 #include "IEventUpdate.h"
29 #include "IEventUpdateBatch.h"
30 #include "IEventFind.h"
31
32
33 namespace DeviceAPI {
34 namespace Content {
35
36 typedef void (*scanCompletedCallback)(std::string errorMessage, std::string directory, void *user_data );
37
38 class IMediacontentManager :
39         public WrtDeviceApis::Commons::EventRequestReceiver<IEventFindFolder>,
40         public WrtDeviceApis::Commons::EventRequestReceiver<IEventBrowseFolder>,
41         public WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMedia>,
42         public WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMediaItems>
43 {
44     public:
45         IMediacontentManager();
46         virtual ~IMediacontentManager();
47
48         typedef enum
49         {
50                 CONTENT_IMAGE,
51                 CONTENT_VIDEO,
52                 CONTENT_AUDIO
53         } MediacontentType;
54
55         virtual void findFolder(IEventFindFolderPtr &ptr);      
56         virtual void updateMedia(IEventUpdateMediaPtr &ptr);
57         virtual void browseFolder(IEventBrowseFolderPtr &ptr);
58         virtual void updateMediaItems(IEventUpdateMediaItemsPtr &ptr);
59         virtual bool scanFile(scanCompletedCallback callback, std::string path, void* user_data);
60         virtual bool setListener(void* user_data);
61         virtual bool unsetListener();
62
63         virtual void OnRequestReceived(const IEventFindFolderPtr &value) = 0;
64         virtual void OnRequestReceived(const IEventUpdateMediaPtr &value) = 0;
65         virtual void OnRequestReceived(const IEventBrowseFolderPtr &value) = 0; 
66         virtual void OnRequestReceived(const IEventUpdateMediaItemsPtr &value) = 0;     
67         
68 };
69
70 typedef DPL::SharedPtr<IMediacontentManager> IMediacontentManagerPtr;
71
72
73 }
74 }
75
76
77 #endif /* _ABSTRACT_LAYER_ICONTENT_MANAGER_H_ */