2 * Copyright (c) 2018 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-impl.h>
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/integration-api/debug.h>
26 #include <dali/internal/system/common/singleton-service-impl.h>
29 ///////////////////////////////////////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
42 struct Clipboard::Impl
48 // Put implementation here.
51 Clipboard::Clipboard(Impl* impl)
56 Clipboard::~Clipboard()
60 Dali::Clipboard Clipboard::Get()
62 Dali::Clipboard clipboard;
64 Dali::SingletonService service( SingletonService::Get() );
67 // Check whether the singleton is already created
68 Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::Clipboard ) );
71 // If so, downcast the handle
72 clipboard = Dali::Clipboard( dynamic_cast< Clipboard* >( handle.GetObjectPtr() ) );
76 Clipboard::Impl* impl( new Clipboard::Impl() );
77 clipboard = Dali::Clipboard( new Clipboard(impl) );
78 service.Register( typeid(Dali::Clipboard), clipboard );
84 bool Clipboard::SetItem(const std::string &itemData )
90 * Request clipboard service to retrieve an item
92 void Clipboard::RequestItem()
97 * Get number of items in clipboard
99 unsigned int Clipboard::NumberOfItems()
105 * Show clipboard window
106 * Function to send message to show the Clipboard (cbhm) as no direct API available
107 * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
109 void Clipboard::ShowClipboard()
113 void Clipboard::HideClipboard(bool skipFirstHide)
117 bool Clipboard::IsVisible() const
122 char* Clipboard::ExcuteBuffered( bool type, void *event )
127 } // namespace Adaptor
129 } // namespace Internal