1 #ifndef DALI_TOOLKIT_MAGNIFIER_H
2 #define DALI_TOOLKIT_MAGNIFIER_H
5 * Copyright (c) 2020 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>
30 namespace Internal DALI_INTERNAL
36 * Magnifier control is used to apply a magnify effect to content on the stage.
38 * This is done by rendering the contents of a SourceActor at a given source position
39 * to the stage as a separate overlay. In addition to the contents, an optional frame
40 * is displayed around the magnified contents.
42 class DALI_TOOLKIT_API Magnifier : public Control
46 * @brief The start and end property ranges for this control.
50 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
51 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices
53 ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
54 ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices
58 * @brief An enumeration of properties belonging to the Magnifier class.
64 // Event side properties
65 FRAME_VISIBILITY = PROPERTY_START_INDEX, ///< name "frameVisibility", Whether a frame is visible or not, type boolean
66 MAGNIFICATION_FACTOR, ///< name "magnificationFactor", Larger value means greater magnification, type float
68 // Animatable properties
69 SOURCE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< name "sourcePosition", The position of the source, type Vector3
75 * Creates an empty Magnifier handle
80 * Copy constructor. Creates another handle that points to the same real object
81 * @param handle to copy from
83 Magnifier(const Magnifier& handle);
86 * Assignment operator. Changes this handle to point to another real object
88 Magnifier& operator=(const Magnifier& handle);
93 * This is non-virtual since derived Handle types must not contain data or virtual methods.
98 * Create the Poup control
99 * @return A handle to the Magnifier control.
101 static Magnifier New();
104 * Downcast an Object handle to Magnifier. If handle points to an Magnifier the
105 * downcast produces valid handle. If not the returned handle is left uninitialized.
106 * @param[in] handle Handle to an object
107 * @return handle to a Magnifier or an uninitialized handle
109 static Magnifier DownCast(BaseHandle handle);
113 * Set the actors to be rendered in magnifier.
114 * @param[in] actor This actor and its children will be rendered.
116 void SetSourceActor(Actor actor);
118 public: // Not intended for application developers
120 * Creates a handle using the Toolkit::Internal implementation.
121 * @param[in] implementation The Control implementation.
123 DALI_INTERNAL Magnifier(Internal::Magnifier& implementation);
126 * Allows the creation of this Control from an Internal::CustomActor pointer.
127 * @param[in] internal A pointer to the internal CustomActor.
129 explicit DALI_INTERNAL Magnifier(Dali::Internal::CustomActor* internal);
132 } // namespace Toolkit
136 #endif // DALI_TOOLKIT_MAGNIFIER_H