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 );
66 * Dali::Object derived classes typically do not contain member data.
71 * Create an initialized RotatingSelector.
72 * @return A handle to a newly allocated Dali resource.
74 static RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
77 * Downcast an Object handle to RotatingSelector. If handle points to a RotatingSelector the
78 * downcast produces valid handle. If not the returned handle is left uninitialized.
79 * @param[in] handle Handle to an object
80 * @return handle to a RotatingSelector or an uninitialized handle
82 static RotatingSelector DownCast( BaseHandle handle );
85 * Toggles the selection status of the selector.
86 * @param[in] toggle true for selected and false for un selected.
88 void SetSelected( bool toggle );
91 * Queries the selection status of the selector.
92 * @return true if the selector is selected otherwise false
94 bool IsSelected() const;
97 * Sets the actor to be displayed by the selector when it is in selected state
98 * @param[in] selectedActor The actor to display
100 void SetSelectedActor( Actor& selectedActor );
103 * Gets the actor to be displayed by the selector when it is in selected state
104 * @return A handle to the selected actor. If the selected actor has not been set, this handle will be invalid.
106 Actor GetSelectedActor();
109 * Sets the actor to be displayed by the selector when it is in unselected state
110 * @param[in] unSelectedActor The actor to display
112 void SetUnSelectedActor( Actor& unSelectedActor );
115 * Gets the actor to be displayed by the selector when it is in unselected state
116 * @return A handle to Actor. If the unselected actor has not been set, this handle will be invalid.
118 Actor GetUnSelectedActor();
121 * Sets whether the Selector is selectable
122 * @param[in] selectable true to be able to toggle the selector false otherwise
124 void SetSelectable( bool selectable );
127 * Queries whether the Selector is selectable
128 * @return true if the selector is selectable, false otherwise
130 bool IsSelectable()const;
134 // RotatingSelector Toggled
135 typedef SignalV2< void( RotatingSelector, bool ) > SelectedSignalV2;
138 * Signal emitted when the rotating selector is in switched to a selected state.
140 SelectedSignalV2& SelectedSignal();
142 public: // Not intended for application developers
145 * Creates a handle using the Toolkit::Internal implementation.
146 * @param[in] implementation The Control implementation.
148 RotatingSelector( Internal::RotatingSelector& implementation );
151 * Allows the creation of this Control from an Internal::CustomActor pointer.
152 * @param[in] internal A pointer to the internal CustomActor.
154 RotatingSelector( Dali::Internal::CustomActor* internal );
157 } // namespace Toolkit
161 #endif // __DALI_TOOLKIT_CUSTOM_CHECK_ACTOR_H__