63588a4817df09cccd3e9009f9a1836b2fcbe38e
[platform/core/uifw/dali-adaptor.git] / adaptors / wayland / clipboard / clipboard-impl-wl.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include "clipboard-impl.h"
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/integration-api/debug.h>
24
25 // INTERNAL INCLUDES
26 #include <singleton-service-impl.h>
27
28
29 ///////////////////////////////////////////////////////////////////////////////////////////////////
30 // Clipboard
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
32
33 namespace Dali
34 {
35
36 namespace Internal
37 {
38
39 namespace Adaptor
40 {
41
42 struct Clipboard::Impl
43 {
44   Impl()
45   {
46   }
47
48   // Put implementation here.
49 };
50
51 Clipboard::Clipboard(Impl* impl)
52 : mImpl(impl)
53 {
54 }
55
56 Clipboard::~Clipboard()
57 {
58   delete mImpl;
59 }
60
61 Dali::Clipboard Clipboard::Get()
62 {
63   Dali::Clipboard clipboard;
64
65   Dali::SingletonService service( SingletonService::Get() );
66   if ( service )
67   {
68     // Check whether the singleton is already created
69     Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::Clipboard ) );
70     if(handle)
71     {
72       // If so, downcast the handle
73       clipboard = Dali::Clipboard( dynamic_cast< Clipboard* >( handle.GetObjectPtr() ) );
74     }
75     else
76     {
77       Clipboard::Impl* impl( new Clipboard::Impl() );
78       clipboard = Dali::Clipboard( new Clipboard(impl) );
79       service.Register( typeid(Dali::Clipboard), clipboard );
80     }
81   }
82
83   return clipboard;
84 }
85 bool Clipboard::SetItem(const std::string &itemData )
86 {
87   return true;
88 }
89
90 /*
91  * Request clipboard service to retrieve an item
92  */
93 void Clipboard::RequestItem()
94 {
95 }
96
97 /*
98  * Get number of items in clipboard
99  */
100 unsigned int Clipboard::NumberOfItems()
101 {
102   return -1;
103 }
104
105 /**
106  * Show clipboard window
107  * Function to send message to show the Clipboard (cbhm) as no direct API available
108  * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
109  */
110 void Clipboard::ShowClipboard()
111 {
112 }
113
114 void Clipboard::HideClipboard(bool skipFirstHide)
115 {
116 }
117
118 bool Clipboard::IsVisible() const
119 {
120   return false;
121 }
122
123 char* Clipboard::ExcuteBuffered( bool type, void *event )
124 {
125   return NULL;
126 }
127
128 } // namespace Adaptor
129
130 } // namespace Internal
131
132 } // namespace Dali