887600f03b666dc90547785a06d481f65a55cfcb
[platform/framework/web/web-provider.git] / src / Plugin / AppBoxPlugin / AppBoxObserver.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Flora License, Version 1.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://floralicense.org/license/
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    AppBoxObserver.h
18  * @author  Yunchan Cho (yunchan.cho@samsung.com)
19  */
20 #ifndef APP_BOX_OBSERVER_H
21 #define APP_BOX_OBSERVER_H
22
23 #include <string>
24 #include <map>
25
26 class AppBoxRenderView;
27 class AppBoxRenderBuffer;
28
29 class AppBoxObserver {
30     public:
31         static AppBoxObserver* Instance();
32         void initialize();
33         void shutdown();
34         void registerRenderView(std::string instanceId, AppBoxRenderView* view);
35         void unregisterRenderView(std::string instanceId);
36         void registerRenderBuffer(std::string instanceId, AppBoxRenderBuffer* view);
37         void unregisterRenderBuffer(std::string instanceId);
38         AppBoxRenderView* getRenderView(std::string instanceId);
39         AppBoxRenderBuffer* getRenderBuffer(std::string instanceId);
40
41     private:
42         AppBoxObserver();
43         ~AppBoxObserver();
44
45         typedef std::map<std::string, AppBoxRenderView*> RenderViewMap;
46         typedef std::pair<std::string, AppBoxRenderView*> RenderViewMapPair;
47         typedef std::map<std::string, AppBoxRenderBuffer*> RenderBufferMap;
48         typedef std::pair<std::string, AppBoxRenderBuffer*> RenderBufferMapPair;
49
50         bool m_initialized;
51         RenderViewMap m_renderViewMap;
52         RenderBufferMap m_renderBufferMap;
53         static AppBoxObserver* s_instance;
54 };
55
56 #endif //APP_BOX_OBSERVER_H