1 #ifndef DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_H
2 #define DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/math/vector2.h>
23 #include <dali/public-api/object/base-object.h>
27 #include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
28 #include <dali/public-api/dali-adaptor-common.h>
37 * This class listens to TextClipboard events.
39 class TextClipboardEventNotifier : public Dali::BaseObject
42 typedef Dali::TextClipboardEventNotifier::TextClipboardEventSignalType TextClipboardEventSignalType;
47 * Create a TextClipboardEventNotifier.
48 * @return A newly allocated text-clipboard-event-notifier.
50 static Dali::TextClipboardEventNotifier New();
53 * @copydoc Dali::TextClipboardEventNotifier::Get()
55 static Dali::TextClipboardEventNotifier Get();
60 * @copydoc Dali::TextClipboardEventNotifier::GetContent() const
62 const std::string& GetContent() const;
65 * Sets the selected content.
66 * @param[in] content A string that represents the content that has been selected.
68 void SetContent(const std::string& content);
71 * Clears the stored content.
76 * Called when content is selected in the clipboard.
78 void EmitContentSelectedSignal();
82 * @copydoc Dali::TextClipboardEventNotifier::ContentSelectedSignal
84 TextClipboardEventSignalType& ContentSelectedSignal()
86 return mContentSelectedSignal;
90 // Construction & Destruction
95 TextClipboardEventNotifier();
100 ~TextClipboardEventNotifier() override;
103 TextClipboardEventNotifier(const TextClipboardEventNotifier&);
104 TextClipboardEventNotifier& operator=(TextClipboardEventNotifier&);
107 std::string mContent; ///< The current selected content.
109 TextClipboardEventSignalType mContentSelectedSignal;
112 // Helpers for public-api forwarding methods
114 inline static Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(Dali::TextClipboardEventNotifier& detector)
116 DALI_ASSERT_ALWAYS(detector && "TextClipboardEventNotifier handle is empty");
118 BaseObject& handle = detector.GetBaseObject();
120 return static_cast<Internal::Adaptor::TextClipboardEventNotifier&>(handle);
123 inline static const Internal::Adaptor::TextClipboardEventNotifier& GetImplementation(const Dali::TextClipboardEventNotifier& detector)
125 DALI_ASSERT_ALWAYS(detector && "TextClipboardEventNotifier handle is empty");
127 const BaseObject& handle = detector.GetBaseObject();
129 return static_cast<const Internal::Adaptor::TextClipboardEventNotifier&>(handle);
133 } // namespace Adaptor
135 } // namespace Internal
139 #endif // DALI_INTERNAL_TEXT_CLIPBOARD_EVENT_NOTIFIER_H