From: Bowon Ryu Date: Tue, 27 Jun 2023 05:43:51 +0000 (+0900) Subject: Move Clipboard to TextClipboard X-Git-Tag: dali_2.2.33~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F294818%2F4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Move Clipboard to TextClipboard We plan to create a new Clipboard class and remove the dependency on Text and the legacy clipboard. Change-Id: I50475d80571b128b199e209ed8515c6446688e6e Signed-off-by: Bowon Ryu --- diff --git a/build/tizen/module-list.cmake b/build/tizen/module-list.cmake index c345546..69ec693 100644 --- a/build/tizen/module-list.cmake +++ b/build/tizen/module-list.cmake @@ -4,8 +4,8 @@ include( ${ADAPTOR_ROOT}/dali/internal/accessibility/file.list ) SET( adaptor_adaptor_dir ${ADAPTOR_ROOT}/dali/internal/adaptor ) include( ${ADAPTOR_ROOT}/dali/internal/adaptor/file.list ) -SET( adaptor_clipboard_dir ${ADAPTOR_ROOT}/dali/internal/clipboard ) -include( ${ADAPTOR_ROOT}/dali/internal/clipboard/file.list ) +SET( adaptor_text_clipboard_dir ${ADAPTOR_ROOT}/dali/internal/text-clipboard ) +include( ${ADAPTOR_ROOT}/dali/internal/text-clipboard/file.list ) SET( adaptor_drag_and_drop_dir ${ADAPTOR_ROOT}/dali/internal/drag-and-drop ) include( ${ADAPTOR_ROOT}/dali/internal/drag-and-drop/file.list ) @@ -93,8 +93,8 @@ include( ${ADAPTOR_ROOT}/dali/internal/accessibility/file.list ) SET( adaptor_adaptor_dir ${ADAPTOR_ROOT}/dali/internal/adaptor ) include( ${ADAPTOR_ROOT}/dali/internal/adaptor/file.list ) -SET( adaptor_clipboard_dir ${ADAPTOR_ROOT}/dali/internal/clipboard ) -include( ${ADAPTOR_ROOT}/dali/internal/clipboard/file.list ) +SET( adaptor_text_clipboard_dir ${ADAPTOR_ROOT}/dali/internal/text-clipboard ) +include( ${ADAPTOR_ROOT}/dali/internal/text-clipboard/file.list ) SET( adaptor_drag_and_drop_dir ${ADAPTOR_ROOT}/dali/internal/drag-and-drop ) include( ${ADAPTOR_ROOT}/dali/internal/drag-and-drop/file.list ) diff --git a/build/tizen/profiles/android-profile.cmake b/build/tizen/profiles/android-profile.cmake index 36b45e0..55b5e11 100644 --- a/build/tizen/profiles/android-profile.cmake +++ b/build/tizen/profiles/android-profile.cmake @@ -8,8 +8,6 @@ SET( SOURCES ${adaptor_accessibility_android_src_files} ${adaptor_adaptor_common_src_files} ${adaptor_canvas_renderer_generic_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_android_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_android_src_files} ${devel_api_src_files} @@ -33,6 +31,8 @@ SET( SOURCES ${adaptor_styling_common_src_files} ${adaptor_system_common_src_files} ${adaptor_system_android_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_android_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/common-profile.cmake b/build/tizen/profiles/common-profile.cmake index 8959963..513e594 100644 --- a/build/tizen/profiles/common-profile.cmake +++ b/build/tizen/profiles/common-profile.cmake @@ -8,8 +8,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_adaptor_tizen_wayland_src_files} ${adaptor_canvas_renderer_tizen_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_tizen_wayland_src_files} ${adaptor_drag_and_drop_tizen_wayland_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -33,6 +31,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} ${adaptor_system_tizen_wayland_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_tizen_wayland_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/glib-x11-profile.cmake b/build/tizen/profiles/glib-x11-profile.cmake index 7a45b3d..0405269 100644 --- a/build/tizen/profiles/glib-x11-profile.cmake +++ b/build/tizen/profiles/glib-x11-profile.cmake @@ -10,8 +10,6 @@ SET( SOURCES ${adaptor_addons_ubuntu_src_files} ${adaptor_camera_common_src_files} ${adaptor_canvas_renderer_generic_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_glib_x11_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -34,6 +32,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_glib_src_files} ${adaptor_resampler_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_glib_x11_src_files} ${adaptor_text_common_src_files} ${adaptor_thread_common_src_files} ${adaptor_thread_linux_src_files} diff --git a/build/tizen/profiles/ivi-profile.cmake b/build/tizen/profiles/ivi-profile.cmake index 86bc9f2..a4e81e6 100644 --- a/build/tizen/profiles/ivi-profile.cmake +++ b/build/tizen/profiles/ivi-profile.cmake @@ -8,8 +8,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_adaptor_tizen_wayland_src_files} ${adaptor_canvas_renderer_tizen_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_tizen_wayland_src_files} ${adaptor_drag_and_drop_tizen_wayland_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -34,6 +32,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} ${adaptor_system_tizen_wayland_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_tizen_wayland_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/libuv-x11-profile.cmake b/build/tizen/profiles/libuv-x11-profile.cmake index 8b8e5d0..532eb3a 100644 --- a/build/tizen/profiles/libuv-x11-profile.cmake +++ b/build/tizen/profiles/libuv-x11-profile.cmake @@ -10,8 +10,6 @@ SET( SOURCES ${adaptor_addons_ubuntu_src_files} ${adaptor_camera_common_src_files} ${adaptor_canvas_renderer_generic_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_libuv_x11_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -34,6 +32,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_libuv_src_files} ${adaptor_resampler_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_libuv_x11_src_files} ${adaptor_text_common_src_files} ${adaptor_thread_common_src_files} ${adaptor_thread_linux_src_files} diff --git a/build/tizen/profiles/macos-profile.cmake b/build/tizen/profiles/macos-profile.cmake index 8111ce5..1a1fed6 100644 --- a/build/tizen/profiles/macos-profile.cmake +++ b/build/tizen/profiles/macos-profile.cmake @@ -7,8 +7,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_canvas_renderer_generic_src_files} ${adaptor_adaptor_macos_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_macos_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -32,6 +30,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_macos_src_files} ${adaptor_system_macos_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_macos_src_files} ${adaptor_text_common_src_files} ${adaptor_text_macos_src_files} ${adaptor_resampler_src_files} diff --git a/build/tizen/profiles/mobile-profile.cmake b/build/tizen/profiles/mobile-profile.cmake index 3b1d651..8eea7b0 100644 --- a/build/tizen/profiles/mobile-profile.cmake +++ b/build/tizen/profiles/mobile-profile.cmake @@ -8,8 +8,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_adaptor_tizen_wayland_src_files} ${adaptor_canvas_renderer_tizen_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_tizen_wayland_src_files} ${adaptor_drag_and_drop_tizen_wayland_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -33,6 +31,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} ${adaptor_system_tizen_wayland_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_tizen_wayland_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/tv-profile.cmake b/build/tizen/profiles/tv-profile.cmake index 8305c24..fb194d5 100644 --- a/build/tizen/profiles/tv-profile.cmake +++ b/build/tizen/profiles/tv-profile.cmake @@ -8,8 +8,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_adaptor_tizen_wayland_src_files} ${adaptor_canvas_renderer_tizen_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_tizen_wayland_src_files} ${adaptor_drag_and_drop_tizen_wayland_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -33,6 +31,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} ${adaptor_system_tizen_wayland_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_tizen_wayland_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/ubuntu-profile.cmake b/build/tizen/profiles/ubuntu-profile.cmake index 2429239..3e66324 100644 --- a/build/tizen/profiles/ubuntu-profile.cmake +++ b/build/tizen/profiles/ubuntu-profile.cmake @@ -7,8 +7,6 @@ SET( SOURCES ${adaptor_adaptor_common_src_files} ${adaptor_adaptor_ubuntu_src_files} ${adaptor_canvas_renderer_ubuntu_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_ubuntu_x11_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -32,6 +30,8 @@ SET( SOURCES ${adaptor_system_common_src_files} ${adaptor_system_linux_src_files} ${adaptor_system_ubuntu_x11_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_ubuntu_x11_src_files} ${adaptor_text_common_src_files} ${adaptor_text_ubuntu_src_files} ${adaptor_resampler_src_files} diff --git a/build/tizen/profiles/wearable-profile.cmake b/build/tizen/profiles/wearable-profile.cmake index ee6060c..bd37266 100644 --- a/build/tizen/profiles/wearable-profile.cmake +++ b/build/tizen/profiles/wearable-profile.cmake @@ -10,8 +10,6 @@ SET( SOURCES ${adaptor_adaptor_tizen_wearable_src_files} ${adaptor_drag_and_drop_tizen_wayland_src_files} ${adaptor_canvas_renderer_tizen_src_files} - ${adaptor_clipboard_common_src_files} - ${adaptor_clipboard_tizen_wayland_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} ${adaptor_devel_api_text_abstraction_src_files} @@ -35,6 +33,8 @@ SET( SOURCES ${adaptor_system_linux_src_files} ${adaptor_system_tizen_wayland_src_files} ${adaptor_system_tizen_wearable_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_tizen_wayland_src_files} ${adaptor_text_common_src_files} ${adaptor_resampler_src_files} ${adaptor_vector_animation_common_src_files} diff --git a/build/tizen/profiles/windows-profile.cmake b/build/tizen/profiles/windows-profile.cmake index 3ab536f..f2d935c 100644 --- a/build/tizen/profiles/windows-profile.cmake +++ b/build/tizen/profiles/windows-profile.cmake @@ -6,7 +6,6 @@ SET( SOURCES ${adaptor_accessibility_windows_src_files} ${adaptor_adaptor_common_src_files} ${adaptor_canvas_renderer_generic_src_files} - ${adaptor_clipboard_common_src_files} ${adaptor_drag_and_drop_generic_src_files} ${adaptor_framework_generic_src_files} ${devel_api_src_files} @@ -43,7 +42,8 @@ SET( SOURCES ${adaptor_window_system_windows_src_files} ${adaptor_graphics_windows_src_files} ${adaptor_input_windows_src_files} - ${adaptor_clipboard_windows_src_files} + ${adaptor_text_clipboard_common_src_files} + ${adaptor_text_clipboard_windows_src_files} ${adaptor_imaging_windows_src_files} ${adaptor_addons_common_src_files} ${adaptor_addons_dummy_src_files} diff --git a/dali/devel-api/adaptor-framework/clipboard-event-notifier.cpp b/dali/devel-api/adaptor-framework/clipboard-event-notifier.cpp deleted file mode 100644 index 2a936bc..0000000 --- a/dali/devel-api/adaptor-framework/clipboard-event-notifier.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ -ClipboardEventNotifier::ClipboardEventNotifier() -{ -} - -ClipboardEventNotifier ClipboardEventNotifier::Get() -{ - return Internal::Adaptor::ClipboardEventNotifier::Get(); -} - -ClipboardEventNotifier::~ClipboardEventNotifier() -{ -} - -const std::string& ClipboardEventNotifier::GetContent() const -{ - return Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).GetContent(); -} - -void ClipboardEventNotifier::SetContent(const std::string& content) -{ - Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).SetContent(content); -} - -void ClipboardEventNotifier::ClearContent() -{ - Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).ClearContent(); -} - -void ClipboardEventNotifier::EmitContentSelectedSignal() -{ - Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).EmitContentSelectedSignal(); -} - -ClipboardEventNotifier::ClipboardEventSignalType& ClipboardEventNotifier::ContentSelectedSignal() -{ - return Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).ContentSelectedSignal(); -} - -ClipboardEventNotifier::ClipboardEventNotifier(Internal::Adaptor::ClipboardEventNotifier* notifier) -: BaseHandle(notifier) -{ -} - -} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/text-clipboard-event-notifier.cpp b/dali/devel-api/adaptor-framework/text-clipboard-event-notifier.cpp new file mode 100644 index 0000000..0261cc6 --- /dev/null +++ b/dali/devel-api/adaptor-framework/text-clipboard-event-notifier.cpp @@ -0,0 +1,69 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ +TextClipboardEventNotifier::TextClipboardEventNotifier() +{ +} + +TextClipboardEventNotifier TextClipboardEventNotifier::Get() +{ + return Internal::Adaptor::TextClipboardEventNotifier::Get(); +} + +TextClipboardEventNotifier::~TextClipboardEventNotifier() +{ +} + +const std::string& TextClipboardEventNotifier::GetContent() const +{ + return Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).GetContent(); +} + +void TextClipboardEventNotifier::SetContent(const std::string& content) +{ + Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).SetContent(content); +} + +void TextClipboardEventNotifier::ClearContent() +{ + Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).ClearContent(); +} + +void TextClipboardEventNotifier::EmitContentSelectedSignal() +{ + Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).EmitContentSelectedSignal(); +} + +TextClipboardEventNotifier::TextClipboardEventSignalType& TextClipboardEventNotifier::ContentSelectedSignal() +{ + return Internal::Adaptor::TextClipboardEventNotifier::GetImplementation(*this).ContentSelectedSignal(); +} + +TextClipboardEventNotifier::TextClipboardEventNotifier(Internal::Adaptor::TextClipboardEventNotifier* notifier) +: BaseHandle(notifier) +{ +} + +} // namespace Dali diff --git a/dali/devel-api/adaptor-framework/clipboard-event-notifier.h b/dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h similarity index 66% rename from dali/devel-api/adaptor-framework/clipboard-event-notifier.h rename to dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h index 490ee2c..f8e4297 100644 --- a/dali/devel-api/adaptor-framework/clipboard-event-notifier.h +++ b/dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h @@ -1,8 +1,8 @@ -#ifndef DALI_CLIPBOARD_EVENT_NOTIFIER_H -#define DALI_CLIPBOARD_EVENT_NOTIFIER_H +#ifndef DALI_TEXT_CLIPBOARD_EVENT_NOTIFIER_H +#define DALI_TEXT_CLIPBOARD_EVENT_NOTIFIER_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. @@ -31,43 +31,43 @@ namespace Internal DALI_INTERNAL { namespace Adaptor { -class ClipboardEventNotifier; +class TextClipboardEventNotifier; } } // namespace DALI_INTERNAL /** - * @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device. + * @brief The TextClipboardEventNotifier provides signals when clipboard events are received from the device. */ -class DALI_ADAPTOR_API ClipboardEventNotifier : public BaseHandle +class DALI_ADAPTOR_API TextClipboardEventNotifier : public BaseHandle { public: // Typedefs /** - * @brief Clipboard event + * @brief TextClipboard event */ - typedef Signal ClipboardEventSignalType; + typedef Signal TextClipboardEventSignalType; /** * @brief Create an uninitialized handle. * * This can be initialized by getting the notifier from Dali::Adaptor. */ - ClipboardEventNotifier(); + TextClipboardEventNotifier(); /** - * @brief Retrieve a handle to the ClipboardEventNotifier instance. + * @brief Retrieve a handle to the TextClipboardEventNotifier instance. * - * @return A handle to the ClipboardEventNotifier + * @return A handle to the TextClipboardEventNotifier */ - static ClipboardEventNotifier Get(); + static TextClipboardEventNotifier Get(); /** * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. */ - ~ClipboardEventNotifier(); + ~TextClipboardEventNotifier(); /** * @brief Returns the selected content. @@ -97,21 +97,21 @@ public: // Signals * * A callback of the following type may be connected: * @code - * void YourCallback( ClipboardEventNotifier& notifier ); + * void YourCallback( TextClipboardEventNotifier& notifier ); * @endcode * @return The signal to connect to. */ - ClipboardEventSignalType& ContentSelectedSignal(); + TextClipboardEventSignalType& ContentSelectedSignal(); public: // Not intended for application developers /** - * @brief This constructor is used by ClipboardEventNotifier::Get(). + * @brief This constructor is used by TextClipboardEventNotifier::Get(). * * @param[in] notifier A pointer to the drag and drop notifier. */ - explicit DALI_INTERNAL ClipboardEventNotifier(Internal::Adaptor::ClipboardEventNotifier* notifier); + explicit DALI_INTERNAL TextClipboardEventNotifier(Internal::Adaptor::TextClipboardEventNotifier* notifier); }; } // namespace Dali -#endif // DALI_CLIPBOARD_EVENT_NOTIFIER_H +#endif // DALI_TEXT_CLIPBOARD_EVENT_NOTIFIER_H diff --git a/dali/devel-api/adaptor-framework/clipboard.cpp b/dali/devel-api/adaptor-framework/text-clipboard.cpp similarity index 60% rename from dali/devel-api/adaptor-framework/clipboard.cpp rename to dali/devel-api/adaptor-framework/text-clipboard.cpp index 09da77b..01ea077 100644 --- a/dali/devel-api/adaptor-framework/clipboard.cpp +++ b/dali/devel-api/adaptor-framework/text-clipboard.cpp @@ -16,60 +16,60 @@ */ // CLASS HEADER -#include +#include // INTERNAL INCLUDES -#include +#include namespace Dali { -Clipboard::Clipboard() +TextClipboard::TextClipboard() { } -Clipboard::~Clipboard() +TextClipboard::~TextClipboard() { } -Clipboard::Clipboard(Internal::Adaptor::Clipboard* impl) +TextClipboard::TextClipboard(Internal::Adaptor::TextClipboard* impl) : BaseHandle(impl) { } -Clipboard Clipboard::Get() +TextClipboard TextClipboard::Get() { - return Internal::Adaptor::Clipboard::Get(); + return Internal::Adaptor::TextClipboard::Get(); } -bool Clipboard::IsAvailable() +bool TextClipboard::IsAvailable() { - return Internal::Adaptor::Clipboard::IsAvailable(); + return Internal::Adaptor::TextClipboard::IsAvailable(); } -bool Clipboard::SetItem(const std::string& itemData) +bool TextClipboard::SetItem(const std::string& itemData) { return GetImplementation(*this).SetItem(itemData); } -void Clipboard::RequestItem() +void TextClipboard::RequestItem() { GetImplementation(*this).RequestItem(); } -unsigned int Clipboard::NumberOfItems() +unsigned int TextClipboard::NumberOfItems() { return GetImplementation(*this).NumberOfItems(); } -void Clipboard::ShowClipboard() +void TextClipboard::ShowClipboard() { GetImplementation(*this).ShowClipboard(); } -void Clipboard::HideClipboard() +void TextClipboard::HideClipboard() { GetImplementation(*this).HideClipboard(false); } -bool Clipboard::IsVisible() const +bool TextClipboard::IsVisible() const { return GetImplementation(*this).IsVisible(); } diff --git a/dali/devel-api/adaptor-framework/clipboard.h b/dali/devel-api/adaptor-framework/text-clipboard.h similarity index 83% rename from dali/devel-api/adaptor-framework/clipboard.h rename to dali/devel-api/adaptor-framework/text-clipboard.h index d64e84d..943fc27 100644 --- a/dali/devel-api/adaptor-framework/clipboard.h +++ b/dali/devel-api/adaptor-framework/text-clipboard.h @@ -1,5 +1,5 @@ -#ifndef DALI_CLIPBOARD_H -#define DALI_CLIPBOARD_H +#ifndef DALI_TEXT_CLIPBOARD_H +#define DALI_TEXT_CLIPBOARD_H /* * Copyright (c) 2023 Samsung Electronics Co., Ltd. @@ -31,7 +31,7 @@ namespace Internal DALI_INTERNAL { namespace Adaptor { -class Clipboard; +class TextClipboard; } } // namespace DALI_INTERNAL @@ -41,7 +41,7 @@ class Clipboard; * Clipboard can manage it's item and set show / hide status. */ -class DALI_ADAPTOR_API Clipboard : public BaseHandle +class DALI_ADAPTOR_API TextClipboard : public BaseHandle { public: /** @@ -49,28 +49,28 @@ public: * * this can be initialized with one of the derived Clipboard' New() methods */ - Clipboard(); + TextClipboard(); /** * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. */ - ~Clipboard(); + ~TextClipboard(); /** * @brief This constructor is used by Adaptor::GetClipboard(). * * @param[in] clipboard A pointer to the clipboard. */ - explicit DALI_INTERNAL Clipboard(Internal::Adaptor::Clipboard* clipboard); + explicit DALI_INTERNAL TextClipboard(Internal::Adaptor::TextClipboard* clipboard); /** - * @brief Retrieve a handle to the ClipboardEventNotifier instance. + * @brief Retrieve a handle to the TextClipboardEventNotifier instance. * - * @return A handle to the Clipboard + * @return A handle to the TextClipboard */ - static Clipboard Get(); + static TextClipboard Get(); /** * @brief Checks whether the clipboard is available. @@ -91,7 +91,7 @@ public: * @brief Request clipboard service to retrieve an item * * Calling this method will trigger a signal from the clipboard event notifier. - * @see Dali::ClipboardEventNotifier::ContentSelectedSignal() + * @see Dali::TextClipboardEventNotifier::ContentSelectedSignal() */ void RequestItem(); @@ -120,4 +120,4 @@ public: }; } // namespace Dali -#endif // DALI_CLIPBOARD_H +#endif // DALI_TEXT_CLIPBOARD_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 1b9c636..b357dc9 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -17,8 +17,8 @@ SET( devel_api_src_files ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.cpp ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp ${adaptor_devel_api_dir}/adaptor-framework/capture-devel.cpp - ${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp - ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp + ${adaptor_devel_api_dir}/adaptor-framework/text-clipboard.cpp + ${adaptor_devel_api_dir}/adaptor-framework/text-clipboard-event-notifier.cpp ${adaptor_devel_api_dir}/adaptor-framework/drag-and-drop.cpp ${adaptor_devel_api_dir}/adaptor-framework/color-controller.cpp ${adaptor_devel_api_dir}/adaptor-framework/environment-variable.cpp @@ -66,8 +66,8 @@ SET( devel_api_adaptor_framework_header_files ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h ${adaptor_devel_api_dir}/adaptor-framework/capture-devel.h - ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h - ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h + ${adaptor_devel_api_dir}/adaptor-framework/text-clipboard-event-notifier.h + ${adaptor_devel_api_dir}/adaptor-framework/text-clipboard.h ${adaptor_devel_api_dir}/adaptor-framework/drag-and-drop.h ${adaptor_devel_api_dir}/adaptor-framework/color-controller-plugin.h ${adaptor_devel_api_dir}/adaptor-framework/color-controller.h diff --git a/dali/internal/accessibility/bridge/bridge-editable-text.cpp b/dali/internal/accessibility/bridge/bridge-editable-text.cpp index 034885a..f258e96 100644 --- a/dali/internal/accessibility/bridge/bridge-editable-text.cpp +++ b/dali/internal/accessibility/bridge/bridge-editable-text.cpp @@ -19,7 +19,7 @@ #include // INTERNAL INCLUDES -#include +#include using namespace Dali::Accessibility; @@ -64,7 +64,7 @@ DBus::ValueOrError BridgeEditableText::PasteText(int32_t position) { // auto imfManager = Dali::Internal::Adaptor::ImfManager::Get(); // imfManager.SetCursorPosition( position ); - // auto clipboard = Dali::Internal::Adaptor::Clipboard::Get(); + // auto clipboard = Dali::Internal::Adaptor::TextClipboard::Get(); // clipboard.RequestItem(); // return true; return false; diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 2ecd85e..8d4d271 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include #include diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index 9dac438..1f68c22 100644 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -28,7 +28,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include #include diff --git a/dali/internal/clipboard/file.list b/dali/internal/clipboard/file.list deleted file mode 100644 index 25aa317..0000000 --- a/dali/internal/clipboard/file.list +++ /dev/null @@ -1,40 +0,0 @@ - -# module: clipboard, backend: common -SET( adaptor_clipboard_common_src_files - ${adaptor_clipboard_dir}/common/clipboard-event-notifier-impl.cpp -) - -# module: clipboard, backend: tizen-wayland -SET( adaptor_clipboard_tizen_wayland_src_files - ${adaptor_clipboard_dir}/tizen-wayland/clipboard-impl-ecore-wl.cpp -) - -# module: clipboard, backend: ubuntu-x11 -SET( adaptor_clipboard_ubuntu_x11_src_files - ${adaptor_clipboard_dir}/ubuntu-x11/clipboard-impl-x.cpp -) - -# module: clipboard, backend: android -SET( adaptor_clipboard_android_src_files - ${adaptor_clipboard_dir}/generic/clipboard-impl-generic.cpp -) - -# module: clipboard, backend: windows -SET( adaptor_clipboard_windows_src_files - ${adaptor_clipboard_dir}/generic/clipboard-impl-generic.cpp -) - -# module: clipboard, backend: macos -SET( adaptor_clipboard_macos_src_files - ${adaptor_clipboard_dir}/generic/clipboard-impl-generic.cpp -) - -# module: clipboard, backend: libuv-x11 -SET( adaptor_clipboard_libuv_x11_src_files - ${adaptor_clipboard_dir}/generic/clipboard-impl-generic.cpp -) - -# module: clipboard, backend: glib-x11 -SET( adaptor_clipboard_glib_x11_src_files - ${adaptor_clipboard_dir}/generic/clipboard-impl-generic.cpp -) diff --git a/dali/internal/clipboard/common/clipboard-event-notifier-impl.cpp b/dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.cpp similarity index 56% rename from dali/internal/clipboard/common/clipboard-event-notifier-impl.cpp rename to dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.cpp index f3cdca0..4a0e472 100644 --- a/dali/internal/clipboard/common/clipboard-event-notifier-impl.cpp +++ b/dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 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. @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES #include @@ -28,30 +28,30 @@ namespace Internal { namespace Adaptor { -Dali::ClipboardEventNotifier ClipboardEventNotifier::New() +Dali::TextClipboardEventNotifier TextClipboardEventNotifier::New() { - Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier()); + Dali::TextClipboardEventNotifier notifier = Dali::TextClipboardEventNotifier(new TextClipboardEventNotifier()); return notifier; } -Dali::ClipboardEventNotifier ClipboardEventNotifier::Get() +Dali::TextClipboardEventNotifier TextClipboardEventNotifier::Get() { - Dali::ClipboardEventNotifier notifier; + Dali::TextClipboardEventNotifier notifier; Dali::SingletonService service(SingletonService::Get()); if(service) { // Check whether the singleton is already created - Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::ClipboardEventNotifier)); + Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::TextClipboardEventNotifier)); if(handle) { // If so, downcast the handle - notifier = Dali::ClipboardEventNotifier(dynamic_cast(handle.GetObjectPtr())); + notifier = Dali::TextClipboardEventNotifier(dynamic_cast(handle.GetObjectPtr())); } else { - notifier = Dali::ClipboardEventNotifier(ClipboardEventNotifier::New()); + notifier = Dali::TextClipboardEventNotifier(TextClipboardEventNotifier::New()); service.Register(typeid(notifier), notifier); } } @@ -59,36 +59,36 @@ Dali::ClipboardEventNotifier ClipboardEventNotifier::Get() return notifier; } -const std::string& ClipboardEventNotifier::GetContent() const +const std::string& TextClipboardEventNotifier::GetContent() const { return mContent; } -void ClipboardEventNotifier::SetContent(const std::string& content) +void TextClipboardEventNotifier::SetContent(const std::string& content) { mContent = content; } -void ClipboardEventNotifier::ClearContent() +void TextClipboardEventNotifier::ClearContent() { mContent.clear(); } -void ClipboardEventNotifier::EmitContentSelectedSignal() +void TextClipboardEventNotifier::EmitContentSelectedSignal() { if(!mContentSelectedSignal.Empty()) { - Dali::ClipboardEventNotifier handle(this); + Dali::TextClipboardEventNotifier handle(this); mContentSelectedSignal.Emit(handle); } } -ClipboardEventNotifier::ClipboardEventNotifier() +TextClipboardEventNotifier::TextClipboardEventNotifier() : mContent() { } -ClipboardEventNotifier::~ClipboardEventNotifier() +TextClipboardEventNotifier::~TextClipboardEventNotifier() { } diff --git a/dali/internal/clipboard/common/clipboard-event-notifier-impl.h b/dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.h similarity index 50% rename from dali/internal/clipboard/common/clipboard-event-notifier-impl.h rename to dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.h index 8e21031..04e2733 100644 --- a/dali/internal/clipboard/common/clipboard-event-notifier-impl.h +++ b/dali/internal/text-clipboard/common/text-clipboard-event-notifier-impl.h @@ -1,8 +1,8 @@ -#ifndef DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H -#define DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H +#ifndef DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_H +#define DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_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. @@ -24,7 +24,7 @@ #include // INTERNAL INCLUDES -#include +#include #include namespace Dali @@ -34,30 +34,30 @@ namespace Internal namespace Adaptor { /** - * This class listens to Clipboard events. + * This class listens to TextClipboard events. */ -class ClipboardEventNotifier : public Dali::BaseObject +class TextClipboardEventNotifier : public Dali::BaseObject { public: - typedef Dali::ClipboardEventNotifier::ClipboardEventSignalType ClipboardEventSignalType; + typedef Dali::TextClipboardEventNotifier::TextClipboardEventSignalType TextClipboardEventSignalType; // Creation /** - * Create a ClipboardEventNotifier. - * @return A newly allocated clipboard-event-notifier. + * Create a TextClipboardEventNotifier. + * @return A newly allocated text-clipboard-event-notifier. */ - static Dali::ClipboardEventNotifier New(); + static Dali::TextClipboardEventNotifier New(); /** - * @copydoc Dali::ClipboardEventNotifier::Get() + * @copydoc Dali::TextClipboardEventNotifier::Get() */ - static Dali::ClipboardEventNotifier Get(); + static Dali::TextClipboardEventNotifier Get(); // Public API /** - * @copydoc Dali::ClipboardEventNotifier::GetContent() const + * @copydoc Dali::TextClipboardEventNotifier::GetContent() const */ const std::string& GetContent() const; @@ -79,9 +79,9 @@ public: public: // Signals /** - * @copydoc Dali::ClipboardEventNotifier::ContentSelectedSignal + * @copydoc Dali::TextClipboardEventNotifier::ContentSelectedSignal */ - ClipboardEventSignalType& ContentSelectedSignal() + TextClipboardEventSignalType& ContentSelectedSignal() { return mContentSelectedSignal; } @@ -92,41 +92,41 @@ private: /** * Constructor. */ - ClipboardEventNotifier(); + TextClipboardEventNotifier(); /** * Destructor. */ - ~ClipboardEventNotifier() override; + ~TextClipboardEventNotifier() override; // Undefined - ClipboardEventNotifier(const ClipboardEventNotifier&); - ClipboardEventNotifier& operator=(ClipboardEventNotifier&); + TextClipboardEventNotifier(const TextClipboardEventNotifier&); + TextClipboardEventNotifier& operator=(TextClipboardEventNotifier&); private: std::string mContent; ///< The current selected content. - ClipboardEventSignalType mContentSelectedSignal; + TextClipboardEventSignalType mContentSelectedSignal; public: // Helpers for public-api forwarding methods - inline static Internal::Adaptor::ClipboardEventNotifier& GetImplementation(Dali::ClipboardEventNotifier& detector) + inline static Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(Dali::TextClipboardEventNotifier& detector) { - DALI_ASSERT_ALWAYS(detector && "ClipboardEventNotifier handle is empty"); + DALI_ASSERT_ALWAYS(detector && "TextClipboardEventNotifier handle is empty"); BaseObject& handle = detector.GetBaseObject(); - return static_cast(handle); + return static_cast(handle); } - inline static const Internal::Adaptor::ClipboardEventNotifier& GetImplementation(const Dali::ClipboardEventNotifier& detector) + inline static const Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(const Dali::TextClipboardEventNotifier& detector) { - DALI_ASSERT_ALWAYS(detector && "ClipboardEventNotifier handle is empty"); + DALI_ASSERT_ALWAYS(detector && "TextClipboardEventNotifier handle is empty"); const BaseObject& handle = detector.GetBaseObject(); - return static_cast(handle); + return static_cast(handle); } }; @@ -136,4 +136,4 @@ public: } // namespace Dali -#endif // DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H +#endif // DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_H diff --git a/dali/internal/clipboard/common/clipboard-impl.h b/dali/internal/text-clipboard/common/text-clipboard-impl.h similarity index 60% rename from dali/internal/clipboard/common/clipboard-impl.h rename to dali/internal/text-clipboard/common/text-clipboard-impl.h index eeaae38..44a2acd 100644 --- a/dali/internal/clipboard/common/clipboard-impl.h +++ b/dali/internal/text-clipboard/common/text-clipboard-impl.h @@ -1,5 +1,5 @@ -#ifndef DALI_INTERNAL_CLIPBOARD_H -#define DALI_INTERNAL_CLIPBOARD_H +#ifndef DALI_INTERNAL_TEXT_CLIPBOARD_H +#define DALI_INTERNAL_TEXT_CLIPBOARD_H /* * Copyright (c) 2023 Samsung Electronics Co., Ltd. @@ -22,7 +22,7 @@ #include // INTERNAL INCLUDES -#include +#include namespace Dali { @@ -34,19 +34,19 @@ namespace Adaptor * Implementation of the Clip Board */ -class Clipboard : public Dali::BaseObject +class TextClipboard : public Dali::BaseObject { public: // Hide the specific windowing system struct Impl; /** - * @copydoc Dali::Clipboard::Get() + * @copydoc Dali::TextClipboard::Get() */ - static Dali::Clipboard Get(); + static Dali::TextClipboard Get(); /** - * @copydoc Dali::Clipboard::IsAvailable() + * @copydoc Dali::TextClipboard::IsAvailable() */ static bool IsAvailable(); @@ -54,40 +54,40 @@ public: * Constructor * @param[in] impl Some data from a specific windowing system. */ - Clipboard(Impl* impl); + TextClipboard(Impl* impl); /** * Destructor */ - ~Clipboard() override; + ~TextClipboard() override; /** - * @copydoc Dali::Clipboard::SetItem() + * @copydoc Dali::TextClipboard::SetItem() */ bool SetItem(const std::string& itemData); /** - * @copydoc Dali::Clipboard::RequestItem() + * @copydoc Dali::TextClipboard::RequestItem() */ void RequestItem(); /** - * @copydoc Dali::Clipboard::NumberOfClipboardItems() + * @copydoc Dali::TextClipboard::NumberOfClipboardItems() */ unsigned int NumberOfItems(); /** - * @copydoc Dali::Clipboard::ShowClipboard() + * @copydoc Dali::TextClipboard::ShowClipboard() */ void ShowClipboard(); /** - * @copydoc Dali::Clipboard::HideClipboard() + * @copydoc Dali::TextClipboard::HideClipboard() */ void HideClipboard(bool skipFirstHide); /** - * @copydoc Dali::Clipboard::IsVisible() + * @copydoc Dali::TextClipboard::IsVisible() */ bool IsVisible() const; @@ -109,33 +109,33 @@ public: private: // Undefined - Clipboard(const Clipboard&); - Clipboard& operator=(Clipboard&); + TextClipboard(const TextClipboard&); + TextClipboard& operator=(TextClipboard&); private: Impl* mImpl; public: -}; // class clipboard +}; // class TextClipboard } // namespace Adaptor } // namespace Internal -inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard) +inline static Internal::Adaptor::TextClipboard& GetImplementation(Dali::TextClipboard& clipboard) { - DALI_ASSERT_ALWAYS(clipboard && "Clipboard handle is empty"); + DALI_ASSERT_ALWAYS(clipboard && "TextClipboard handle is empty"); BaseObject& handle = clipboard.GetBaseObject(); - return static_cast(handle); + return static_cast(handle); } -inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard) +inline static const Internal::Adaptor::TextClipboard& GetImplementation(const Dali::TextClipboard& clipboard) { - DALI_ASSERT_ALWAYS(clipboard && "Clipboard handle is empty"); + DALI_ASSERT_ALWAYS(clipboard && "TextClipboard handle is empty"); const BaseObject& handle = clipboard.GetBaseObject(); - return static_cast(handle); + return static_cast(handle); } } // namespace Dali -#endif // DALI_INTERNAL_CLIPBOARD_H +#endif // DALI_INTERNAL_TEXT_CLIPBOARD_H diff --git a/dali/internal/text-clipboard/file.list b/dali/internal/text-clipboard/file.list new file mode 100644 index 0000000..8bde616 --- /dev/null +++ b/dali/internal/text-clipboard/file.list @@ -0,0 +1,40 @@ + +# module: text-clipboard, backend: common +SET( adaptor_text_clipboard_common_src_files + ${adaptor_text_clipboard_dir}/common/text-clipboard-event-notifier-impl.cpp +) + +# module: text-clipboard, backend: tizen-wayland +SET( adaptor_text_clipboard_tizen_wayland_src_files + ${adaptor_text_clipboard_dir}/tizen-wayland/text-clipboard-impl-ecore-wl.cpp +) + +# module: text-clipboard, backend: ubuntu-x11 +SET( adaptor_text_clipboard_ubuntu_x11_src_files + ${adaptor_text_clipboard_dir}/ubuntu-x11/text-clipboard-impl-x.cpp +) + +# module: text-clipboard, backend: android +SET( adaptor_text_clipboard_android_src_files + ${adaptor_text_clipboard_dir}/generic/text-clipboard-impl-generic.cpp +) + +# module: text-clipboard, backend: windows +SET( adaptor_text_clipboard_windows_src_files + ${adaptor_text_clipboard_dir}/generic/text-clipboard-impl-generic.cpp +) + +# module: text-clipboard, backend: macos +SET( adaptor_text_clipboard_macos_src_files + ${adaptor_text_clipboard_dir}/generic/text-clipboard-impl-generic.cpp +) + +# module: text-clipboard, backend: libuv-x11 +SET( adaptor_text_clipboard_libuv_x11_src_files + ${adaptor_text_clipboard_dir}/generic/text-clipboard-impl-generic.cpp +) + +# module: text-clipboard, backend: glib-x11 +SET( adaptor_text_clipboard_glib_x11_src_files + ${adaptor_text_clipboard_dir}/generic/text-clipboard-impl-generic.cpp +) diff --git a/dali/internal/clipboard/generic/clipboard-impl-generic.cpp b/dali/internal/text-clipboard/generic/text-clipboard-impl-generic.cpp similarity index 60% rename from dali/internal/clipboard/generic/clipboard-impl-generic.cpp rename to dali/internal/text-clipboard/generic/text-clipboard-impl-generic.cpp index 74b911e..0a742d5 100644 --- a/dali/internal/clipboard/generic/clipboard-impl-generic.cpp +++ b/dali/internal/text-clipboard/generic/text-clipboard-impl-generic.cpp @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // INTERNAL INCLUDES #include @@ -27,50 +27,50 @@ namespace Internal { namespace Adaptor { -struct Clipboard::Impl +struct TextClipboard::Impl { }; -Clipboard::Clipboard(Impl* impl) +TextClipboard::TextClipboard(Impl* impl) : mImpl(impl) { } -Clipboard::~Clipboard() +TextClipboard::~TextClipboard() { } -Dali::Clipboard Clipboard::Get() +Dali::TextClipboard TextClipboard::Get() { - Dali::Clipboard clipboard; + Dali::TextClipboard clipboard; 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::TextClipboard)); if(handle) { // If so, downcast the handle - clipboard = Dali::Clipboard(dynamic_cast(handle.GetObjectPtr())); + clipboard = Dali::TextClipboard(dynamic_cast(handle.GetObjectPtr())); } else { - Clipboard::Impl* impl(new Clipboard::Impl()); - clipboard = Dali::Clipboard(new Clipboard(impl)); - service.Register(typeid(Dali::Clipboard), clipboard); + TextClipboard::Impl* impl(new TextClipboard::Impl()); + clipboard = Dali::TextClipboard(new TextClipboard(impl)); + service.Register(typeid(Dali::TextClipboard), clipboard); } } return clipboard; } -bool Clipboard::IsAvailable() +bool TextClipboard::IsAvailable() { Dali::SingletonService service(SingletonService::Get()); if(service) { - Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::Clipboard)); + Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::TextClipboard)); if(handle) { return true; @@ -79,38 +79,38 @@ bool Clipboard::IsAvailable() return false; } -bool Clipboard::SetItem(const std::string& itemData) +bool TextClipboard::SetItem(const std::string& itemData) { return true; } -void Clipboard::RequestItem() +void TextClipboard::RequestItem() { } -unsigned int Clipboard::NumberOfItems() +unsigned int TextClipboard::NumberOfItems() { return 0u; } -void Clipboard::ShowClipboard() +void TextClipboard::ShowClipboard() { } -void Clipboard::HideClipboard(bool skipFirstHide) +void TextClipboard::HideClipboard(bool skipFirstHide) { } -bool Clipboard::IsVisible() const +bool TextClipboard::IsVisible() const { return false; } -void Clipboard::ExcuteSend(void* event) +void TextClipboard::ExcuteSend(void* event) { } -void Clipboard::ExcuteReceive(void* event, char*& data, int& length) +void TextClipboard::ExcuteReceive(void* event, char*& data, int& length) { } diff --git a/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp b/dali/internal/text-clipboard/tizen-wayland/text-clipboard-impl-ecore-wl.cpp similarity index 88% rename from dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp rename to dali/internal/text-clipboard/tizen-wayland/text-clipboard-impl-ecore-wl.cpp index c3dc462..7e84811 100644 --- a/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp +++ b/dali/internal/text-clipboard/tizen-wayland/text-clipboard-impl-ecore-wl.cpp @@ -16,8 +16,8 @@ */ // CLASS HEADER -#include -#include +#include +#include // EXTERNAL INCLUDES #include @@ -45,7 +45,7 @@ #define CBHM_COUNT_ALL 0 // ATOM_INDEX_CBHM_COUNT_ALL /////////////////////////////////////////////////////////////////////////////////////////////////// -// Clipboard +// TextClipboard /////////////////////////////////////////////////////////////////////////////////////////////////// namespace Dali @@ -54,7 +54,7 @@ namespace Internal { namespace Adaptor { -struct Clipboard::Impl +struct TextClipboard::Impl { Impl() { @@ -259,7 +259,7 @@ struct Clipboard::Impl #ifdef DALI_ELDBUS_AVAILABLE static void _on_item_clicked(void* data, const Eldbus_Message* msg EINA_UNUSED) { - static_cast(data)->RequestItem(); + static_cast(data)->RequestItem(); } Eldbus_Proxy* eldbus_proxy; @@ -272,47 +272,47 @@ struct Clipboard::Impl uint32_t mSerial{0u}; }; -Clipboard::Clipboard(Impl* impl) +TextClipboard::TextClipboard(Impl* impl) : mImpl(impl) { } -Clipboard::~Clipboard() +TextClipboard::~TextClipboard() { delete mImpl; } -Dali::Clipboard Clipboard::Get() +Dali::TextClipboard TextClipboard::Get() { - Dali::Clipboard clipboard; + Dali::TextClipboard clipboard; 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::TextClipboard)); if(handle) { // If so, downcast the handle - clipboard = Dali::Clipboard(dynamic_cast(handle.GetObjectPtr())); + clipboard = Dali::TextClipboard(dynamic_cast(handle.GetObjectPtr())); } else { - Clipboard::Impl* impl(new Clipboard::Impl()); - clipboard = Dali::Clipboard(new Clipboard(impl)); - service.Register(typeid(Dali::Clipboard), clipboard); + TextClipboard::Impl* impl(new TextClipboard::Impl()); + clipboard = Dali::TextClipboard(new TextClipboard(impl)); + service.Register(typeid(Dali::TextClipboard), clipboard); } } return clipboard; } -bool Clipboard::IsAvailable() +bool TextClipboard::IsAvailable() { Dali::SingletonService service(SingletonService::Get()); if(service) { - Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::Clipboard)); + Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::TextClipboard)); if(handle) { return true; @@ -321,7 +321,7 @@ bool Clipboard::IsAvailable() return false; } -bool Clipboard::SetItem(const std::string& itemData) +bool TextClipboard::SetItem(const std::string& itemData) { mImpl->SetItem(itemData); return true; @@ -330,7 +330,7 @@ bool Clipboard::SetItem(const std::string& itemData) /* * Request clipboard service to give an item */ -void Clipboard::RequestItem() +void TextClipboard::RequestItem() { mImpl->RequestItem(); } @@ -338,33 +338,33 @@ void Clipboard::RequestItem() /* * Get number of items in clipboard */ -unsigned int Clipboard::NumberOfItems() +unsigned int TextClipboard::NumberOfItems() { int count = mImpl->GetCount(); return (count < 0 ? 0 : count); } -void Clipboard::ShowClipboard() +void TextClipboard::ShowClipboard() { mImpl->ShowClipboard(); } -void Clipboard::HideClipboard(bool skipFirstHide) +void TextClipboard::HideClipboard(bool skipFirstHide) { mImpl->HideClipboard(skipFirstHide); } -bool Clipboard::IsVisible() const +bool TextClipboard::IsVisible() const { return mImpl->IsVisible(); } -void Clipboard::ExcuteSend(void* event) +void TextClipboard::ExcuteSend(void* event) { mImpl->ExcuteSend(event); } -void Clipboard::ExcuteReceive(void* event, char*& data, int& length) +void TextClipboard::ExcuteReceive(void* event, char*& data, int& length) { mImpl->ExcuteReceive(event, data, length); } diff --git a/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp b/dali/internal/text-clipboard/ubuntu-x11/text-clipboard-impl-x.cpp similarity index 83% rename from dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp rename to dali/internal/text-clipboard/ubuntu-x11/text-clipboard-impl-x.cpp index 807f9db..7df31ad 100644 --- a/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp +++ b/dali/internal/text-clipboard/ubuntu-x11/text-clipboard-impl-x.cpp @@ -16,7 +16,7 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES #include @@ -27,7 +27,7 @@ // INTERNAL INCLUDES #include #include -#include +#include #include namespace //unnamed namespace @@ -43,7 +43,7 @@ const char* const HIDE = "cbhm_hide"; } // namespace /////////////////////////////////////////////////////////////////////////////////////////////////// -// Clipboard +// TextClipboard /////////////////////////////////////////////////////////////////////////////////////////////////// namespace Dali @@ -52,7 +52,7 @@ namespace Internal { namespace Adaptor { -struct Clipboard::Impl +struct TextClipboard::Impl { Impl(Ecore_X_Window ecoreXwin) { @@ -62,29 +62,29 @@ struct Clipboard::Impl Ecore_X_Window mApplicationWindow; }; -Clipboard::Clipboard(Impl* impl) +TextClipboard::TextClipboard(Impl* impl) : mImpl(impl) { } -Clipboard::~Clipboard() +TextClipboard::~TextClipboard() { delete mImpl; } -Dali::Clipboard Clipboard::Get() +Dali::TextClipboard TextClipboard::Get() { - Dali::Clipboard clipboard; + Dali::TextClipboard clipboard; 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::TextClipboard)); if(handle) { // If so, downcast the handle - clipboard = Dali::Clipboard(dynamic_cast(handle.GetObjectPtr())); + clipboard = Dali::TextClipboard(dynamic_cast(handle.GetObjectPtr())); } else { @@ -99,8 +99,8 @@ Dali::Clipboard Clipboard::Get() // If we fail to get Ecore_X_Window, we can't use the Clipboard correctly. // Thus you have to call "ecore_imf_context_client_window_set" somewhere. // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent(). - Clipboard::Impl* impl(new Clipboard::Impl(ecoreXwin)); - clipboard = Dali::Clipboard(new Clipboard(impl)); + TextClipboard::Impl* impl(new TextClipboard::Impl(ecoreXwin)); + clipboard = Dali::TextClipboard(new TextClipboard(impl)); service.Register(typeid(clipboard), clipboard); } } @@ -109,12 +109,12 @@ Dali::Clipboard Clipboard::Get() return clipboard; } -bool Clipboard::IsAvailable() +bool TextClipboard::IsAvailable() { Dali::SingletonService service(SingletonService::Get()); if(service) { - Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::Clipboard)); + Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::TextClipboard)); if(handle) { return true; @@ -123,7 +123,7 @@ bool Clipboard::IsAvailable() return false; } -bool Clipboard::SetItem(const std::string& itemData) +bool TextClipboard::SetItem(const std::string& itemData) { Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow(); Ecore_X_Atom atomCbhmItem = ecore_x_atom_get(CBHM_ITEM); @@ -142,7 +142,7 @@ bool Clipboard::SetItem(const std::string& itemData) /* * Request clipboard service to retrieve an item */ -void Clipboard::RequestItem() +void TextClipboard::RequestItem() { int index = 0; char sendBuf[20]; @@ -159,11 +159,11 @@ void Clipboard::RequestItem() Ecore_X_Atom xAtomCbhmError = ecore_x_atom_get(CBHM_ERROR); if(xAtomItemType != xAtomCbhmError) { - // Call ClipboardEventNotifier to notify event observe of retrieved string - Dali::ClipboardEventNotifier clipboardEventNotifier(ClipboardEventNotifier::Get()); + // Call TextClipboardEventNotifier to notify event observe of retrieved string + Dali::TextClipboardEventNotifier clipboardEventNotifier(TextClipboardEventNotifier::Get()); if(clipboardEventNotifier) { - ClipboardEventNotifier& notifierImpl(ClipboardEventNotifier::GetImplementation(clipboardEventNotifier)); + TextClipboardEventNotifier& notifierImpl(TextClipboardEventNotifier::GetImplementation(clipboardEventNotifier)); notifierImpl.SetContent(clipboardString); notifierImpl.EmitContentSelectedSignal(); @@ -175,7 +175,7 @@ void Clipboard::RequestItem() /* * Get number of items in clipboard */ -unsigned int Clipboard::NumberOfItems() +unsigned int TextClipboard::NumberOfItems() { Ecore_X_Atom xAtomCbhmCountGet = ecore_x_atom_get(CBHM_cCOUNT); @@ -195,7 +195,7 @@ unsigned int Clipboard::NumberOfItems() * Function to send message to show the Clipboard (cbhm) as no direct API available * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c */ -void Clipboard::ShowClipboard() +void TextClipboard::ShowClipboard() { // Claim the ownership of the SECONDARY selection. ecore_x_selection_secondary_set(mImpl->mApplicationWindow, "", 1); @@ -206,7 +206,7 @@ void Clipboard::ShowClipboard() ECore::WindowInterface::SendXEvent(ecore_x_display_get(), cbhmWin, False, NoEventMask, atomCbhmMsg, 8, SHOW); } -void Clipboard::HideClipboard(bool skipFirstHide) +void TextClipboard::HideClipboard(bool skipFirstHide) { Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow(); // Launch the clipboard window @@ -217,16 +217,16 @@ void Clipboard::HideClipboard(bool skipFirstHide) ecore_x_selection_secondary_clear(); } -bool Clipboard::IsVisible() const +bool TextClipboard::IsVisible() const { return false; } -void Clipboard::ExcuteSend(void* event) +void TextClipboard::ExcuteSend(void* event) { } -void Clipboard::ExcuteReceive(void* event, char*& data, int& length) +void TextClipboard::ExcuteReceive(void* event, char*& data, int& length) { // Receive Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast(event); diff --git a/dali/internal/window-system/common/event-handler.cpp b/dali/internal/window-system/common/event-handler.cpp index 397fcb3..06fd15f 100644 --- a/dali/internal/window-system/common/event-handler.cpp +++ b/dali/internal/window-system/common/event-handler.cpp @@ -32,7 +32,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include @@ -126,11 +126,11 @@ void EventHandler::OnKeyEvent(Integration::KeyEvent& keyEvent) void EventHandler::OnFocusChanged(bool focusIn) { // If the window gains focus and we hid the keyboard then show it again. - if(Clipboard::IsAvailable()) + if(TextClipboard::IsAvailable()) { if(focusIn) { - Dali::Clipboard clipboard = Clipboard::Get(); + Dali::TextClipboard clipboard = TextClipboard::Get(); if(clipboard) { clipboard.HideClipboard(); @@ -139,10 +139,10 @@ void EventHandler::OnFocusChanged(bool focusIn) else { // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard - Dali::Clipboard clipboard = Clipboard::Get(); + Dali::TextClipboard clipboard = TextClipboard::Get(); if(clipboard) { - Clipboard& clipBoardImpl(GetImplementation(clipboard)); + TextClipboard& clipBoardImpl(GetImplementation(clipboard)); clipBoardImpl.HideClipboard(true); } } @@ -164,10 +164,10 @@ void EventHandler::OnWindowDamaged(const DamageArea& area) void EventHandler::OnSelectionDataSend(void* event) { - Dali::Clipboard clipboard = Clipboard::Get(); + Dali::TextClipboard clipboard = TextClipboard::Get(); if(clipboard) { - Clipboard& clipBoardImpl(GetImplementation(clipboard)); + TextClipboard& clipBoardImpl(GetImplementation(clipboard)); clipBoardImpl.ExcuteSend(event); } } @@ -175,26 +175,26 @@ void EventHandler::OnSelectionDataSend(void* event) void EventHandler::OnSelectionDataReceived(void* event) { // We have got the selected content, inform the clipboard event listener (if we have one). - Dali::Clipboard clipboard = Clipboard::Get(); - char* selectionData = NULL; - size_t dataLength = 0u; + Dali::TextClipboard clipboard = TextClipboard::Get(); + char* selectionData = NULL; + size_t dataLength = 0u; if(clipboard) { int len = 0; - Clipboard& clipBoardImpl(GetImplementation(clipboard)); + TextClipboard& clipBoardImpl(GetImplementation(clipboard)); clipBoardImpl.ExcuteReceive(event, selectionData, len); dataLength = static_cast(len); } if(!mClipboardEventNotifier) { - mClipboardEventNotifier = ClipboardEventNotifier::Get(); + mClipboardEventNotifier = TextClipboardEventNotifier::Get(); } if(selectionData && mClipboardEventNotifier && dataLength > 0) { - ClipboardEventNotifier& clipboardEventNotifier(ClipboardEventNotifier::GetImplementation(mClipboardEventNotifier)); + TextClipboardEventNotifier& clipboardEventNotifier(TextClipboardEventNotifier::GetImplementation(mClipboardEventNotifier)); std::string content; size_t stringLength = strlen(selectionData); diff --git a/dali/internal/window-system/common/event-handler.h b/dali/internal/window-system/common/event-handler.h index b6bf33a..9ad49d1 100644 --- a/dali/internal/window-system/common/event-handler.h +++ b/dali/internal/window-system/common/event-handler.h @@ -22,11 +22,11 @@ #include #include // uint32_t -#include +#include #include // INTERNAL INCLUDES -#include +#include #include #include @@ -209,7 +209,7 @@ private: Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to. DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to. - Dali::ClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier + Dali::TextClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier using ObserverContainer = std::vector; ObserverContainer mObservers; ///< A list of event observer pointers