bool DragAndDropDetector::IsEnabled() const
{
- return !mDroppedSignalV2.Empty() || !mEnteredSignalV2.Empty() || !mExitedSignalV2.Empty() || !mMovedSignalV2.Empty() ;
+ return !mDroppedSignal.Empty() || !mEnteredSignal.Empty() || !mExitedSignal.Empty() || !mMovedSignal.Empty() ;
}
void DragAndDropDetector::SetContent( const std::string& content )
void DragAndDropDetector::EmitEnteredSignal()
{
- if ( !mEnteredSignalV2.Empty() )
+ if ( !mEnteredSignal.Empty() )
{
Dali::DragAndDropDetector handle( this );
- mEnteredSignalV2.Emit( handle );
+ mEnteredSignal.Emit( handle );
}
}
void DragAndDropDetector::EmitExitedSignal()
{
- if ( !mExitedSignalV2.Empty() )
+ if ( !mExitedSignal.Empty() )
{
Dali::DragAndDropDetector handle( this );
- mExitedSignalV2.Emit( handle );
+ mExitedSignal.Emit( handle );
}
}
void DragAndDropDetector::EmitMovedSignal()
{
- if ( !mMovedSignalV2.Empty() )
+ if ( !mMovedSignal.Empty() )
{
Dali::DragAndDropDetector handle( this );
- mMovedSignalV2.Emit( handle );
+ mMovedSignal.Emit( handle );
}
}
void DragAndDropDetector::EmitDroppedSignal()
{
- if ( !mDroppedSignalV2.Empty() )
+ if ( !mDroppedSignal.Empty() )
{
Dali::DragAndDropDetector handle( this );
- mDroppedSignalV2.Emit( handle );
+ mDroppedSignal.Emit( handle );
}
}
{
public:
- typedef Dali::DragAndDropDetector::DragAndDropSignalV2 DragAndDropSignalV2;
+ typedef Dali::DragAndDropDetector::DragAndDropSignal DragAndDropSignal;
// Creation
/**
* @copydoc Dali::DragAndDropDetector::EnteredSignal
*/
- DragAndDropSignalV2& EnteredSignal()
+ DragAndDropSignal& EnteredSignal()
{
- return mEnteredSignalV2;
+ return mEnteredSignal;
}
/**
* @copydoc Dali::DragAndDropDetector::ExitedSignal
*/
- DragAndDropSignalV2& ExitedSignal()
+ DragAndDropSignal& ExitedSignal()
{
- return mExitedSignalV2;
+ return mExitedSignal;
}
/**
* @copydoc Dali::DragAndDropDetector::MovedSignal
*/
- DragAndDropSignalV2& MovedSignal()
+ DragAndDropSignal& MovedSignal()
{
- return mMovedSignalV2;
+ return mMovedSignal;
}
/**
* @copydoc Dali::DragAndDropDetector::DroppedSignal
*/
- DragAndDropSignalV2& DroppedSignal()
+ DragAndDropSignal& DroppedSignal()
{
- return mDroppedSignalV2;
+ return mDroppedSignal;
}
private:
std::string mContent; ///< The current Drag & drop content.
Vector2 mScreenPosition; ///< The screen position of the drop location.
- DragAndDropSignalV2 mEnteredSignalV2;
- DragAndDropSignalV2 mExitedSignalV2;
- DragAndDropSignalV2 mMovedSignalV2;
- DragAndDropSignalV2 mDroppedSignalV2;
+ DragAndDropSignal mEnteredSignal;
+ DragAndDropSignal mExitedSignal;
+ DragAndDropSignal mMovedSignal;
+ DragAndDropSignal mDroppedSignal;
};
} // namespace Adaptor
namespace // unnamed namespace
{
+const char* const SIGNAL_SOUND_PLAY_FINISHED = "sound-play-finished";
+
// Type Registration
-Dali::BaseHandle Create()
+Dali::BaseHandle GetInstance()
{
return SoundPlayer::Get();
}
-Dali::TypeRegistration SOUND_PLAYER_TYPE( typeid(Dali::SoundPlayer), typeid(Dali::BaseHandle), Create );
+Dali::TypeRegistration SOUND_PLAYER_TYPE( typeid(Dali::SoundPlayer), typeid(Dali::BaseHandle), GetInstance );
-Dali::SignalConnectorType SIGNAL_CONNECTOR_1( SOUND_PLAYER_TYPE, Dali::SoundPlayer::SIGNAL_SOUND_PLAY_FINISHED, Dali::Internal::Adaptor::SoundPlayer::DoConnectSignal );
+Dali::SignalConnectorType SIGNAL_CONNECTOR_1( SOUND_PLAYER_TYPE, SIGNAL_SOUND_PLAY_FINISHED, Dali::Internal::Adaptor::SoundPlayer::DoConnectSignal );
} // unnamed namespace
bool connected( true );
SoundPlayer* player = dynamic_cast<SoundPlayer*>( object );
- if( player &&
- Dali::SoundPlayer::SIGNAL_SOUND_PLAY_FINISHED == signalName )
+ if( player && ( SIGNAL_SOUND_PLAY_FINISHED == signalName ) )
{
player->SoundPlayFinishedSignal().Connect( tracker, functor );
}
namespace Dali
{
-const char* const AccessibilityManager::SIGNAL_STATUS_CHANGED( "accessibility-status-changed" );
-const char* const AccessibilityManager::SIGNAL_ACTION_NEXT( "accessibility-action-next" );
-const char* const AccessibilityManager::SIGNAL_ACTION_PREVIOUS( "accessibility-action-previous" );
-const char* const AccessibilityManager::SIGNAL_ACTION_ACTIVATE( "accessibility-action-activate" );
-const char* const AccessibilityManager::SIGNAL_ACTION_OVER( "accessibility-action-over" );
-const char* const AccessibilityManager::SIGNAL_ACTION_READ( "accessibility-action-read" );
-const char* const AccessibilityManager::SIGNAL_ACTION_READ_NEXT( "accessibility-action-read-next" );
-const char* const AccessibilityManager::SIGNAL_ACTION_READ_PREVIOUS( "accessibility-action-read-previous" );
-const char* const AccessibilityManager::SIGNAL_ACTION_UP( "accessibility-action-up" );
-const char* const AccessibilityManager::SIGNAL_ACTION_DOWN( "accessibility-action-down" );
-const char* const AccessibilityManager::SIGNAL_ACTION_CLEAR_FOCUS( "accessibility-action-clear-focus" );
-const char* const AccessibilityManager::SIGNAL_ACTION_BACK( "accessibility-action-back" );
-const char* const AccessibilityManager::SIGNAL_ACTION_SCROLL( "accessibility-action-scroll" );
-
AccessibilityManager::AccessibilityManager()
{
}
typedef SignalV2< bool ( AccessibilityManager& ) > AccessibilityActionSignalV2; ///< Generic signal type
typedef SignalV2< bool (AccessibilityManager&, const Dali::TouchEvent&)> AccessibilityActionScrollSignalV2; ///< Scroll signal type
- // Signal Names
- static const char* const SIGNAL_STATUS_CHANGED; ///< name "accessibility-status-changed"
- static const char* const SIGNAL_ACTION_NEXT; ///< name "accessibility-action-next"
- static const char* const SIGNAL_ACTION_PREVIOUS; ///< name "accessibility-action-previous"
- static const char* const SIGNAL_ACTION_ACTIVATE; ///< name "accessibility-action-activatae"
- static const char* const SIGNAL_ACTION_OVER; ///< name "accessibility-action-over"
- static const char* const SIGNAL_ACTION_READ; ///< name "accessibility-action-read"
- static const char* const SIGNAL_ACTION_READ_NEXT; ///< name "accessibility-action-read-next"
- static const char* const SIGNAL_ACTION_READ_PREVIOUS; ///< name "accessibility-action-read-prev"
- static const char* const SIGNAL_ACTION_UP; ///< name "accessibility-action-up"
- static const char* const SIGNAL_ACTION_DOWN; ///< name "accessibility-action-down"
- static const char* const SIGNAL_ACTION_CLEAR_FOCUS; ///< name "accessibility-action-clear-focus"
- static const char* const SIGNAL_ACTION_BACK; ///< name "accessibility-action-back"
- static const char* const SIGNAL_ACTION_SCROLL; ///< name "accessibility-action-scroll"
-
/**
* @brief Create an uninitialized handle.
*
namespace Dali
{
-const char* const ClipboardEventNotifier::SIGNAL_CONTENT_SELECTED( "content-selected" );
-
ClipboardEventNotifier::ClipboardEventNotifier()
{
}
*/
typedef SignalV2< void ( ClipboardEventNotifier& ) > ClipboardEventSignalV2;
- // Signal Names
- static const char* const SIGNAL_CONTENT_SELECTED; ///< name "content-selected"
-
/**
* @brief Create an uninitialized handle.
*
namespace Dali
{
-const char* const DragAndDropDetector::SIGNAL_ENTERED( "drag-and-drop-entered" );
-const char* const DragAndDropDetector::SIGNAL_EXITED( "drag-and-drop-exited" );
-const char* const DragAndDropDetector::SIGNAL_MOVED( "drag-and-drop-moved" );
-const char* const DragAndDropDetector::SIGNAL_DROPPED( "drag-and-drop-dropped" );
-
DragAndDropDetector::DragAndDropDetector()
{
}
return GetImplementation(*this).GetCurrentScreenPosition();
}
-DragAndDropDetector::DragAndDropSignalV2& DragAndDropDetector::EnteredSignal()
+DragAndDropDetector::DragAndDropSignal& DragAndDropDetector::EnteredSignal()
{
return GetImplementation(*this).EnteredSignal();
}
-DragAndDropDetector::DragAndDropSignalV2& DragAndDropDetector::ExitedSignal()
+DragAndDropDetector::DragAndDropSignal& DragAndDropDetector::ExitedSignal()
{
return GetImplementation(*this).ExitedSignal();
}
-DragAndDropDetector::DragAndDropSignalV2& DragAndDropDetector::MovedSignal()
+DragAndDropDetector::DragAndDropSignal& DragAndDropDetector::MovedSignal()
{
return GetImplementation(*this).MovedSignal();
}
-DragAndDropDetector::DragAndDropSignalV2& DragAndDropDetector::DroppedSignal()
+DragAndDropDetector::DragAndDropSignal& DragAndDropDetector::DroppedSignal()
{
return GetImplementation(*this).DroppedSignal();
}
/**
* @brief The DragAndDropDetector%s provides signals when draggable objects are dragged into our window.
+ *
* It provides signals for when the draggable object enters our window, moves around in our window,
* leaves our window and when it is finally dropped into our window.
+ *
* The basic usage is shown below:
*
* @code
// Typedefs
- /**
- * @brief Drag & Drop signal.
- */
- typedef SignalV2< void ( DragAndDropDetector ) > DragAndDropSignalV2;
-
- // Signal Names
- static const char* const SIGNAL_ENTERED;///< name "drag-and-drop-entered"
- static const char* const SIGNAL_EXITED; ///< name "drag-and-drop-exited"
- static const char* const SIGNAL_MOVED; ///< name "drag-and-drop-moved"
- static const char* const SIGNAL_DROPPED;///< name "drag-and-drop-dropped"
+ typedef SignalV2< void ( DragAndDropDetector ) > DragAndDropSignal; ///< Drag & Drop signal
/**
* @brief Create an uninitialized handle.
*/
Vector2 GetCurrentScreenPosition() const;
-public: // Signals
+ // Signals
/**
* @brief This is emitted when a dragged object enters a DALi window.
* @endcode
* @return The signal to connect to.
*/
- DragAndDropSignalV2& EnteredSignal();
+ DragAndDropSignal& EnteredSignal();
/**
* @brief This is emitted when a dragged object leaves a DALi window.
* @endcode
* @return The signal to connect to.
*/
- DragAndDropSignalV2& ExitedSignal();
+ DragAndDropSignal& ExitedSignal();
/**
* @brief This is emitted when a dragged object is moved within the DALi window.
* @code
* void YourCallback( DragAndDropDetector detector );
* @endcode
- * This will be replaced by a property notification system once that is in place.
* @return The signal to connect to.
*/
- DragAndDropSignalV2& MovedSignal();
+ DragAndDropSignal& MovedSignal();
/**
* @brief This is emitted when a dragged object is dropped within a DALi window.
* @endcode
* @return The signal to connect to.
*/
- DragAndDropSignalV2& DroppedSignal();
+ DragAndDropSignal& DroppedSignal();
public: // Not intended for application developers
namespace Dali
{
-const char* const SoundPlayer::SIGNAL_SOUND_PLAY_FINISHED = "sound-play-finished";
-
SoundPlayer::SoundPlayer()
{
}
typedef SignalV2< void (SoundPlayer&) > SoundPlayFinishedSignalV2; ///< Sound play finished signal
- // Signal Names
- static const char* const SIGNAL_SOUND_PLAY_FINISHED; ///< name "sound-play-finished"
-
-public:
-
/**
* @brief Create an uninitialized handle.
*
*
* @pre The SoundPlayer needs to be initialized.
* @return The signal to connect to.
+ *
+ * @note The signal name is "sound-play-finished" if using BaseHandle::ConnectSignal()
*/
SoundPlayFinishedSignalV2& SoundPlayFinishedSignal();
namespace Dali
{
-const char* const TiltSensor::SIGNAL_TILTED = "tilted";
-
const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
TiltSensor::TiltSensor()
typedef SignalV2< void (const TiltSensor&) > TiltedSignalV2;
- // Signal Names
- static const char* const SIGNAL_TILTED;
-
static const float DEFAULT_UPDATE_FREQUENCY; // 60 hertz
/**
* This signal will be emitted when the device is tilted, if the tilt-sensor is enabled.
* The frequency of the signals can be controlled using SetUpdateFrequency().
* @return The signal to connect to.
+ *
+ * @note The signal name is "tilted" if using BaseHandle::ConnectSignal()
*/
TiltedSignalV2& TiltedSignal();
namespace // unnamed namespace
{
+const char* const SIGNAL_TILTED = "tilted";
+
const int NUMBER_OF_SAMPLES = 10;
const float MAX_ACCELEROMETER_XY_VALUE = 9.8f;
// Type Registration
-Dali::BaseHandle Create()
+Dali::BaseHandle GetInstance()
{
return Dali::Internal::Adaptor::TiltSensor::Get();
}
-Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle), Create );
+Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle), GetInstance );
-Dali::SignalConnectorType signalConnector1( typeRegistration, Dali::TiltSensor::SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
+Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
} // unnamed namespace
bool connected( true );
TiltSensor* sensor = dynamic_cast<TiltSensor*>( object );
- if( sensor &&
- Dali::TiltSensor::SIGNAL_TILTED == signalName )
+ if( sensor && ( SIGNAL_TILTED == signalName ) )
{
sensor->TiltedSignal().Connect( tracker, functor );
}
namespace // unnamed namespace
{
+const char* const SIGNAL_TILTED = "tilted";
+
const int NUMBER_OF_SAMPLES = 10;
const float MAX_ACCELEROMETER_XY_VALUE = 9.8f;
// Type Registration
-Dali::BaseHandle Create()
+Dali::BaseHandle GetInstance()
{
return Dali::Internal::Adaptor::TiltSensor::Get();
}
-Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle), Create );
+Dali::TypeRegistration typeRegistration( typeid(Dali::TiltSensor), typeid(Dali::BaseHandle), GetInstance );
-Dali::SignalConnectorType signalConnector1( typeRegistration, Dali::TiltSensor::SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
+Dali::SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TILTED, Dali::Internal::Adaptor::TiltSensor::DoConnectSignal );
} // unnamed namespace
bool connected( true );
TiltSensor* sensor = dynamic_cast<TiltSensor*>( object );
- if( sensor &&
- Dali::TiltSensor::SIGNAL_TILTED == signalName )
+ if( sensor && ( SIGNAL_TILTED == signalName ) )
{
sensor->TiltedSignal().Connect( tracker, functor );
}