1 #ifndef __DALI_CLIPBOARD_EVENT_NOTIFIER_H__
2 #define __DALI_CLIPBOARD_EVENT_NOTIFIER_H__
5 * Copyright (c) 2014 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 * @addtogroup CAPI_DALI_ADAPTOR_MODULE
27 #include <boost/function.hpp>
29 #include <dali/public-api/object/base-handle.h>
30 #include <dali/public-api/signals/dali-signal-v2.h>
32 namespace Dali DALI_IMPORT_API
35 namespace Internal DALI_INTERNAL
39 class ClipboardEventNotifier;
44 * @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device.
46 class ClipboardEventNotifier : public BaseHandle
53 * @brief Clipboard event
55 typedef SignalV2< void ( ClipboardEventNotifier& ) > ClipboardEventSignalV2;
58 static const char* const SIGNAL_CONTENT_SELECTED; ///< name "content-selected"
61 * @brief Create an uninitialized handle.
63 * This can be initialized by getting the notifier from Dali::Adaptor.
65 ClipboardEventNotifier();
68 * @brief Retrieve a handle to the ClipboardEventNotifier instance.
70 * @return A handle to the ClipboardEventNotifier
72 static ClipboardEventNotifier Get();
75 * @brief Virtual Destructor.
77 virtual ~ClipboardEventNotifier();
80 * @brief Returns the selected content.
81 * @return A reference to the string representing the selected content.
83 const std::string& GetContent() const;
86 * @brief Sets the selected content.
87 * @param[in] content A string that represents the content that has been selected.
89 void SetContent( const std::string& content );
92 * @brief Clears the stored content.
97 * @brief Called when content is selected in the clipboard.
99 void EmitContentSelectedSignal();
104 * @brief This is emitted when content is selected from the clipboard.
106 * A callback of the following type may be connected:
108 * void YourCallback( ClipboardEventNotifier& notifier );
110 * @return The signal to connect to.
112 ClipboardEventSignalV2& ContentSelectedSignal();
114 public: // Not intended for application developers
117 * @brief This constructor is used by ClipboardEventNotifier::Get().
119 * @param[in] notifier A pointer to the drag and drop notifier.
121 ClipboardEventNotifier( Internal::Adaptor::ClipboardEventNotifier* notifier );
129 #endif // __DALI_CLIPBOARD_EVENT_NOTIFIER_H__