- // if cast succeeds there is an implementation so no need to check
- ret = Internal::GetImplementation( control ).OnAccessibilityActivated();
- }
- }
-
- return ret;
-}
-
-/**
- * Connects a callback function with the object's signals.
- * @param[in] object The object providing the signal.
- * @param[in] tracker Used to disconnect the signal.
- * @param[in] signalName The signal to connect to.
- * @param[in] functor A newly allocated FunctorDelegate.
- * @return True if the signal was connected.
- * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
- */
-const char* SIGNAL_KEY_EVENT = "keyEvent";
-const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "keyInputFocusGained";
-const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "keyInputFocusLost";
-const char* SIGNAL_TAPPED = "tapped";
-const char* SIGNAL_PANNED = "panned";
-const char* SIGNAL_PINCHED = "pinched";
-const char* SIGNAL_LONG_PRESSED = "longPressed";
-static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
- Dali::BaseHandle handle( object );
-
- bool connected( false );
- Toolkit::Control control = Toolkit::Control::DownCast( handle );
- if ( control )
- {
- Internal::Control& controlImpl( Internal::GetImplementation( control ) );
- connected = true;
-
- if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
- {
- controlImpl.KeyEventSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
- {
- controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
- {
- controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
- {
- controlImpl.EnableGestureDetection( Gesture::Tap );
- controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
- {
- controlImpl.EnableGestureDetection( Gesture::Pan );
- controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
- {
- controlImpl.EnableGestureDetection( Gesture::Pinch );
- controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
- {
- controlImpl.EnableGestureDetection( Gesture::LongPress );
- controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
- }
- }
- return connected;
-}
-
-// Setup signals and actions using the type-registry.
-DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
-
-// Note: Properties are registered separately below.
-
-SignalConnectorType registerSignal1( typeRegistration, SIGNAL_KEY_EVENT, &DoConnectSignal );
-SignalConnectorType registerSignal2( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_GAINED, &DoConnectSignal );
-SignalConnectorType registerSignal3( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_LOST, &DoConnectSignal );
-SignalConnectorType registerSignal4( typeRegistration, SIGNAL_TAPPED, &DoConnectSignal );
-SignalConnectorType registerSignal5( typeRegistration, SIGNAL_PANNED, &DoConnectSignal );
-SignalConnectorType registerSignal6( typeRegistration, SIGNAL_PINCHED, &DoConnectSignal );
-SignalConnectorType registerSignal7( typeRegistration, SIGNAL_LONG_PRESSED, &DoConnectSignal );
-
-TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &DoAction );
-
-DALI_TYPE_REGISTRATION_END()
-
-} // unnamed namespace
-
-namespace Internal
-{
-
-class Control::Impl : public ConnectionTracker
-{
-public:
-
- // Construction & Destruction
- Impl(Control& controlImpl)
- : mControlImpl( controlImpl ),
- mState( Toolkit::DevelControl::NORMAL ),
- mSubStateName(""),
- mLeftFocusableActorId( -1 ),
- mRightFocusableActorId( -1 ),
- mUpFocusableActorId( -1 ),
- mDownFocusableActorId( -1 ),
- mStyleName(""),
- mBackgroundColor(Color::TRANSPARENT),
- mStartingPinchScale( NULL ),
- mKeyEventSignal(),
- mPinchGestureDetector(),
- mPanGestureDetector(),
- mTapGestureDetector(),
- mLongPressGestureDetector(),
- mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
- mIsKeyboardNavigationSupported( false ),
- mIsKeyboardFocusGroup( false )
- {
- }
-
- ~Impl()
- {
- // All gesture detectors will be destroyed so no need to disconnect.
- delete mStartingPinchScale;
- }
-
- // Gesture Detection Methods
-
- void PinchDetected(Actor actor, const PinchGesture& pinch)
- {
- mControlImpl.OnPinch(pinch);
- }
-
- void PanDetected(Actor actor, const PanGesture& pan)
- {
- mControlImpl.OnPan(pan);
- }
-
- void TapDetected(Actor actor, const TapGesture& tap)
- {
- mControlImpl.OnTap(tap);
- }
-
- void LongPressDetected(Actor actor, const LongPressGesture& longPress)
- {
- mControlImpl.OnLongPress(longPress);
- }
-
- // Properties
-
- /**
- * Called when a property of an object of this type is set.
- * @param[in] object The object whose property is set.
- * @param[in] index The property index.
- * @param[in] value The new property value.
- */
- static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
- {
- Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
-
- if ( control )
- {
- Control& controlImpl( GetImplementation( control ) );
-
- switch ( index )