Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiAnim_VisualElementSurfaceImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file                FUiAnim_VisualElementSurfaceImpl.h
20  * @brief               This is the header file for the _VisualElementSurfaceImpl class.
21  *
22  * This header file contains the declarations of the _VisualElementSurfaceImpl class.
23  */
24
25 #ifndef _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SURFACE_IMPL_H_
26 #define _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SURFACE_IMPL_H_
27
28 #include <FGrpDimension.h>
29 #include <FGrpFloatDimension.h>
30 #include <FGrpRectangle.h>
31 #include <FGrpBufferInfo.h>
32 #include <FUiAnimVisualElementSurface.h>
33
34 // CHECKME: Why 'Handle' is 'int' ? no 64-bit support??? :(
35
36 namespace Tizen { namespace Base
37 {
38         class String;
39 }}      // Tizen::Base
40
41 namespace Tizen { namespace Ui { namespace Animations
42 {
43 class DisplayContext;
44
45 class _VisualElementSurfaceImpl
46         : public Tizen::Base::Object
47 {
48 protected:
49         _VisualElementSurfaceImpl(const Tizen::Graphics::Dimension& size);
50
51 public:
52         virtual ~_VisualElementSurfaceImpl(void);
53
54 public:
55         static VisualElementSurface* CreateSurfaceN(const Handle handle, const Tizen::Graphics::Dimension& size); // create public instance
56         static VisualElementSurface* CreateSurfaceUsingExistingObjectN(const DisplayContext& displayContext, const Handle handle, const Tizen::Graphics::Dimension& size);
57         static _VisualElementSurfaceImpl* CreateInstanceN(const DisplayContext& displayContext, const Tizen::Graphics::Dimension& size); // create internal instance
58
59         virtual Handle GetNativeHandle(void) const = 0;
60         virtual result SetImage(const Tizen::Base::String& fileName);
61         virtual result GetBufferInfo(Tizen::Graphics::BufferInfo& bufferInfo) const;
62
63         virtual Tizen::Graphics::Dimension GetPhysicalSize(void) const;
64
65         Tizen::Graphics::Dimension GetSize(void) const
66         {
67                 return __logicalSize;
68         }
69
70         virtual bool Equals(const Tizen::Base::Object& obj) const;
71         virtual int GetHashCode(void) const;
72
73         void AddRef(void);
74         bool Release(void);
75         int GetReferenceCount(void) const;
76
77         static _VisualElementSurfaceImpl* GetInstance(VisualElementSurface& surface)
78         {
79                 return surface.__pVisualElementSurfaceImpl;
80         }
81
82         static const _VisualElementSurfaceImpl* GetInstance(const VisualElementSurface& surface)
83         {
84                 return surface.__pVisualElementSurfaceImpl;
85         }
86
87 private:
88         _VisualElementSurfaceImpl(void);
89         _VisualElementSurfaceImpl(const _VisualElementSurfaceImpl& rhs);
90         _VisualElementSurfaceImpl& operator =(const _VisualElementSurfaceImpl& rhs);
91
92 private:
93         int __refCount;
94         Tizen::Graphics::Dimension __logicalSize;
95 };              // _VisualElementSurfaceImpl
96
97 }}}             // Tizen::Ui::Animations
98
99 #endif // _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SURFACE_IMPL_H_
100