1 #ifndef __DALI_TOOLKIT_MAGNIFIER_H__
2 #define __DALI_TOOLKIT_MAGNIFIER_H__
5 * Copyright (c) 2018 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.
24 #include <dali-toolkit/public-api/controls/control.h>
32 namespace Internal DALI_INTERNAL
38 * Magnifier control is used to apply a magnify effect to content on the stage.
40 * This is done by rendering the contents of a SourceActor at a given source position
41 * to the stage as a separate overlay. In addition to the contents, an optional frame
42 * is displayed around the magnified contents.
44 class DALI_TOOLKIT_API Magnifier : public Control
49 * @brief The start and end property ranges for this control.
53 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
54 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices
56 ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
57 ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices
61 * @brief An enumeration of properties belonging to the Magnifier class.
67 // Event side properties
68 FRAME_VISIBILITY = PROPERTY_START_INDEX, ///< name "frameVisibility", Whether a frame is visible or not, type boolean
69 MAGNIFICATION_FACTOR, ///< name "magnificationFactor", Larger value means greater magnification, type float
71 // Animatable properties
72 SOURCE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< name "sourcePosition", The position of the source, type Vector3
79 * Creates an empty Magnifier handle
84 * Copy constructor. Creates another handle that points to the same real object
85 * @param handle to copy from
87 Magnifier( const Magnifier& handle );
90 * Assignment operator. Changes this handle to point to another real object
92 Magnifier& operator=( const Magnifier& handle );
97 * This is non-virtual since derived Handle types must not contain data or virtual methods.
102 * Create the Poup control
103 * @return A handle to the Magnifier control.
105 static Magnifier New();
108 * Downcast an Object handle to Magnifier. If handle points to an Magnifier the
109 * downcast produces valid handle. If not the returned handle is left uninitialized.
110 * @param[in] handle Handle to an object
111 * @return handle to a Magnifier or an uninitialized handle
113 static Magnifier DownCast( BaseHandle handle );
118 * Set the actors to be rendered in magnifier.
119 * @param[in] actor This actor and its children will be rendered.
121 void SetSourceActor(Actor actor);
123 public: // Not intended for application developers
126 * Creates a handle using the Toolkit::Internal implementation.
127 * @param[in] implementation The Control implementation.
129 DALI_INTERNAL Magnifier(Internal::Magnifier& implementation);
132 * Allows the creation of this Control from an Internal::CustomActor pointer.
133 * @param[in] internal A pointer to the internal CustomActor.
135 explicit DALI_INTERNAL Magnifier(Dali::Internal::CustomActor* internal);
138 } // namespace Toolkit
142 #endif // __DALI_TOOLKIT_MAGNIFIER_H__