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>
40 BaseHandle handle( ClipboardEventNotifier::Get() );
44 Dali::SingletonService service( SingletonService::Get() );
47 Dali::ClipboardEventNotifier notifier( ClipboardEventNotifier::New() );
48 service.Register( typeid( notifier ), notifier );
55 TypeRegistration CLIPBOARD_EVENT_NOTIFIER_TYPE( typeid(Dali::ClipboardEventNotifier), typeid(Dali::BaseHandle), Create, true /* Create Instance At Startup */ );
57 } // unnamed namespace
59 Dali::ClipboardEventNotifier ClipboardEventNotifier::New()
61 Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier());
66 Dali::ClipboardEventNotifier ClipboardEventNotifier::Get()
68 Dali::ClipboardEventNotifier notifier;
70 Dali::SingletonService service( SingletonService::Get() );
73 // Check whether the singleton is already created
74 Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
77 // If so, downcast the handle
78 notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
85 const std::string& ClipboardEventNotifier::GetContent() const
90 void ClipboardEventNotifier::SetContent( const std::string& content )
95 void ClipboardEventNotifier::ClearContent()
100 void ClipboardEventNotifier::EmitContentSelectedSignal()
102 if ( !mContentSelectedSignal.Empty() )
104 Dali::ClipboardEventNotifier handle( this );
105 mContentSelectedSignal.Emit( handle );
109 ClipboardEventNotifier::ClipboardEventNotifier()
114 ClipboardEventNotifier::~ClipboardEventNotifier()
118 } // namespace Adaptor
120 } // namespace Internal