1 #ifndef __DALI_TOOLKIT_INTERNAL_CUSTOM_CHECK_ACTOR_H__
2 #define __DALI_TOOLKIT_INTERNAL_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/public-api/object/ref-object.h>
24 #include <dali-toolkit/public-api/controls/control-impl.h>
25 #include <dali-toolkit/public-api/controls/selectors/rotating-selector.h>
36 class RotatingSelector;
40 * RotatingSelector is a custom control for text aligning and multiline support
42 class RotatingSelector : public Control
47 * Create a new RotatingSelector.
48 * @return A smart-pointer to the newly allocated RotatingSelector.
50 static Dali::Toolkit::RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
53 * @copydoc Dali::Toolkit::RotatingSelector::SetSelected()
55 void SetSelected( bool toggle );
58 * @copydoc Dali::Toolkit::RotatingSelector::IsSelected()
60 bool IsSelected() const {return mSelected;}
63 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectedActor()
65 void SetSelectedActor( Actor& selectedActor );
68 * @copydoc Dali::Toolkit::RotatingSelector::GetSelectedActor()
70 Actor GetSelectedActor();
73 * @copydoc Dali::Toolkit::RotatingSelector::SetUnSelectedActor()
75 void SetUnSelectedActor( Actor& unSelectedActor );
78 * @copydoc Dali::Toolkit::RotatingSelector::GetUnSelectedActor()
80 Actor GetUnSelectedActor();
83 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectable()
85 void SetSelectable( bool selectable );
88 * @copydoc Dali::Toolkit::RotatingSelector::IsSelectable()
90 bool IsSelectable()const {return mSelectable;}
93 * @copydoc Dali::Toolkit::RotatingSelector::SelectedSignal()
95 Toolkit::RotatingSelector::SelectedSignalV2& SelectedSignal();
98 * Connects a callback function with the object's signals.
99 * @param[in] object The object providing the signal.
100 * @param[in] tracker Used to disconnect the signal.
101 * @param[in] signalName The signal to connect to.
102 * @param[in] functor A newly allocated FunctorDelegate.
103 * @return True if the signal was connected.
104 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
106 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
108 private: // From Control
111 * @copydoc Toolkit::Control::OnInitialize()
113 virtual void OnInitialize();
116 * @copydoc Toolkit::Control::OnTouchEvent(const TouchEvent& event)
118 virtual bool OnTouchEvent( const TouchEvent& event );
123 * Construct a new RotatingSelector.
128 * A reference counted object may only be deleted by calling Unreference()
130 virtual ~RotatingSelector();
135 RotatingSelector(const RotatingSelector&);
138 RotatingSelector& operator=(const RotatingSelector& rhs);
140 void ToggleAndAnimateSelection();
141 void AnimationCompleted( Animation& animation );
150 Actor mUnSelectedActor;
151 Actor mSelectedActor;
154 Animation mRotateAnimation;
158 Toolkit::RotatingSelector::SelectedSignalV2 mCheckedSignalV2;
161 } // namespace Internal
163 // Helpers for public-api forwarding methods
165 inline Toolkit::Internal::RotatingSelector& GetImpl(Toolkit::RotatingSelector& RotatingSelector)
167 DALI_ASSERT_ALWAYS(RotatingSelector);
169 Dali::RefObject& handle = RotatingSelector.GetImplementation();
171 return static_cast<Toolkit::Internal::RotatingSelector&>(handle);
174 inline const Toolkit::Internal::RotatingSelector& GetImpl(const Toolkit::RotatingSelector& RotatingSelector)
176 DALI_ASSERT_ALWAYS(RotatingSelector);
178 const Dali::RefObject& handle = RotatingSelector.GetImplementation();
180 return static_cast<const Toolkit::Internal::RotatingSelector&>(handle);
183 } // namespace Toolkit
187 #endif // __DALI_TOOLKIT_INTERNAL_ITEM_VIEW_H__