2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file IGalleryRequestManager.h
18 * @author Wojciech Bielawski (w.bielawski@samsung.com)
22 #ifndef WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_
23 #define WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_
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>
34 namespace WrtPlugins {
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>
46 class IGalleryRequestManager :
47 public ERRGetGalleries,
52 public ERRGetMediaItems,
53 public ERRGetMediaItemById
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)
66 virtual ~IGalleryRequestManager()
69 virtual void getGalleries(const IEventGetGalleriesPtr &event);
70 virtual void open(const IEventOpenPtr &event);
71 virtual void refresh(const IEventRefreshPtr &event);
72 virtual void close(const IEventClosePtr &event);
73 virtual void changeView(const IEventChangeViewPtr &event);
74 virtual void getMediaItems(const IEventGetMediaItemsPtr &event);
75 virtual void getMediaItemById(const IEventGetMediaItemByIdPtr &event);
78 virtual void OnRequestReceived(const IEventGetGalleriesPtr &event) = 0;
79 virtual void OnRequestReceived(const IEventOpenPtr &event) = 0;
80 virtual void OnRequestReceived(const IEventRefreshPtr &event) = 0;
81 virtual void OnRequestReceived(const IEventClosePtr &event) = 0;
82 virtual void OnRequestReceived(const IEventChangeViewPtr &event) = 0;
83 virtual void OnRequestReceived(const IEventGetMediaItemsPtr &event) = 0;
84 virtual void OnRequestReceived(const IEventGetMediaItemByIdPtr &event) = 0;
87 typedef DPL::SharedPtr<IGalleryRequestManager> IGalleryRequestManagerPtr;
89 class GalleryFactory : private DPL::Noncopyable
96 static GalleryFactory& getInstance();
97 IGalleryRequestManagerPtr getGalleryManager();
103 #endif //WRT_PLUGINS_IGALLERY_REQUEST_MANAGER_H_