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/public-api/actors/camera-actor.h>
23 #include <dali/public-api/actors/layer.h>
24 #include <dali/public-api/render-tasks/render-task.h>
25 #include <dali/public-api/actors/image-actor.h>
28 #include <dali-toolkit/public-api/controls/control-impl.h>
29 #include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
42 typedef IntrusivePtr<Magnifier> MagnifierPtr;
45 * @copydoc Toolkit::Magnifier
47 class Magnifier : public Control
52 * Create a new Magnifier.
53 * @return A public handle to the newly allocated Magnifier.
55 static Dali::Toolkit::Magnifier New();
60 * @copydoc Toolkit::ImageView::SetSourceActor
62 void SetSourceActor(Actor actor);
65 * @copydoc Toolkit::ImageView::SetSourcePosition
67 void SetSourcePosition(const Vector3& position);
70 * @copydoc Toolkit::ImageView::GetFrameVisibility
72 bool GetFrameVisibility() const;
75 * @copydoc Toolkit::ImageView::SetFrameVisibility
77 void SetFrameVisibility(bool visible);
80 * @copydoc Toolkit::ImageView::GetMagnificationFactor
82 float GetMagnificationFactor() const;
85 * @copydoc Toolkit::ImageView::SetMagnificationFactor
87 void SetMagnificationFactor(float value);
90 * Update magnification
97 * Construct a new Magnifier.
102 * 2nd-phase initialization.
107 * A reference counted object may only be deleted by calling Unreference()
109 virtual ~Magnifier();
114 * Initializes the render task required to render contents.
116 void InitializeRenderTask();
120 virtual void OnControlSizeSet(const Vector3& targetSize);
125 Magnifier(const Magnifier&);
128 Magnifier& operator=(const Magnifier& rhs);
132 RenderTask mTask; ///< Render Task to render the source actor contents.
133 CameraActor mCameraActor; ///< CameraActor attached to RenderTask
134 ImageActor mFrame; ///< The Magnifier Frame
135 Property::Index mPropertySourcePosition; ///< Source Position ("source-position")
136 Actor mSourceActor; ///< Source Delegate Actor represents the source position to read.
137 float mDefaultCameraDistance; ///< Default RenderTask's camera distance from target.
138 Vector3 mActorSize; ///< The Actor size
139 float mMagnificationFactor; ///< Magnification factor 1.0f is default. same as content.
142 } // namespace Internal
144 // Helpers for public-api forwarding methods
146 inline Toolkit::Internal::Magnifier& GetImpl(Toolkit::Magnifier& pub)
148 DALI_ASSERT_ALWAYS(pub);
150 Dali::RefObject& handle = pub.GetImplementation();
152 return static_cast<Toolkit::Internal::Magnifier&>(handle);
155 inline const Toolkit::Internal::Magnifier& GetImpl(const Toolkit::Magnifier& pub)
157 DALI_ASSERT_ALWAYS(pub);
159 const Dali::RefObject& handle = pub.GetImplementation();
161 return static_cast<const Toolkit::Internal::Magnifier&>(handle);
164 } // namespace Toolkit
168 #endif // __DALI_TOOLKIT_INTERNAL_MAGNIFIER_H__