1 #ifndef __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__
2 #define __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
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>
36 typedef IntrusivePtr<Magnifier> MagnifierPtr;
39 * @copydoc Toolkit::Magnifier
41 class Magnifier : public ControlImpl
46 * Create a new Magnifier.
47 * @return A public handle to the newly allocated Magnifier.
49 static Dali::Toolkit::Magnifier New();
54 * @copydoc Toolkit::ImageView::SetSourceActor
56 void SetSourceActor(Actor actor);
59 * @copydoc Toolkit::ImageView::SetSourcePosition
61 void SetSourcePosition(const Vector3& position);
64 * @copydoc Toolkit::ImageView::GetFrameVisibility
66 bool GetFrameVisibility() const;
69 * @copydoc Toolkit::ImageView::SetFrameVisibility
71 void SetFrameVisibility(bool visible);
74 * @copydoc Toolkit::ImageView::GetMagnificationFactor
76 float GetMagnificationFactor() const;
79 * @copydoc Toolkit::ImageView::SetMagnificationFactor
81 void SetMagnificationFactor(float value);
84 * Update magnification
91 * Construct a new Magnifier.
96 * 2nd-phase initialization.
101 * A reference counted object may only be deleted by calling Unreference()
103 virtual ~Magnifier();
108 * Initializes the render task required to render contents.
110 void InitializeRenderTask();
114 virtual void OnControlSizeSet(const Vector3& targetSize);
119 Magnifier(const Magnifier&);
122 Magnifier& operator=(const Magnifier& rhs);
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.
136 } // namespace Internal
138 // Helpers for public-api forwarding methods
140 inline Toolkit::Internal::Magnifier& GetImpl(Toolkit::Magnifier& pub)
142 DALI_ASSERT_ALWAYS(pub);
144 Dali::RefObject& handle = pub.GetImplementation();
146 return static_cast<Toolkit::Internal::Magnifier&>(handle);
149 inline const Toolkit::Internal::Magnifier& GetImpl(const Toolkit::Magnifier& pub)
151 DALI_ASSERT_ALWAYS(pub);
153 const Dali::RefObject& handle = pub.GetImplementation();
155 return static_cast<const Toolkit::Internal::Magnifier&>(handle);
158 } // namespace Toolkit
162 #endif // __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__