[Tizen] Fix clipboard paste issue
[platform/core/uifw/dali-adaptor.git] / dali / internal / clipboard / generic / clipboard-impl-generic.cpp
old mode 100755 (executable)
new mode 100644 (file)
index fe5ab5e..74b911e
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/internal/clipboard/common/clipboard-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 namespace Adaptor
 {
-
 struct Clipboard::Impl
 {
 };
 
-Clipboard::Clipboard( Impl* impl )
-: mImpl( impl )
+Clipboard::Clipboard(Impl* impl)
+: mImpl(impl)
 {
 }
 
@@ -47,28 +44,42 @@ Dali::Clipboard Clipboard::Get()
 {
   Dali::Clipboard clipboard;
 
-  Dali::SingletonService service( SingletonService::Get() );
-  if ( service )
+  Dali::SingletonService service(SingletonService::Get());
+  if(service)
   {
     // Check whether the singleton is already created
-    Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::Clipboard ) );
+    Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::Clipboard));
     if(handle)
     {
       // If so, downcast the handle
-      clipboard = Dali::Clipboard( dynamic_cast< Clipboard* >( handle.GetObjectPtr() ) );
+      clipboard = Dali::Clipboard(dynamic_cast<Clipboard*>(handle.GetObjectPtr()));
     }
     else
     {
-      Clipboard::Impl* impl( new Clipboard::Impl() );
-      clipboard = Dali::Clipboard( new Clipboard(impl) );
-      service.Register( typeid(Dali::Clipboard), clipboard );
+      Clipboard::Impl* impl(new Clipboard::Impl());
+      clipboard = Dali::Clipboard(new Clipboard(impl));
+      service.Register(typeid(Dali::Clipboard), clipboard);
     }
   }
 
   return clipboard;
 }
 
-bool Clipboard::SetItem(const std::string &itemData )
+bool Clipboard::IsAvailable()
+{
+  Dali::SingletonService service(SingletonService::Get());
+  if(service)
+  {
+    Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::Clipboard));
+    if(handle)
+    {
+      return true;
+    }
+  }
+  return false;
+}
+
+bool Clipboard::SetItem(const std::string& itemData)
 {
   return true;
 }
@@ -95,9 +106,12 @@ bool Clipboard::IsVisible() const
   return false;
 }
 
-char* Clipboard::ExcuteBuffered( bool type, void *event )
+void Clipboard::ExcuteSend(void* event)
+{
+}
+
+void Clipboard::ExcuteReceive(void* event, char*& data, int& length)
 {
-  return NULL;
 }
 
 } // namespace Adaptor