2 * Copyright (c) 2023 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/text-clipboard/common/text-clipboard-event-notifier-impl.h>
22 #include <dali/devel-api/common/singleton-service.h>
23 #include <dali/public-api/object/type-registry.h>
31 Dali::TextClipboardEventNotifier TextClipboardEventNotifier::New()
33 Dali::TextClipboardEventNotifier notifier = Dali::TextClipboardEventNotifier(new TextClipboardEventNotifier());
38 Dali::TextClipboardEventNotifier TextClipboardEventNotifier::Get()
40 Dali::TextClipboardEventNotifier notifier;
42 Dali::SingletonService service(SingletonService::Get());
45 // Check whether the singleton is already created
46 Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::TextClipboardEventNotifier));
49 // If so, downcast the handle
50 notifier = Dali::TextClipboardEventNotifier(dynamic_cast<TextClipboardEventNotifier*>(handle.GetObjectPtr()));
54 notifier = Dali::TextClipboardEventNotifier(TextClipboardEventNotifier::New());
55 service.Register(typeid(notifier), notifier);
62 const std::string& TextClipboardEventNotifier::GetContent() const
67 void TextClipboardEventNotifier::SetContent(const std::string& content)
72 void TextClipboardEventNotifier::ClearContent()
77 void TextClipboardEventNotifier::EmitContentSelectedSignal()
79 if(!mContentSelectedSignal.Empty())
81 Dali::TextClipboardEventNotifier handle(this);
82 mContentSelectedSignal.Emit(handle);
86 TextClipboardEventNotifier::TextClipboardEventNotifier()
91 TextClipboardEventNotifier::~TextClipboardEventNotifier()
95 } // namespace Adaptor
97 } // namespace Internal