Dali 3D User Interface Engine
clipboard-event-notifier-impl.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 // CLASS HEADER
20 
21 // EXTERNAL INCLUDES
23 
24 // INTERNAL INCLUDES
25 #include <singleton-service-impl.h>
26 
27 namespace Dali
28 {
29 
30 namespace Internal
31 {
32 
33 namespace Adaptor
34 {
35 
37 {
39 
40  return notifier;
41 }
42 
44 {
46 
48  if ( service )
49  {
50  // Check whether the singleton is already created
51  Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
52  if(handle)
53  {
54  // If so, downcast the handle
55  notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
56  }
57  else
58  {
60  service.Register( typeid( notifier ), notifier );
61  }
62  }
63 
64  return notifier;
65 }
66 
67 const std::string& ClipboardEventNotifier::GetContent() const
68 {
69  return mContent;
70 }
71 
72 void ClipboardEventNotifier::SetContent( const std::string& content )
73 {
74  mContent = content;
75 }
76 
78 {
79  mContent.clear();
80 }
81 
83 {
84  if ( !mContentSelectedSignal.Empty() )
85  {
86  Dali::ClipboardEventNotifier handle( this );
87  mContentSelectedSignal.Emit( handle );
88  }
89 }
90 
92 : mContent()
93 {
94 }
95 
97 {
98 }
99 
100 } // namespace Adaptor
101 
102 } // namespace Internal
103 
104 } // namespace Dali
Dali Docs Home
Read more about Dali