1 #ifndef DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H
2 #define DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H
5 * Copyright (c) 2021 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/clipboard-event-notifier.h>
28 #include <dali/public-api/dali-adaptor-common.h>
37 * This class listens to Clipboard events.
39 class ClipboardEventNotifier : public Dali::BaseObject
42 typedef Dali::ClipboardEventNotifier::ClipboardEventSignalType ClipboardEventSignalType;
47 * Create a ClipboardEventNotifier.
48 * @return A newly allocated clipboard-event-notifier.
50 static Dali::ClipboardEventNotifier New();
53 * @copydoc Dali::ClipboardEventNotifier::Get()
55 static Dali::ClipboardEventNotifier Get();
60 * @copydoc Dali::ClipboardEventNotifier::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::ClipboardEventNotifier::ContentSelectedSignal
84 ClipboardEventSignalType& ContentSelectedSignal()
86 return mContentSelectedSignal;
90 // Construction & Destruction
95 ClipboardEventNotifier();
100 ~ClipboardEventNotifier() override;
103 ClipboardEventNotifier(const ClipboardEventNotifier&);
104 ClipboardEventNotifier& operator=(ClipboardEventNotifier&);
107 std::string mContent; ///< The current selected content.
109 ClipboardEventSignalType mContentSelectedSignal;
112 // Helpers for public-api forwarding methods
114 inline static Internal::Adaptor::ClipboardEventNotifier& GetImplementation(Dali::ClipboardEventNotifier& detector)
116 DALI_ASSERT_ALWAYS(detector && "ClipboardEventNotifier handle is empty");
118 BaseObject& handle = detector.GetBaseObject();
120 return static_cast<Internal::Adaptor::ClipboardEventNotifier&>(handle);
123 inline static const Internal::Adaptor::ClipboardEventNotifier& GetImplementation(const Dali::ClipboardEventNotifier& detector)
125 DALI_ASSERT_ALWAYS(detector && "ClipboardEventNotifier handle is empty");
127 const BaseObject& handle = detector.GetBaseObject();
129 return static_cast<const Internal::Adaptor::ClipboardEventNotifier&>(handle);
133 } // namespace Adaptor
135 } // namespace Internal
139 #endif // DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H