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 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
11 // http://floralicense.org/license/
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.
21 #include <dali/dali.h>
22 #include <dali-toolkit/public-api/controls/control.h>
24 namespace Dali DALI_IMPORT_API
30 namespace Internal DALI_INTERNAL
32 class RotatingSelector;
36 * RotatingSelector is a simple control to switch between two states (selected/unselected). A signal is emitted when the selector switches between
37 * the two states. The control has two faces one behind the other, The control is rotated while switching between the two states
39 class RotatingSelector : public Control
43 static const char* const SIGNAL_CHECKED;
48 * Create an uninitialized RotatingSelector; this can be initialized with RotatingSelector::New()
49 * Calling member functions with an uninitialized Dali::Object is not allowed.
56 RotatingSelector( const RotatingSelector& rotatingSelector );
59 * Assignment operator.
61 RotatingSelector& operator=( const RotatingSelector& rotatingSelector );
65 * Dali::Object derived classes typically do not contain member data.
70 * Create an initialized RotatingSelector.
71 * @return A handle to a newly allocated Dali resource.
73 static RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
76 * Downcast an Object handle to RotatingSelector. If handle points to a RotatingSelector the
77 * downcast produces valid handle. If not the returned handle is left uninitialized.
78 * @param[in] handle Handle to an object
79 * @return handle to a RotatingSelector or an uninitialized handle
81 static RotatingSelector DownCast( BaseHandle handle );
84 * Toggles the selection status of the selector.
85 * @param[in] toggle true for selected and false for un selected.
87 void SetSelected( bool toggle );
90 * Queries the selection status of the selector.
91 * @return true if the selector is selected otherwise false
93 bool IsSelected() const;
96 * Sets the actor to be displayed by the selector when it is in selected state
97 * @param[in] selectedActor The actor to display
99 void SetSelectedActor( Actor& selectedActor );
102 * Gets the actor to be displayed by the selector when it is in selected state
103 * @return A handle to the selected actor. If the selected actor has not been set, this handle will be invalid.
105 Actor GetSelectedActor();
108 * Sets the actor to be displayed by the selector when it is in unselected state
109 * @param[in] unSelectedActor The actor to display
111 void SetUnSelectedActor( Actor& unSelectedActor );
114 * Gets the actor to be displayed by the selector when it is in unselected state
115 * @return A handle to Actor. If the unselected actor has not been set, this handle will be invalid.
117 Actor GetUnSelectedActor();
120 * Sets whether the Selector is selectable
121 * @param[in] selectable true to be able to toggle the selector false otherwise
123 void SetSelectable( bool selectable );
126 * Queries whether the Selector is selectable
127 * @return true if the selector is selectable, false otherwise
129 bool IsSelectable()const;
133 // RotatingSelector Toggled
134 typedef SignalV2< void( RotatingSelector, bool ) > SelectedSignalV2;
137 * Signal emitted when the rotating selector is in switched to a selected state.
139 SelectedSignalV2& SelectedSignal();
141 public: // Not intended for application developers
144 * Creates a handle using the Toolkit::Internal implementation.
145 * @param[in] implementation The Control implementation.
147 RotatingSelector( Internal::RotatingSelector& implementation );
150 * Allows the creation of this Control from an Internal::CustomActor pointer.
151 * @param[in] internal A pointer to the internal CustomActor.
153 RotatingSelector( Dali::Internal::CustomActor* internal );
156 } // namespace Toolkit
160 #endif // __DALI_TOOLKIT_CUSTOM_CHECK_ACTOR_H__