summaryrefslogtreecommitdiff
path: root/src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h')
-rw-r--r--src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h b/src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h
new file mode 100644
index 0000000..8042f33
--- /dev/null
+++ b/src_mobile/Plugin/AppBoxPlugin/AppBoxObserver.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file AppBoxObserver.h
+ * @author Yunchan Cho (yunchan.cho@samsung.com)
+ */
+#ifndef APP_BOX_OBSERVER_H
+#define APP_BOX_OBSERVER_H
+
+#include <string>
+#include <map>
+#include <memory>
+
+class AppBoxRenderView;
+class AppBoxRenderBuffer;
+
+class AppBoxObserver {
+ public:
+ static AppBoxObserver* Instance();
+ void initialize();
+ void shutdown();
+ void registerRenderView(std::string instanceId, AppBoxRenderView* view);
+ void unregisterRenderView(std::string instanceId);
+ void registerRenderBuffer(std::string instanceId, AppBoxRenderBuffer* view);
+ void unregisterRenderBuffer(std::string instanceId);
+ AppBoxRenderView* getRenderView(std::string instanceId);
+ AppBoxRenderBuffer* getRenderBuffer(std::string instanceId);
+ std::shared_ptr<Ewk_Context> getPdEwkContext();
+
+ private:
+ AppBoxObserver();
+ ~AppBoxObserver();
+
+ typedef std::map<std::string, AppBoxRenderView*> RenderViewMap;
+ typedef std::pair<std::string, AppBoxRenderView*> RenderViewMapPair;
+ typedef std::map<std::string, AppBoxRenderBuffer*> RenderBufferMap;
+ typedef std::pair<std::string, AppBoxRenderBuffer*> RenderBufferMapPair;
+
+ bool m_initialized;
+ RenderViewMap m_renderViewMap;
+ RenderBufferMap m_renderBufferMap;
+ std::shared_ptr<Ewk_Context> m_pdEwkContext;
+ static AppBoxObserver* s_instance;
+};
+
+#endif //APP_BOX_OBSERVER_H