/*
- * Copyright (c) 2020 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.
return Internal::Adaptor::Clipboard::Get();
}
+bool Clipboard::IsAvailable()
+{
+ return Internal::Adaptor::Clipboard::IsAvailable();
+}
+
bool Clipboard::SetItem(const std::string& itemData)
{
return GetImplementation(*this).SetItem(itemData);
#define DALI_CLIPBOARD_H
/*
- * Copyright (c) 2020 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.
static Clipboard Get();
/**
+ * @brief Checks whether the clipboard is available.
+ *
+ * @return true, if it is available, false otherwise.
+ */
+ static bool IsAvailable();
+
+ /**
* @brief Send the given string to the clipboard.
*
* @param[in] itemData string to send to clip board
#define DALI_INTERNAL_CLIPBOARD_H
/*
- * Copyright (c) 2021 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.
struct Impl;
/**
- * @copydoc Dali::ClipboardEventNotifier::Get()
+ * @copydoc Dali::Clipboard::Get()
*/
static Dali::Clipboard Get();
/**
+ * @copydoc Dali::Clipboard::IsAvailable()
+ */
+ static bool IsAvailable();
+
+ /**
* Constructor
* @param[in] impl Some data from a specific windowing system.
*/
/*
- * Copyright (c) 2021 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.
return clipboard;
}
+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;
/*
- * Copyright (c) 2022 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.
return clipboard;
}
+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)
{
mImpl->SetItem(itemData);
/*
- * Copyright (c) 2021 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.
return clipboard;
}
+
+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)
{
Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow();
EventHandler::EventHandler(WindowBase* windowBase, DamageObserver& damageObserver)
: mStyleMonitor(StyleMonitor::Get()),
mDamageObserver(damageObserver),
- mClipboardEventNotifier(ClipboardEventNotifier::Get()),
+ mClipboardEventNotifier(),
mPaused(false)
{
// Connect signals
void EventHandler::OnFocusChanged(bool focusIn)
{
// If the window gains focus and we hid the keyboard then show it again.
- if(focusIn)
+ if(Clipboard::IsAvailable())
{
- Dali::Clipboard clipboard = Clipboard::Get();
- if(clipboard)
+ if(focusIn)
{
- clipboard.HideClipboard();
+ Dali::Clipboard clipboard = Clipboard::Get();
+ if(clipboard)
+ {
+ clipboard.HideClipboard();
+ }
}
- }
- else
- {
- // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
- Dali::Clipboard clipboard = Clipboard::Get();
- if(clipboard)
+ else
{
- Clipboard& clipBoardImpl(GetImplementation(clipboard));
- clipBoardImpl.HideClipboard(true);
+ // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
+ Dali::Clipboard clipboard = Clipboard::Get();
+ if(clipboard)
+ {
+ Clipboard& clipBoardImpl(GetImplementation(clipboard));
+ clipBoardImpl.HideClipboard(true);
+ }
}
}
}