Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / magnifier / magnifier.h
1 #ifndef __DALI_TOOLKIT_MAGNIFIER_H__
2 #define __DALI_TOOLKIT_MAGNIFIER_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // EXTERNAL INCLUDES
21
22 // INTERNAL INCLUDES
23 #include <dali-toolkit/public-api/controls/control.h>
24
25 namespace Dali DALI_IMPORT_API
26 {
27
28 namespace Toolkit
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 class Magnifier;
34 }
35
36 /**
37  * Magnifier control is used to apply a magnify effect to content on the stage.
38  *
39  * This is done by rendering the contents of a SourceActor at a given source position
40  * to the stage as a separate overlay. In addition to the contents, an optional frame
41  * is displayed around the magnified contents.
42  */
43 class Magnifier : public Control
44 {
45 public:
46
47   // Custom properties
48
49   static const std::string SOURCE_POSITION_PROPERTY_NAME;                   ///< Property, name "source-position",              type VECTOR3
50
51 public:
52
53   /**
54    * Creates an empty Magnifier handle
55    */
56   Magnifier();
57
58   /**
59    * Copy constructor. Creates another handle that points to the same real object
60    * @param handle to copy from
61    */
62   Magnifier( const Magnifier& handle );
63
64   /**
65    * Assignment operator. Changes this handle to point to another real object
66    */
67   Magnifier& operator=( const Magnifier& handle );
68
69   /**
70    * Virtual destructor.
71    * Dali::Object derived classes typically do not contain member data.
72    */
73   virtual ~Magnifier();
74
75   /**
76    * Create the Poup control
77    * @return A handle to the Magnifier control.
78    */
79   static Magnifier New();
80
81   /**
82    * Downcast an Object handle to Magnifier. If handle points to an Magnifier the
83    * downcast produces valid handle. If not the returned handle is left uninitialized.
84    * @param[in] handle Handle to an object
85    * @return handle to a Magnifier or an uninitialized handle
86    */
87   static Magnifier DownCast( BaseHandle handle );
88
89 public:
90
91   /**
92    * Set the actors to be rendered in magnifier.
93    * @param[in] actor This actor and its children will be rendered.
94    */
95   void SetSourceActor(Actor actor);
96
97   /**
98    * Set the source camera position to render in magnifier
99    * @param[in] position The target position from which to render source.
100    */
101   void SetSourcePosition(Vector3 position);
102
103   /**
104    * Returns whether the frame is visible or not.
105    * @return true if frame is visible, false if not.
106    */
107   bool GetFrameVisibility() const;
108
109   /**
110    * Sets whether the frame part of the magnifier should be visible
111    * or not.
112    * @param[in] visible true to display frame, false to hide frame.
113    */
114   void SetFrameVisibility(bool visible);
115
116   /**
117    * Get the magnification factor of the magnifier
118    * The larger the value the larger the contents magnified.
119    * A value of 1.0f indications 1x magnification.
120    * @return Magnification factor is returned
121    */
122   float GetMagnificationFactor() const;
123
124   /**
125    * Set the magnification factor of the magnifier
126    * The larger the value the larger the contents magnified.
127    * A value of 1.0f indications 1x magnification.
128    * @param[in] value Magnification factor.
129    */
130   void SetMagnificationFactor(float value);
131
132 public: // Not intended for application developers
133
134   /**
135    * Creates a handle using the Toolkit::Internal implementation.
136    * @param[in]  implementation  The Control implementation.
137    */
138   DALI_INTERNAL Magnifier(Internal::Magnifier& implementation);
139
140   /**
141    * Allows the creation of this Control from an Internal::CustomActor pointer.
142    * @param[in]  internal  A pointer to the internal CustomActor.
143    */
144   DALI_INTERNAL Magnifier(Dali::Internal::CustomActor* internal);
145 };
146
147 } // namespace Toolkit
148
149 } // namespace Dali
150
151 #endif // __DALI_TOOLKIT_MAGNIFIER_H__