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 "clipboard-event-notifier-impl.h"
22 #include <dali/public-api/object/type-registry.h>
25 #include <singleton-service-impl.h>
36 Dali::ClipboardEventNotifier ClipboardEventNotifier::New()
38 Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier());
43 Dali::ClipboardEventNotifier ClipboardEventNotifier::Get()
45 Dali::ClipboardEventNotifier notifier;
47 Dali::SingletonService service( SingletonService::Get() );
50 // Check whether the singleton is already created
51 Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
54 // If so, downcast the handle
55 notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
59 notifier = Dali::ClipboardEventNotifier( ClipboardEventNotifier::New() );
60 service.Register( typeid( notifier ), notifier );
67 const std::string& ClipboardEventNotifier::GetContent() const
72 void ClipboardEventNotifier::SetContent( const std::string& content )
77 void ClipboardEventNotifier::ClearContent()
82 void ClipboardEventNotifier::EmitContentSelectedSignal()
84 if ( !mContentSelectedSignal.Empty() )
86 Dali::ClipboardEventNotifier handle( this );
87 mContentSelectedSignal.Emit( handle );
91 ClipboardEventNotifier::ClipboardEventNotifier()
96 ClipboardEventNotifier::~ClipboardEventNotifier()
100 } // namespace Adaptor
102 } // namespace Internal