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