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/animation/animation.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/public-api/controls/selectors/rotating-selector.h>
37 class RotatingSelector;
41 * RotatingSelector is a custom control for text aligning and multiline support
43 class RotatingSelector : public Control
48 * Create a new RotatingSelector.
49 * @return A smart-pointer to the newly allocated RotatingSelector.
51 static Dali::Toolkit::RotatingSelector New(Actor& unSelectedActor, Actor& selectedActor);
54 * @copydoc Dali::Toolkit::RotatingSelector::SetSelected()
56 void SetSelected( bool toggle );
59 * @copydoc Dali::Toolkit::RotatingSelector::IsSelected()
61 bool IsSelected() const {return mSelected;}
64 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectedActor()
66 void SetSelectedActor( Actor& selectedActor );
69 * @copydoc Dali::Toolkit::RotatingSelector::GetSelectedActor()
71 Actor GetSelectedActor();
74 * @copydoc Dali::Toolkit::RotatingSelector::SetUnSelectedActor()
76 void SetUnSelectedActor( Actor& unSelectedActor );
79 * @copydoc Dali::Toolkit::RotatingSelector::GetUnSelectedActor()
81 Actor GetUnSelectedActor();
84 * @copydoc Dali::Toolkit::RotatingSelector::SetSelectable()
86 void SetSelectable( bool selectable );
89 * @copydoc Dali::Toolkit::RotatingSelector::IsSelectable()
91 bool IsSelectable()const {return mSelectable;}
94 * @copydoc Dali::Toolkit::RotatingSelector::SelectedSignal()
96 Toolkit::RotatingSelector::SelectedSignalV2& SelectedSignal();
99 * Connects a callback function with the object's signals.
100 * @param[in] object The object providing the signal.
101 * @param[in] tracker Used to disconnect the signal.
102 * @param[in] signalName The signal to connect to.
103 * @param[in] functor A newly allocated FunctorDelegate.
104 * @return True if the signal was connected.
105 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
107 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
109 private: // From Control
112 * @copydoc Toolkit::Control::OnInitialize()
114 virtual void OnInitialize();
117 * @copydoc Toolkit::Control::OnTouchEvent(const TouchEvent& event)
119 virtual bool OnTouchEvent( const TouchEvent& event );
124 * Construct a new RotatingSelector.
129 * A reference counted object may only be deleted by calling Unreference()
131 virtual ~RotatingSelector();
136 RotatingSelector(const RotatingSelector&);
139 RotatingSelector& operator=(const RotatingSelector& rhs);
141 void ToggleAndAnimateSelection();
142 void AnimationCompleted( Animation& animation );
151 Actor mUnSelectedActor;
152 Actor mSelectedActor;
155 Animation mRotateAnimation;
159 Toolkit::RotatingSelector::SelectedSignalV2 mCheckedSignalV2;
162 } // namespace Internal
164 // Helpers for public-api forwarding methods
166 inline Toolkit::Internal::RotatingSelector& GetImpl(Toolkit::RotatingSelector& RotatingSelector)
168 DALI_ASSERT_ALWAYS(RotatingSelector);
170 Dali::RefObject& handle = RotatingSelector.GetImplementation();
172 return static_cast<Toolkit::Internal::RotatingSelector&>(handle);
175 inline const Toolkit::Internal::RotatingSelector& GetImpl(const Toolkit::RotatingSelector& RotatingSelector)
177 DALI_ASSERT_ALWAYS(RotatingSelector);
179 const Dali::RefObject& handle = RotatingSelector.GetImplementation();
181 return static_cast<const Toolkit::Internal::RotatingSelector&>(handle);
184 } // namespace Toolkit
188 #endif // __DALI_TOOLKIT_INTERNAL_ITEM_VIEW_H__