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