1 #ifndef __DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H__
2 #define __DALI_INTERNAL_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.
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/public-api/math/vector2.h>
27 #include <clipboard-event-notifier.h>
39 * This class listens to Clipboard events.
41 class ClipboardEventNotifier : public Dali::BaseObject
45 typedef Dali::ClipboardEventNotifier::ClipboardEventSignalType ClipboardEventSignalType;
50 * Create a ClipboardEventNotifier.
51 * @return A newly allocated clipboard-event-notifier.
53 static Dali::ClipboardEventNotifier New();
56 * @copydoc Dali::ClipboardEventNotifier::Get()
58 static Dali::ClipboardEventNotifier Get();
63 * @copydoc Dali::ClipboardEventNotifier::GetContent() const
65 const std::string& GetContent() const;
68 * Sets the selected content.
69 * @param[in] content A string that represents the content that has been selected.
71 void SetContent( const std::string& content );
74 * Clears the stored content.
79 * Called when content is selected in the clipboard.
81 void EmitContentSelectedSignal();
86 * @copydoc Dali::ClipboardEventNotifier::ContentSelectedSignal
88 ClipboardEventSignalType& ContentSelectedSignal()
90 return mContentSelectedSignal;
95 // Construction & Destruction
100 ClipboardEventNotifier();
105 virtual ~ClipboardEventNotifier();
108 ClipboardEventNotifier( const ClipboardEventNotifier& );
109 ClipboardEventNotifier& operator=( ClipboardEventNotifier& );
113 std::string mContent; ///< The current selected content.
115 ClipboardEventSignalType mContentSelectedSignal;
119 // Helpers for public-api forwarding methods
121 inline static Internal::Adaptor::ClipboardEventNotifier& GetImplementation(Dali::ClipboardEventNotifier& detector)
123 DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
125 BaseObject& handle = detector.GetBaseObject();
127 return static_cast<Internal::Adaptor::ClipboardEventNotifier&>(handle);
130 inline static const Internal::Adaptor::ClipboardEventNotifier& GetImplementation(const Dali::ClipboardEventNotifier& detector)
132 DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
134 const BaseObject& handle = detector.GetBaseObject();
136 return static_cast<const Internal::Adaptor::ClipboardEventNotifier&>(handle);
141 } // namespace Adaptor
143 } // namespace Internal
147 #endif // __DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H__