2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Flora License, Version 1.1 (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)
27 #include <Plugin/IBoxPluginFactory.h>
28 #include "Buffer/IRenderBuffer.h"
29 #include "View/IRenderView.h"
30 #include "Util/ITimer.h"
32 #include "IBoxState.h"
33 #include "IBoxContext.h"
37 class Box: public IBox, public IBoxContext {
39 static IBoxPtr create(
41 IBoxPluginFactoryPtr factory,
42 EwkContextPtr ewkContext)
44 return IBoxPtr(new Box(boxInfo, factory, ewkContext));
49 bool resize(int width, int height);
51 bool pause(bool background);
52 bool openPd(int width, int height, double x, double y);
54 bool update(time_t requestTime, std::string& contentInfo);
55 bool changePeriod(float period);
57 time_t getLastUpdateRequestTime();
61 RenderInfoPtr makeRenderInfo(const std::string& renderType) const;
62 void updateInternal();
65 void setState(IBoxStatePtr state);
68 static Eina_Bool updateCallback(void* data);
69 static Eina_Bool startUpdateRenderBufferIdlerCallback(void* data);
74 IBoxPluginFactoryPtr factory,
75 EwkContextPtr ewkContext);
78 IBoxPluginFactoryPtr m_factory;
79 IRenderBufferPtr m_boxBuffer;
80 IRenderBufferPtr m_pdBuffer;
81 IRenderViewPtr m_view;
82 ITimerPtr m_updateTimer;
83 //IBoxStatePtr m_state;
84 // flag for knowing this box is on current tab
86 // flag for knowing this box has been already paused
88 // flag for knowing this box should be updated when the box is resumed
90 // timestamp for saving last update request from external app
91 time_t m_lastUpdateRequestTime;
93 friend class BoxSchemeHandler;