1 #ifndef DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H
2 #define DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H
5 * Copyright (c) 2019 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.
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/public-api/math/vector2.h>
27 #include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
28 #include <dali/public-api/dali-adaptor-common.h>
40 * This class listens to Clipboard events.
42 class ClipboardEventNotifier : public Dali::BaseObject
46 typedef Dali::ClipboardEventNotifier::ClipboardEventSignalType ClipboardEventSignalType;
51 * Create a ClipboardEventNotifier.
52 * @return A newly allocated clipboard-event-notifier.
54 static Dali::ClipboardEventNotifier New();
57 * @copydoc Dali::ClipboardEventNotifier::Get()
59 static Dali::ClipboardEventNotifier Get();
64 * @copydoc Dali::ClipboardEventNotifier::GetContent() const
66 const std::string& GetContent() const;
69 * Sets the selected content.
70 * @param[in] content A string that represents the content that has been selected.
72 void SetContent( const std::string& content );
75 * Clears the stored content.
80 * Called when content is selected in the clipboard.
82 void EmitContentSelectedSignal();
87 * @copydoc Dali::ClipboardEventNotifier::ContentSelectedSignal
89 ClipboardEventSignalType& ContentSelectedSignal()
91 return mContentSelectedSignal;
96 // Construction & Destruction
101 ClipboardEventNotifier();
106 ~ClipboardEventNotifier() override;
109 ClipboardEventNotifier( const ClipboardEventNotifier& );
110 ClipboardEventNotifier& operator=( ClipboardEventNotifier& );
114 std::string mContent; ///< The current selected content.
116 ClipboardEventSignalType mContentSelectedSignal;
120 // Helpers for public-api forwarding methods
122 inline static Internal::Adaptor::ClipboardEventNotifier& GetImplementation(Dali::ClipboardEventNotifier& detector)
124 DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
126 BaseObject& handle = detector.GetBaseObject();
128 return static_cast<Internal::Adaptor::ClipboardEventNotifier&>(handle);
131 inline static const Internal::Adaptor::ClipboardEventNotifier& GetImplementation(const Dali::ClipboardEventNotifier& detector)
133 DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
135 const BaseObject& handle = detector.GetBaseObject();
137 return static_cast<const Internal::Adaptor::ClipboardEventNotifier&>(handle);
142 } // namespace Adaptor
144 } // namespace Internal
148 #endif // DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H