2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/internal/clipboard/common/clipboard-event-notifier-impl.h>
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/devel-api/common/singleton-service.h>
34 Dali::ClipboardEventNotifier ClipboardEventNotifier::New()
36 Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier());
41 Dali::ClipboardEventNotifier ClipboardEventNotifier::Get()
43 Dali::ClipboardEventNotifier notifier;
45 Dali::SingletonService service( SingletonService::Get() );
48 // Check whether the singleton is already created
49 Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
52 // If so, downcast the handle
53 notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
57 notifier = Dali::ClipboardEventNotifier( ClipboardEventNotifier::New() );
58 service.Register( typeid( notifier ), notifier );
65 const std::string& ClipboardEventNotifier::GetContent() const
70 void ClipboardEventNotifier::SetContent( const std::string& content )
75 void ClipboardEventNotifier::ClearContent()
80 void ClipboardEventNotifier::EmitContentSelectedSignal()
82 if ( !mContentSelectedSignal.Empty() )
84 Dali::ClipboardEventNotifier handle( this );
85 mContentSelectedSignal.Emit( handle );
89 ClipboardEventNotifier::ClipboardEventNotifier()
94 ClipboardEventNotifier::~ClipboardEventNotifier()
98 } // namespace Adaptor
100 } // namespace Internal