Changed 'virtual' function override declarations to 'override' in automated-tests.
[platform/core/uifw/dali-adaptor.git] / dali / internal / clipboard / common / clipboard-event-notifier-impl.h
1 #ifndef DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H
2 #define DALI_INTERNAL_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 <string>
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/public-api/math/vector2.h>
25
26 // INTERNAL INCLUDES
27 #include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
28 #include <dali/public-api/dali-adaptor-common.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 namespace Adaptor
37 {
38
39 /**
40  * This class listens to Clipboard events.
41  */
42 class ClipboardEventNotifier : public Dali::BaseObject
43 {
44 public:
45
46   typedef Dali::ClipboardEventNotifier::ClipboardEventSignalType ClipboardEventSignalType;
47
48   // Creation
49
50   /**
51    * Create a ClipboardEventNotifier.
52    * @return A newly allocated clipboard-event-notifier.
53    */
54   static Dali::ClipboardEventNotifier New();
55
56   /**
57    * @copydoc Dali::ClipboardEventNotifier::Get()
58    */
59   static Dali::ClipboardEventNotifier Get();
60
61   // Public API
62
63   /**
64    * @copydoc Dali::ClipboardEventNotifier::GetContent() const
65    */
66   const std::string& GetContent() const;
67
68   /**
69    * Sets the selected content.
70    * @param[in] content  A string that represents the content that has been selected.
71    */
72   void SetContent( const std::string& content );
73
74   /**
75    * Clears the stored content.
76    */
77   void ClearContent();
78
79   /**
80    * Called when content is selected in the clipboard.
81    */
82   void EmitContentSelectedSignal();
83
84 public: // Signals
85
86   /**
87    * @copydoc Dali::ClipboardEventNotifier::ContentSelectedSignal
88    */
89   ClipboardEventSignalType& ContentSelectedSignal()
90   {
91     return mContentSelectedSignal;
92   }
93
94 private:
95
96   // Construction & Destruction
97
98   /**
99    * Constructor.
100    */
101   ClipboardEventNotifier();
102
103   /**
104    * Destructor.
105    */
106   virtual ~ClipboardEventNotifier();
107
108   // Undefined
109   ClipboardEventNotifier( const ClipboardEventNotifier& );
110   ClipboardEventNotifier& operator=( ClipboardEventNotifier& );
111
112 private:
113
114   std::string mContent;    ///< The current selected content.
115
116   ClipboardEventSignalType mContentSelectedSignal;
117
118 public:
119
120   // Helpers for public-api forwarding methods
121
122   inline static Internal::Adaptor::ClipboardEventNotifier& GetImplementation(Dali::ClipboardEventNotifier& detector)
123   {
124     DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
125
126     BaseObject& handle = detector.GetBaseObject();
127
128     return static_cast<Internal::Adaptor::ClipboardEventNotifier&>(handle);
129   }
130
131   inline static const Internal::Adaptor::ClipboardEventNotifier& GetImplementation(const Dali::ClipboardEventNotifier& detector)
132   {
133     DALI_ASSERT_ALWAYS( detector && "ClipboardEventNotifier handle is empty" );
134
135     const BaseObject& handle = detector.GetBaseObject();
136
137     return static_cast<const Internal::Adaptor::ClipboardEventNotifier&>(handle);
138   }
139
140 };
141
142 } // namespace Adaptor
143
144 } // namespace Internal
145
146 } // namespace Dali
147
148 #endif // DALI_INTERNAL_CLIPBOARD_EVENT_NOTIFIER_H