Merge "Add support for new accessibility actions" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / magnifier / magnifier.h
1 #ifndef __DALI_TOOLKIT_MAGNIFIER_H__
2 #define __DALI_TOOLKIT_MAGNIFIER_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/public-api/controls/control.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class Magnifier;
35 }
36
37 /**
38  * Magnifier control is used to apply a magnify effect to content on the stage.
39  *
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.
43  */
44 class DALI_IMPORT_API Magnifier : public Control
45 {
46 public:
47
48   /**
49    * @brief The start and end property ranges for this control.
50    */
51   enum PropertyRange
52   {
53     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
54     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,             ///< Reserve property indices
55
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
58   };
59
60   /**
61    * @brief An enumeration of properties belonging to the Magnifier class.
62    */
63   struct Property
64   {
65     enum
66     {
67       // Event side properties
68       FRAME_VISIBILITY = PROPERTY_START_INDEX,           ///< name "frame-visibility",      Whether a frame is visible or not,         type boolean
69       MAGNIFICATION_FACTOR,                              ///< name "magnification-factor",  Larger value means greater magnification,  type float
70
71       // Animatable properties
72       SOURCE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< name "source-position", The position of the source,  type Vector3
73     };
74   };
75
76 public:
77
78   /**
79    * Creates an empty Magnifier handle
80    */
81   Magnifier();
82
83   /**
84    * Copy constructor. Creates another handle that points to the same real object
85    * @param handle to copy from
86    */
87   Magnifier( const Magnifier& handle );
88
89   /**
90    * Assignment operator. Changes this handle to point to another real object
91    */
92   Magnifier& operator=( const Magnifier& handle );
93
94   /**
95    * @brief Destructor
96    *
97    * This is non-virtual since derived Handle types must not contain data or virtual methods.
98    */
99   ~Magnifier();
100
101   /**
102    * Create the Poup control
103    * @return A handle to the Magnifier control.
104    */
105   static Magnifier New();
106
107   /**
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
112    */
113   static Magnifier DownCast( BaseHandle handle );
114
115 public:
116
117   /**
118    * Set the actors to be rendered in magnifier.
119    * @param[in] actor This actor and its children will be rendered.
120    */
121   void SetSourceActor(Actor actor);
122
123 public: // Not intended for application developers
124
125   /**
126    * Creates a handle using the Toolkit::Internal implementation.
127    * @param[in]  implementation  The Control implementation.
128    */
129   DALI_INTERNAL Magnifier(Internal::Magnifier& implementation);
130
131   /**
132    * Allows the creation of this Control from an Internal::CustomActor pointer.
133    * @param[in]  internal  A pointer to the internal CustomActor.
134    */
135   explicit DALI_INTERNAL Magnifier(Dali::Internal::CustomActor* internal);
136 };
137
138 } // namespace Toolkit
139
140 } // namespace Dali
141
142 #endif // __DALI_TOOLKIT_MAGNIFIER_H__