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 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/public-api/object/ref-object.h>
23 #include <dali-toolkit/public-api/controls/control-impl.h>
24 #include <dali-toolkit/public-api/controls/selectors/rotating-selector.h>
35 class RotatingSelector;
39 * RotatingSelector is a custom control for text aligning and multiline support
41 class RotatingSelector : public ControlImpl
46 * Create a new RotatingSelector.
47 * @return A smart-pointer to the newly allocated RotatingSelector.
49 static Dali::Toolkit::RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
52 * @copydoc Dali::Toolkit::RotatingSelector::SetSelected()
54 void SetSelected( bool toggle );
57 * @copydoc Dali::Toolkit::RotatingSelector::IsSelected()
59 bool IsSelected() const {return mSelected;}
62 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectedActor()
64 void SetSelectedActor( Actor& selectedActor );
67 * @copydoc Dali::Toolkit::RotatingSelector::GetSelectedActor()
69 Actor GetSelectedActor();
72 * @copydoc Dali::Toolkit::RotatingSelector::SetUnSelectedActor()
74 void SetUnSelectedActor( Actor& unSelectedActor );
77 * @copydoc Dali::Toolkit::RotatingSelector::GetUnSelectedActor()
79 Actor GetUnSelectedActor();
82 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectable()
84 void SetSelectable( bool selectable );
87 * @copydoc Dali::Toolkit::RotatingSelector::IsSelectable()
89 bool IsSelectable()const {return mSelectable;}
92 * @copydoc Dali::Toolkit::RotatingSelector::SelectedSignal()
94 Toolkit::RotatingSelector::SelectedSignalV2& SelectedSignal();
97 * Connects a callback function with the object's signals.
98 * @param[in] object The object providing the signal.
99 * @param[in] tracker Used to disconnect the signal.
100 * @param[in] signalName The signal to connect to.
101 * @param[in] functor A newly allocated FunctorDelegate.
102 * @return True if the signal was connected.
103 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
105 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
107 private: // From ControlImpl
110 * @copydoc Toolkit::Control::OnInitialize()
112 virtual void OnInitialize();
115 * @copydoc Toolkit::Control::OnTouchEvent(const TouchEvent& event)
117 virtual bool OnTouchEvent( const TouchEvent& event );
122 * Construct a new RotatingSelector.
127 * A reference counted object may only be deleted by calling Unreference()
129 virtual ~RotatingSelector();
134 RotatingSelector(const RotatingSelector&);
137 RotatingSelector& operator=(const RotatingSelector& rhs);
139 void ToggleAndAnimateSelection();
140 void AnimationCompleted( Animation& animation );
149 Actor mUnSelectedActor;
150 Actor mSelectedActor;
153 Animation mRotateAnimation;
157 Toolkit::RotatingSelector::SelectedSignalV2 mCheckedSignalV2;
160 } // namespace Internal
162 // Helpers for public-api forwarding methods
164 inline Toolkit::Internal::RotatingSelector& GetImpl(Toolkit::RotatingSelector& RotatingSelector)
166 DALI_ASSERT_ALWAYS(RotatingSelector);
168 Dali::RefObject& handle = RotatingSelector.GetImplementation();
170 return static_cast<Toolkit::Internal::RotatingSelector&>(handle);
173 inline const Toolkit::Internal::RotatingSelector& GetImpl(const Toolkit::RotatingSelector& RotatingSelector)
175 DALI_ASSERT_ALWAYS(RotatingSelector);
177 const Dali::RefObject& handle = RotatingSelector.GetImplementation();
179 return static_cast<const Toolkit::Internal::RotatingSelector&>(handle);
182 } // namespace Toolkit
186 #endif // __DALI_TOOLKIT_INTERNAL_ITEM_VIEW_H__