Update change log and spec for wrt-plugins-tizen_0.4.11
[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 #include "ContentMedia.h"
32 #include "ContentImage.h"
33
34
35
36 namespace DeviceAPI {
37 namespace Content {
38
39 typedef void (*scanCompletedCallback)(std::string errorMessage, std::string directory, void *user_data );
40
41 class IMediacontentManager :
42         public WrtDeviceApis::Commons::EventRequestReceiver<IEventFindFolder>,
43         public WrtDeviceApis::Commons::EventRequestReceiver<IEventBrowseFolder>,
44         public WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMedia>,
45         public WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMediaItems>
46 {
47     public:
48         IMediacontentManager();
49         virtual ~IMediacontentManager();
50
51         typedef enum
52         {
53                 CONTENT_IMAGE,
54                 CONTENT_VIDEO,
55                 CONTENT_AUDIO
56         } MediacontentType;
57
58         virtual void findFolder(IEventFindFolderPtr &ptr);
59         virtual void updateMedia(IEventUpdateMediaPtr &ptr);
60         virtual void browseFolder(IEventBrowseFolderPtr &ptr);
61         virtual void updateMediaItems(IEventUpdateMediaItemsPtr &ptr);
62         virtual bool scanFile(scanCompletedCallback callback, std::string path, void* user_data);
63         virtual bool setListener(void* user_data);
64         virtual bool unsetListener();
65         virtual bool updateMetadata(MediacontentImagePtr &ptr);
66
67         virtual void OnRequestReceived(const IEventFindFolderPtr &value) = 0;
68         virtual void OnRequestReceived(const IEventUpdateMediaPtr &value) = 0;
69         virtual void OnRequestReceived(const IEventBrowseFolderPtr &value) = 0;
70         virtual void OnRequestReceived(const IEventUpdateMediaItemsPtr &value) = 0;
71
72 };
73
74 typedef DPL::SharedPtr<IMediacontentManager> IMediacontentManagerPtr;
75
76
77 }
78 }
79
80
81 #endif /* _ABSTRACT_LAYER_ICONTENT_MANAGER_H_ */