1 #ifndef __DALI_TOOLKIT_CUSTOM_CHECK_ACTOR_H__
2 #define __DALI_TOOLKIT_CUSTOM_CHECK_ACTOR_H__
5 * Copyright (c) 2014 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.
22 #include <dali/dali.h>
23 #include <dali-toolkit/public-api/controls/control.h>
25 namespace Dali DALI_IMPORT_API
31 namespace Internal DALI_INTERNAL
33 class RotatingSelector;
37 * RotatingSelector is a simple control to switch between two states (selected/unselected). A signal is emitted when the selector switches between
38 * the two states. The control has two faces one behind the other, The control is rotated while switching between the two states
40 class RotatingSelector : public Control
44 static const char* const SIGNAL_CHECKED;
49 * Create an uninitialized RotatingSelector; this can be initialized with RotatingSelector::New()
50 * Calling member functions with an uninitialized Dali::Object is not allowed.
57 RotatingSelector( const RotatingSelector& rotatingSelector );
60 * Assignment operator.
62 RotatingSelector& operator=( const RotatingSelector& rotatingSelector );
67 * This is non-virtual since derived Handle types must not contain data or virtual methods.
72 * Create an initialized RotatingSelector.
73 * @return A handle to a newly allocated Dali resource.
75 static RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
78 * Downcast an Object handle to RotatingSelector. If handle points to a RotatingSelector the
79 * downcast produces valid handle. If not the returned handle is left uninitialized.
80 * @param[in] handle Handle to an object
81 * @return handle to a RotatingSelector or an uninitialized handle
83 static RotatingSelector DownCast( BaseHandle handle );
86 * Toggles the selection status of the selector.
87 * @param[in] toggle true for selected and false for un selected.
89 void SetSelected( bool toggle );
92 * Queries the selection status of the selector.
93 * @return true if the selector is selected otherwise false
95 bool IsSelected() const;
98 * Sets the actor to be displayed by the selector when it is in selected state
99 * @param[in] selectedActor The actor to display
101 void SetSelectedActor( Actor& selectedActor );
104 * Gets the actor to be displayed by the selector when it is in selected state
105 * @return A handle to the selected actor. If the selected actor has not been set, this handle will be invalid.
107 Actor GetSelectedActor();
110 * Sets the actor to be displayed by the selector when it is in unselected state
111 * @param[in] unSelectedActor The actor to display
113 void SetUnSelectedActor( Actor& unSelectedActor );
116 * Gets the actor to be displayed by the selector when it is in unselected state
117 * @return A handle to Actor. If the unselected actor has not been set, this handle will be invalid.
119 Actor GetUnSelectedActor();
122 * Sets whether the Selector is selectable
123 * @param[in] selectable true to be able to toggle the selector false otherwise
125 void SetSelectable( bool selectable );
128 * Queries whether the Selector is selectable
129 * @return true if the selector is selectable, false otherwise
131 bool IsSelectable()const;
135 // RotatingSelector Toggled
136 typedef SignalV2< void( RotatingSelector, bool ) > SelectedSignalV2;
139 * Signal emitted when the rotating selector is in switched to a selected state.
141 SelectedSignalV2& SelectedSignal();
143 public: // Not intended for application developers
146 * Creates a handle using the Toolkit::Internal implementation.
147 * @param[in] implementation The Control implementation.
149 RotatingSelector( Internal::RotatingSelector& implementation );
152 * Allows the creation of this Control from an Internal::CustomActor pointer.
153 * @param[in] internal A pointer to the internal CustomActor.
155 RotatingSelector( Dali::Internal::CustomActor* internal );
158 } // namespace Toolkit
162 #endif // __DALI_TOOLKIT_CUSTOM_CHECK_ACTOR_H__