Added radial menu demo
[platform/core/uifw/dali-demo.git] / examples / radial-menu / radial-sweep-view.h
1 #ifndef DALI_DEMO_RADIAL_SWEEP_VIEW_H
2 #define DALI_DEMO_RADIAL_SWEEP_VIEW_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 #include <dali-toolkit/dali-toolkit.h>
21
22 class RadialSweepViewImpl;
23
24
25 /********************************************************************************
26  * Handle to RadialSweepView implementation
27  */
28 class RadialSweepView : public Dali::Toolkit::Control
29 {
30 public:
31   /**
32    * Create a new RadialSweepView with default parameters (2 second animation,
33    * no rotation, sweeping out a full cicle).
34    */
35   static RadialSweepView New( );
36
37   /**
38    * Create a new RadialSweepView.
39    * @param[in] duration The duration of the sweep animation
40    * @param[in] diameter The diameter of the stencil mask
41    * @param[in] initialAngle The initial angle of the anticlockwise line of the sweep sector
42    * @param[in] finalAngle The final angle of the anticlockwise line of the sweep sector
43    * @param[in] initialSector The angle of the starting sector
44    * @param[in] finalSector The angle of the sector at the end of the animation.
45    * Note, to cover the entire circle, use a value of 359.9999f, not zero or 360.
46    *
47    *            initial sector
48    *             \   |  .
49    *              \  |    .
50    * initialAngle  \ |     .   final sector
51    *                \|      _|
52    *                 .________
53    */
54   static RadialSweepView New( float duration,
55                               float diameter,
56                               Dali::Degree initialAngle,
57                               Dali::Degree finalAngle,
58                               Dali::Degree initialSector,
59                               Dali::Degree finalSector );
60
61   void SetDuration(float duration);
62
63   void SetEasingFunction( Dali::AlphaFunction easingFunction );
64
65   void SetDiameter(float diameter);
66
67   void SetInitialAngle( Dali::Degree initialAngle);
68
69   void SetFinalAngle( Dali::Degree finalAngle);
70
71   void SetInitialSector( Dali::Degree initialSector);
72
73   void SetFinalSector( Dali::Degree finalSector);
74
75   void SetInitialActorAngle( Dali::Degree initialAngle );
76
77   void SetFinalActorAngle( Dali::Degree finalAngle );
78
79   float GetDuration( );
80
81   float GetDiameter( );
82
83   Dali::Degree GetInitialAngle( );
84
85   Dali::Degree GetFinalAngle( );
86
87   Dali::Degree GetInitialSector( );
88
89   Dali::Degree GetFinalSector( );
90
91   Dali::Degree GetInitialActorAngle( );
92
93   Dali::Degree GetFinalActorAngle( );
94
95   /**
96    * @param[in] rotate True if the actors should rotate with the stencil
97    */
98   void RotateActorsWithStencil(bool rotate);
99
100   /**
101    * Add actors to the view
102    */
103   void Add(Actor actor);
104
105   /**
106    * Activate the sweep animation
107    */
108   void Activate( );
109
110   void Activate( Dali::Animation anim, float offsetTime, float duration );
111
112   /**
113    * Deactivate the sweep animation
114    */
115   void Deactivate();
116
117   /**
118    * Default constructor. Create an uninitialized handle.
119    */
120   RadialSweepView();
121
122   /**
123    * Copy constructor
124    */
125   RadialSweepView(const RadialSweepView& handle);
126
127   /**
128    * Assignment operator
129    */
130   RadialSweepView& operator=(const RadialSweepView& rhs);
131
132   /**
133    * Destructor
134    */
135   virtual ~RadialSweepView();
136
137   /**
138    * Downcast method
139    */
140   static RadialSweepView DownCast( BaseHandle handle );
141
142 public: // Not for use by application developers
143
144   RadialSweepView( RadialSweepViewImpl& impl );
145
146   RadialSweepView( Dali::Internal::CustomActor* impl );
147 };
148
149 #endif