2 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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.
17 * @file FShell_AppWidgetLayer.h
18 * @brief This is the header file for the _AppWidgetLayer class.
20 * This header file contains the declarations of the %_AppWidgetLayer class.
22 #ifndef _FSHELL_INTERNAL_APPWIDGET_LAYER_H_
23 #define _FSHELL_INTERNAL_APPWIDGET_LAYER_H_
25 #include <unique_ptr.h>
26 #include <Ecore_Evas.h>
27 #include <FBaseString.h>
28 #include "FUiAnim_EflLayer.h"
29 #include "FShell_IAppWidgetTouchEventListener.h"
31 namespace Tizen { namespace Ui
36 namespace Tizen { namespace Shell
39 class _AppWidgetBuffer;
42 * @class _AppWidgetLayer
47 : public Tizen::Ui::Animations::_EflLayer
48 , public Tizen::Shell::_IAppWidgetTouchEventListener
51 _AppWidgetLayer(const Tizen::Base::String& providerId, const Tizen::Graphics::FloatDimension& size);
52 virtual ~_AppWidgetLayer(void);
54 virtual result OnConstructed(void);
56 result SetProviderId(const Tizen::Base::String& providerId);
57 Tizen::Base::String GetProviderId(void) const;
58 int GetPixmapId(void) const;
59 void SetLayerBounds(const Tizen::Graphics::FloatRectangle& bounds);
60 void* AllocCanvas(int size);
61 void FreeCanvas(void* pCanvas);
62 int EventHandler(int eventType, double timestamp, double x, double y);
63 result SyncPixmap(const Tizen::Graphics::FloatDimension& size);
64 void OnRendered(void);
65 void OnNativeCanvasPreRendered(void);
66 void OnNativeCanvasPostRendered(void);
68 virtual result RegisterTouchEventListener(void);
69 virtual int AcquirePixmap(void);
70 virtual result Sync(const Tizen::Graphics::FloatDimension& size);
71 virtual void ReleasePixmap(void);
72 virtual int OnTouchEventRecevied(int eventType, double timestamp, double x, double y);
75 _AppWidgetLayer(const _AppWidgetLayer& rhs);
76 _AppWidgetLayer& operator =(const _AppWidgetLayer& rhs);
77 virtual void Flush(void);
81 Tizen::Graphics::FloatDimension __size;
82 std::unique_ptr<_AppWidgetBuffer> __pAppWidgetBuffer;
85 struct _EcoreEvasDeleter
87 void operator()(Ecore_Evas* pEcoreEvas)
89 ecore_evas_free(pEcoreEvas);
93 struct _EvasObjectDeleter
95 void operator()(Evas_Object* pEvasObject)
97 evas_object_del(pEvasObject);
101 std::unique_ptr<Ecore_Evas, _EcoreEvasDeleter> __pEcoreEvas;
102 std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pEvasObject;
103 Tizen::Base::String __providerId;
104 void* __pRenderBuffer;
112 #endif // _FSHELL_INTERNAL_APPWIDGET_LAYER_H_