#include "clipboard-event-notifier-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/dali-core.h>
+#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
-#include <adaptor-impl.h>
+#include <singleton-service-impl.h>
namespace Dali
{
namespace Adaptor
{
-namespace
-{
-BaseHandle Create()
-{
- BaseHandle handle( ClipboardEventNotifier::Get() );
-
- if ( !handle && Adaptor::IsAvailable() )
- {
- Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
- Dali::ClipboardEventNotifier notifier( ClipboardEventNotifier::New() );
- adaptorImpl.RegisterSingleton( typeid( notifier ), notifier );
- handle = notifier;
- }
-
- return handle;
-}
-TypeRegistration CLIPBOARD_EVENT_NOTIFIER_TYPE( typeid(Dali::ClipboardEventNotifier), typeid(Dali::BaseHandle), Create, true /* Create Instance At Startup */ );
-
-} // unnamed namespace
-
Dali::ClipboardEventNotifier ClipboardEventNotifier::New()
{
Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier());
{
Dali::ClipboardEventNotifier notifier;
- if ( Adaptor::IsAvailable() )
+ Dali::SingletonService service( SingletonService::Get() );
+ if ( service )
{
// Check whether the singleton is already created
- Dali::BaseHandle handle = Adaptor::Get().GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
+ Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
if(handle)
{
// If so, downcast the handle
notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
}
+ else
+ {
+ notifier = Dali::ClipboardEventNotifier( ClipboardEventNotifier::New() );
+ service.Register( typeid( notifier ), notifier );
+ }
}
return notifier;
void ClipboardEventNotifier::EmitContentSelectedSignal()
{
- if ( !mContentSelectedSignalV2.Empty() )
+ if ( !mContentSelectedSignal.Empty() )
{
Dali::ClipboardEventNotifier handle( this );
- mContentSelectedSignalV2.Emit( handle );
+ mContentSelectedSignal.Emit( handle );
}
}