2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FShell_AppWidgetLayer.h
19 * @brief This is the header file for the _AppWidgetLayer class.
21 * This header file contains the declarations of the %_AppWidgetLayer class.
23 #ifndef _FSHELL_INTERNAL_APPWIDGET_LAYER_H_
24 #define _FSHELL_INTERNAL_APPWIDGET_LAYER_H_
26 #include <unique_ptr.h>
27 #include <Ecore_Evas.h>
28 #include <FBaseString.h>
29 #include "FUiAnim_EflLayer.h"
30 #include "FShell_IAppWidgetTouchEventListener.h"
32 namespace Tizen { namespace Ui
37 namespace Tizen { namespace Shell
40 class _AppWidgetBuffer;
43 * @class _AppWidgetLayer
48 : public Tizen::Ui::Animations::_EflLayer
49 , public Tizen::Shell::_IAppWidgetTouchEventListener
52 _AppWidgetLayer(const Tizen::Base::String& providerId, const Tizen::Graphics::FloatDimension& size);
53 virtual ~_AppWidgetLayer(void);
55 virtual result OnConstructed(void);
57 result SetProviderId(const Tizen::Base::String& providerId);
58 Tizen::Base::String GetProviderId(void) const;
59 int GetPixmapId(void) const;
60 void SetLayerBounds(const Tizen::Graphics::FloatRectangle& bounds);
61 void* AllocCanvas(int size);
62 void FreeCanvas(void* pCanvas);
63 int EventHandler(int eventType, double timestamp, double x, double y);
64 result SyncPixmap(const Tizen::Graphics::FloatDimension& size);
65 void OnRendered(void);
67 virtual result RegisterTouchEventListener(void);
68 virtual int AcquirePixmap(void);
69 virtual result Sync(const Tizen::Graphics::FloatDimension& size);
70 virtual void ReleasePixmap(void);
71 virtual int OnTouchEventRecevied(int eventType, double timestamp, double x, double y);
74 _AppWidgetLayer(const _AppWidgetLayer& rhs);
75 _AppWidgetLayer& operator =(const _AppWidgetLayer& rhs);
76 virtual void Flush(void);
80 Tizen::Graphics::FloatDimension __size;
83 struct _EcoreEvasDeleter
85 void operator()(Ecore_Evas* pEcoreEvas)
87 ecore_evas_free(pEcoreEvas);
91 struct _EvasObjectDeleter
93 void operator()(Evas_Object* pEvasObject)
95 evas_object_del(pEvasObject);
99 std::unique_ptr<Ecore_Evas, _EcoreEvasDeleter> __pEcoreEvas;
100 std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pEvasObject;
101 Tizen::Base::String __providerId;
102 void* __pRenderBuffer;
106 std::unique_ptr<_AppWidgetBuffer> __pAppWidgetBuffer;
111 #endif // _FSHELL_INTERNAL_APPWIDGET_LAYER_H_