tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / Gallery / IGalleryRequestManager.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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        IGalleryRequestManager.h
18  * @author      Wojciech Bielawski (w.bielawski@samsung.com)
19  * @version     0.1
20  */
21
22 #ifndef WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_
23 #define WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_
24
25 #include <API/Gallery/IEventGetGalleries.h>
26 #include <API/Gallery/IEventOpen.h>
27 #include <API/Gallery/IEventRefresh.h>
28 #include <API/Gallery/IEventClose.h>
29 #include <API/Gallery/IEventChangeView.h>
30 #include <API/Gallery/IEventGetMediaItems.h>
31 #include <API/Gallery/IEventGetMediaItemById.h>
32 #include <dpl/shared_ptr.h>
33
34 namespace WrtPlugins {
35 namespace Api {
36 namespace Gallery {
37 typedef Platform::EventRequestReceiver<IEventGetGalleries> ERRGetGalleries;
38 typedef Platform::EventRequestReceiver<IEventOpen> ERROpen;
39 typedef Platform::EventRequestReceiver<IEventRefresh> ERRRefresh;
40 typedef Platform::EventRequestReceiver<IEventClose> ERRClose;
41 typedef Platform::EventRequestReceiver<IEventChangeView> ERRChangeView;
42 typedef Platform::EventRequestReceiver<IEventGetMediaItems> ERRGetMediaItems;
43 typedef Platform::EventRequestReceiver<IEventGetMediaItemById>
44 ERRGetMediaItemById;
45
46 class IGalleryRequestManager :
47     public ERRGetGalleries,
48     public ERROpen,
49     public ERRRefresh,
50     public ERRClose,
51     public ERRChangeView,
52     public ERRGetMediaItems,
53     public ERRGetMediaItemById
54 {
55   public:
56     IGalleryRequestManager() :
57         ERRGetGalleries(Platform::ThreadEnum::GALLERY_THREAD),
58         ERROpen(Platform::ThreadEnum::GALLERY_THREAD),
59         ERRRefresh(Platform::ThreadEnum::GALLERY_THREAD),
60         ERRClose(Platform::ThreadEnum::GALLERY_THREAD),
61         ERRChangeView(Platform::ThreadEnum::GALLERY_THREAD),
62         ERRGetMediaItems(Platform::ThreadEnum::GALLERY_THREAD),
63         ERRGetMediaItemById(Platform::ThreadEnum::GALLERY_THREAD)
64     {
65     }
66
67     virtual ~IGalleryRequestManager()
68     {
69     }
70
71     virtual void getGalleries(const IEventGetGalleriesPtr &event);
72     virtual void open(const IEventOpenPtr &event);
73     virtual void refresh(const IEventRefreshPtr &event);
74     virtual void close(const IEventClosePtr &event);
75     virtual void changeView(const IEventChangeViewPtr &event);
76     virtual void getMediaItems(const IEventGetMediaItemsPtr &event);
77     virtual void getMediaItemById(const IEventGetMediaItemByIdPtr &event);
78
79   protected:
80     virtual void OnRequestReceived(const IEventGetGalleriesPtr &event) = 0;
81     virtual void OnRequestReceived(const IEventOpenPtr &event) = 0;
82     virtual void OnRequestReceived(const IEventRefreshPtr &event) = 0;
83     virtual void OnRequestReceived(const IEventClosePtr &event) = 0;
84     virtual void OnRequestReceived(const IEventChangeViewPtr &event) = 0;
85     virtual void OnRequestReceived(const IEventGetMediaItemsPtr &event) = 0;
86     virtual void OnRequestReceived(const IEventGetMediaItemByIdPtr &event) = 0;
87 };
88
89 typedef DPL::SharedPtr<IGalleryRequestManager> IGalleryRequestManagerPtr;
90
91 class GalleryFactory : private DPL::Noncopyable
92 {
93   protected:
94     GalleryFactory()
95     {
96     }
97   public:
98     static GalleryFactory& getInstance();
99     IGalleryRequestManagerPtr getGalleryManager();
100 };
101 }
102 }
103 }
104
105 #endif //WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_