Add 'ExclusiveArch: armv7l' limit build to arm architecture
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / internal / controls / magnifier / magnifier-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__
2 #define __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // INTERNAL INCLUDES
21 #include <dali/dali.h>
22 #include <dali-toolkit/public-api/controls/control-impl.h>
23 #include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 namespace Internal
32 {
33
34 class Magnifier;
35
36 typedef IntrusivePtr<Magnifier>    MagnifierPtr;
37
38 /**
39  * @copydoc Toolkit::Magnifier
40  */
41 class Magnifier : public ControlImpl
42 {
43 public:
44
45   /**
46    * Create a new Magnifier.
47    * @return A public handle to the newly allocated Magnifier.
48    */
49   static Dali::Toolkit::Magnifier New();
50
51 public:
52
53   /**
54    * @copydoc Toolkit::ImageView::SetSourceActor
55    */
56   void SetSourceActor(Actor actor);
57
58   /**
59    * @copydoc Toolkit::ImageView::SetSourcePosition
60    */
61   void SetSourcePosition(const Vector3& position);
62
63   /**
64    * @copydoc Toolkit::ImageView::GetFrameVisibility
65    */
66   bool GetFrameVisibility() const;
67
68   /**
69    * @copydoc Toolkit::ImageView::SetFrameVisibility
70    */
71   void SetFrameVisibility(bool visible);
72
73   /**
74    * @copydoc Toolkit::ImageView::GetMagnificationFactor
75    */
76   float GetMagnificationFactor() const;
77
78   /**
79    * @copydoc Toolkit::ImageView::SetMagnificationFactor
80    */
81   void SetMagnificationFactor(float value);
82
83   /**
84    * Update magnification
85    */
86   void Update();
87
88 protected:
89
90   /**
91    * Construct a new Magnifier.
92    */
93   Magnifier();
94
95   /**
96    * 2nd-phase initialization.
97    */
98   void Initialize();
99
100   /**
101    * A reference counted object may only be deleted by calling Unreference()
102    */
103   virtual ~Magnifier();
104
105 private:
106
107   /**
108    * Initializes the render task required to render contents.
109    */
110   void InitializeRenderTask();
111
112 private:
113
114   virtual void OnControlSizeSet(const Vector3& targetSize);
115
116 private:
117
118   // Undefined
119   Magnifier(const Magnifier&);
120
121   // Undefined
122   Magnifier& operator=(const Magnifier& rhs);
123
124 private:
125
126   RenderTask mTask;                             ///< Render Task to render the source actor contents.
127   CameraActor mCameraActor;                     ///< CameraActor attached to RenderTask
128   Layer mFrameLayer;                            ///< Frame is placed on separate layer added to stage.
129   Property::Index mPropertySourcePosition;      ///< Source Position ("source-position")
130   Actor mSourceActor;                           ///< Source Delegate Actor represents the source position to read.
131   float mDefaultCameraDistance;                 ///< Default RenderTask's camera distance from target.
132   Vector3 mActorSize;                           ///< The Actor size
133   float mMagnificationFactor;                   ///< Magnification factor 1.0f is default. same as content.
134 };
135
136 } // namespace Internal
137
138 // Helpers for public-api forwarding methods
139
140 inline Toolkit::Internal::Magnifier& GetImpl(Toolkit::Magnifier& pub)
141 {
142   DALI_ASSERT_ALWAYS(pub);
143
144   Dali::RefObject& handle = pub.GetImplementation();
145
146   return static_cast<Toolkit::Internal::Magnifier&>(handle);
147 }
148
149 inline const Toolkit::Internal::Magnifier& GetImpl(const Toolkit::Magnifier& pub)
150 {
151   DALI_ASSERT_ALWAYS(pub);
152
153   const Dali::RefObject& handle = pub.GetImplementation();
154
155   return static_cast<const Toolkit::Internal::Magnifier&>(handle);
156 }
157
158 } // namespace Toolkit
159
160 } // namespace Dali
161
162 #endif // __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__