fd5cfc479adb2a1e6dd8e6e19dcf36491378a4aa
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / clipboard-event-notifier.h
1 #ifndef __DALI_CLIPBOARD_EVENT_NOTIFIER_H__
2 #define __DALI_CLIPBOARD_EVENT_NOTIFIER_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-handle.h>
23 #include <dali/public-api/signals/dali-signal.h>
24
25 namespace Dali
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 namespace Adaptor
31 {
32 class ClipboardEventNotifier;
33 }
34 }
35
36 /**
37  * @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device.
38  */
39 class DALI_IMPORT_API ClipboardEventNotifier : public BaseHandle
40 {
41 public:
42
43   // Typedefs
44
45   /**
46    * @brief Clipboard event
47    */
48   typedef Signal< void ( ClipboardEventNotifier& ) > ClipboardEventSignalType;
49
50   /**
51    * @brief Create an uninitialized handle.
52    *
53    * This can be initialized by getting the notifier from Dali::Adaptor.
54    */
55   ClipboardEventNotifier();
56
57   /**
58    * @brief Retrieve a handle to the ClipboardEventNotifier instance.
59    *
60    * @return A handle to the ClipboardEventNotifier
61    */
62   static ClipboardEventNotifier Get();
63
64   /**
65    * @brief Destructor
66    *
67    * This is non-virtual since derived Handle types must not contain data or virtual methods.
68    */
69   ~ClipboardEventNotifier();
70
71   /**
72    * @brief Returns the selected content.
73    * @return A reference to the string representing the selected content.
74    */
75   const std::string& GetContent() const;
76
77   /**
78    * @brief Sets the selected content.
79    * @param[in] content  A string that represents the content that has been selected.
80    */
81   void SetContent( const std::string& content );
82
83   /**
84    * @brief Clears the stored content.
85    */
86   void ClearContent();
87
88   /**
89    * @brief Called when content is selected in the clipboard.
90    */
91   void EmitContentSelectedSignal();
92
93 public:  // Signals
94
95   /**
96    * @brief This is emitted when content is selected from the clipboard.
97    *
98    * A callback of the following type may be connected:
99    * @code
100    *   void YourCallback( ClipboardEventNotifier& notifier );
101    * @endcode
102    * @return The signal to connect to.
103    */
104   ClipboardEventSignalType& ContentSelectedSignal();
105
106 public: // Not intended for application developers
107
108   /**
109    * @brief This constructor is used by ClipboardEventNotifier::Get().
110    *
111    * @param[in] notifier A pointer to the drag and drop notifier.
112    */
113   explicit DALI_INTERNAL ClipboardEventNotifier( Internal::Adaptor::ClipboardEventNotifier* notifier );
114 };
115
116 } // namespace Dali
117
118 #endif // __DALI_CLIPBOARD_EVENT_NOTIFIER_H__