1 #ifndef DALI_CLIPBOARD_EVENT_NOTIFIER_H
2 #define DALI_CLIPBOARD_EVENT_NOTIFIER_H
5 * Copyright (c) 2020 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/object/base-handle.h>
23 #include <dali/public-api/signals/dali-signal.h>
26 #include <dali/public-api/dali-adaptor-common.h>
30 namespace Internal DALI_INTERNAL
34 class ClipboardEventNotifier;
36 } // namespace DALI_INTERNAL
39 * @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device.
41 class DALI_ADAPTOR_API ClipboardEventNotifier : public BaseHandle
47 * @brief Clipboard event
49 typedef Signal<void(ClipboardEventNotifier&)> ClipboardEventSignalType;
52 * @brief Create an uninitialized handle.
54 * This can be initialized by getting the notifier from Dali::Adaptor.
56 ClipboardEventNotifier();
59 * @brief Retrieve a handle to the ClipboardEventNotifier instance.
61 * @return A handle to the ClipboardEventNotifier
63 static ClipboardEventNotifier Get();
68 * This is non-virtual since derived Handle types must not contain data or virtual methods.
70 ~ClipboardEventNotifier();
73 * @brief Returns the selected content.
74 * @return A reference to the string representing the selected content.
76 const std::string& GetContent() const;
79 * @brief Sets the selected content.
80 * @param[in] content A string that represents the content that has been selected.
82 void SetContent(const std::string& content);
85 * @brief Clears the stored content.
90 * @brief Called when content is selected in the clipboard.
92 void EmitContentSelectedSignal();
96 * @brief This is emitted when content is selected from the clipboard.
98 * A callback of the following type may be connected:
100 * void YourCallback( ClipboardEventNotifier& notifier );
102 * @return The signal to connect to.
104 ClipboardEventSignalType& ContentSelectedSignal();
106 public: // Not intended for application developers
108 * @brief This constructor is used by ClipboardEventNotifier::Get().
110 * @param[in] notifier A pointer to the drag and drop notifier.
112 explicit DALI_INTERNAL ClipboardEventNotifier(Internal::Adaptor::ClipboardEventNotifier* notifier);
117 #endif // DALI_CLIPBOARD_EVENT_NOTIFIER_H