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/dali-core.h>
25 #include <adaptor-impl.h>
40 BaseHandle handle( ClipboardEventNotifier::Get() );
42 if ( !handle && Adaptor::IsAvailable() )
44 Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
45 Dali::ClipboardEventNotifier notifier( ClipboardEventNotifier::New() );
46 adaptorImpl.RegisterSingleton( typeid( notifier ), notifier );
52 TypeRegistration CLIPBOARD_EVENT_NOTIFIER_TYPE( typeid(Dali::ClipboardEventNotifier), typeid(Dali::BaseHandle), Create, true /* Create Instance At Startup */ );
54 } // unnamed namespace
56 Dali::ClipboardEventNotifier ClipboardEventNotifier::New()
58 Dali::ClipboardEventNotifier notifier = Dali::ClipboardEventNotifier(new ClipboardEventNotifier());
63 Dali::ClipboardEventNotifier ClipboardEventNotifier::Get()
65 Dali::ClipboardEventNotifier notifier;
67 if ( Adaptor::IsAvailable() )
69 // Check whether the singleton is already created
70 Dali::BaseHandle handle = Adaptor::Get().GetSingleton( typeid( Dali::ClipboardEventNotifier ) );
73 // If so, downcast the handle
74 notifier = Dali::ClipboardEventNotifier( dynamic_cast< ClipboardEventNotifier* >( handle.GetObjectPtr() ) );
81 const std::string& ClipboardEventNotifier::GetContent() const
86 void ClipboardEventNotifier::SetContent( const std::string& content )
91 void ClipboardEventNotifier::ClearContent()
96 void ClipboardEventNotifier::EmitContentSelectedSignal()
98 if ( !mContentSelectedSignalV2.Empty() )
100 Dali::ClipboardEventNotifier handle( this );
101 mContentSelectedSignalV2.Emit( handle );
105 ClipboardEventNotifier::ClipboardEventNotifier()
110 ClipboardEventNotifier::~ClipboardEventNotifier()
114 } // namespace Adaptor
116 } // namespace Internal