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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/dali.h>
23 #include <dali-toolkit/public-api/controls/control-impl.h>
24 #include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
37 typedef IntrusivePtr<Magnifier> MagnifierPtr;
40 * @copydoc Toolkit::Magnifier
42 class Magnifier : public Control
47 * Create a new Magnifier.
48 * @return A public handle to the newly allocated Magnifier.
50 static Dali::Toolkit::Magnifier New();
55 * @copydoc Toolkit::ImageView::SetSourceActor
57 void SetSourceActor(Actor actor);
60 * @copydoc Toolkit::ImageView::SetSourcePosition
62 void SetSourcePosition(const Vector3& position);
65 * @copydoc Toolkit::ImageView::GetFrameVisibility
67 bool GetFrameVisibility() const;
70 * @copydoc Toolkit::ImageView::SetFrameVisibility
72 void SetFrameVisibility(bool visible);
75 * @copydoc Toolkit::ImageView::GetMagnificationFactor
77 float GetMagnificationFactor() const;
80 * @copydoc Toolkit::ImageView::SetMagnificationFactor
82 void SetMagnificationFactor(float value);
85 * Update magnification
92 * Construct a new Magnifier.
97 * 2nd-phase initialization.
102 * A reference counted object may only be deleted by calling Unreference()
104 virtual ~Magnifier();
109 * Initializes the render task required to render contents.
111 void InitializeRenderTask();
115 virtual void OnControlSizeSet(const Vector3& targetSize);
120 Magnifier(const Magnifier&);
123 Magnifier& operator=(const Magnifier& rhs);
127 RenderTask mTask; ///< Render Task to render the source actor contents.
128 CameraActor mCameraActor; ///< CameraActor attached to RenderTask
129 Layer mFrameLayer; ///< Frame is placed on separate layer added to stage.
130 Property::Index mPropertySourcePosition; ///< Source Position ("source-position")
131 Actor mSourceActor; ///< Source Delegate Actor represents the source position to read.
132 float mDefaultCameraDistance; ///< Default RenderTask's camera distance from target.
133 Vector3 mActorSize; ///< The Actor size
134 float mMagnificationFactor; ///< Magnification factor 1.0f is default. same as content.
137 } // namespace Internal
139 // Helpers for public-api forwarding methods
141 inline Toolkit::Internal::Magnifier& GetImpl(Toolkit::Magnifier& pub)
143 DALI_ASSERT_ALWAYS(pub);
145 Dali::RefObject& handle = pub.GetImplementation();
147 return static_cast<Toolkit::Internal::Magnifier&>(handle);
150 inline const Toolkit::Internal::Magnifier& GetImpl(const Toolkit::Magnifier& pub)
152 DALI_ASSERT_ALWAYS(pub);
154 const Dali::RefObject& handle = pub.GetImplementation();
156 return static_cast<const Toolkit::Internal::Magnifier&>(handle);
159 } // namespace Toolkit
163 #endif // __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__