Revert "[Tizen] Add DALi Autofill implementation"
[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) 2019 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 // INTERNAL INCLUDES
26 #include <dali/public-api/dali-adaptor-common.h>
27
28 namespace Dali
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 namespace Adaptor
34 {
35 class ClipboardEventNotifier;
36 }
37 }
38
39 /**
40  * @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device.
41  */
42 class DALI_ADAPTOR_API ClipboardEventNotifier : public BaseHandle
43 {
44 public:
45
46   // Typedefs
47
48   /**
49    * @brief Clipboard event
50    */
51   typedef Signal< void ( ClipboardEventNotifier& ) > ClipboardEventSignalType;
52
53   /**
54    * @brief Create an uninitialized handle.
55    *
56    * This can be initialized by getting the notifier from Dali::Adaptor.
57    */
58   ClipboardEventNotifier();
59
60   /**
61    * @brief Retrieve a handle to the ClipboardEventNotifier instance.
62    *
63    * @return A handle to the ClipboardEventNotifier
64    */
65   static ClipboardEventNotifier Get();
66
67   /**
68    * @brief Destructor
69    *
70    * This is non-virtual since derived Handle types must not contain data or virtual methods.
71    */
72   ~ClipboardEventNotifier();
73
74   /**
75    * @brief Returns the selected content.
76    * @return A reference to the string representing the selected content.
77    */
78   const std::string& GetContent() const;
79
80   /**
81    * @brief Sets the selected content.
82    * @param[in] content  A string that represents the content that has been selected.
83    */
84   void SetContent( const std::string& content );
85
86   /**
87    * @brief Clears the stored content.
88    */
89   void ClearContent();
90
91   /**
92    * @brief Called when content is selected in the clipboard.
93    */
94   void EmitContentSelectedSignal();
95
96 public:  // Signals
97
98   /**
99    * @brief This is emitted when content is selected from the clipboard.
100    *
101    * A callback of the following type may be connected:
102    * @code
103    *   void YourCallback( ClipboardEventNotifier& notifier );
104    * @endcode
105    * @return The signal to connect to.
106    */
107   ClipboardEventSignalType& ContentSelectedSignal();
108
109 public: // Not intended for application developers
110
111   /**
112    * @brief This constructor is used by ClipboardEventNotifier::Get().
113    *
114    * @param[in] notifier A pointer to the drag and drop notifier.
115    */
116   explicit DALI_INTERNAL ClipboardEventNotifier( Internal::Adaptor::ClipboardEventNotifier* notifier );
117 };
118
119 } // namespace Dali
120
121 #endif // DALI_CLIPBOARD_EVENT_NOTIFIER_H