2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://floralicense.org/license/
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.
18 * @author Yunchan Cho (yunchan.cho@samsung.com)
26 #include <Plugin/box_plugin_interface.h>
27 #include <Plugin/IBoxPluginFactory.h>
30 #include "IBoxManager.h"
32 #define EXPORT_CLASS __attribute__ ((visibility("default"))
34 class EXPORT_CLASS BoxManager: public IBoxManager {
36 static IBoxManagerPtr create(IBoxPluginFactoryPtr factory)
38 return IBoxManagerPtr(new BoxManager(factory));
40 virtual bool doCommand(const request_cmd_type type, const BoxInfoPtr& boxInfo);
41 virtual ~BoxManager();
44 virtual bool requestAddBox(BoxInfoPtr boxInfo, EwkContextPtr ewkContext);
45 virtual bool requestRemoveBox(std::string& instanceId);
46 virtual bool requestResizeBox(std::string& instanceId, int width, int height);
47 virtual bool requestResumeBox(std::string& instanceId);
48 virtual bool requestPauseBox(std::string& instanceId);
49 virtual bool requestResumeAll();
50 virtual bool requestPauseAll();
51 virtual bool requestOpenPd(
52 std::string& instanceId,
53 int width, int height, double x, double y);
54 virtual bool requestClosePd(std::string& instanceId);
55 virtual bool requestChangePeriod(std::string& instanceId, float period);
56 // ewk context deleter
57 struct EwkContextDeleter {
58 void operator()(Ewk_Context* ptr);
61 explicit BoxManager(IBoxPluginFactoryPtr factory);
65 void insertBoxMap(std::string& instanceId, IBoxPtr box);
66 void eraseBoxMap(std::string& instanceId);
67 void updateBoxMap(std::string& instanceId, IBoxPtr box);
68 IBoxPtr searchBoxMap(std::string& instanceId);
71 typedef std::map<std::string, IBoxPtr> BoxMap;
72 typedef std::pair<std::string, IBoxPtr> BoxMapPair;
74 IBoxPluginFactoryPtr m_boxFactory;
75 EwkContextPtr m_defaultContext;
78 #endif // BOX_MANAGER_H