Dali 3D User Interface Engine
toolkit-clipboard.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 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 #include "toolkit-clipboard.h"
19 
20 // EXTERNAL INCLUDES
22 
23 
24 namespace Dali
25 {
26 
27 namespace Internal
28 {
29 
30 namespace Adaptor
31 {
32 
37 class Clipboard : public Dali::BaseObject
38 {
39 public:
40 
44  static Dali::Clipboard Get();
45 
50  Clipboard(/*Ecore_X_Window ecoreXwin*/);
51  virtual ~Clipboard();
52 
56  bool SetItem(const std::string &itemData);
57 
61  std::string GetItem( unsigned int index );
62 
66  unsigned int NumberOfItems();
67 
71  void ShowClipboard();
72 
76  void HideClipboard();
77 
78 
79 private:
80  Clipboard( const Clipboard& );
82 
83  static Dali::Clipboard mToolkitClipboard;
84 }; // class clipboard
85 
86 
88 
89 
90 Clipboard::Clipboard( /*Ecore_X_Window ecoreXwin*/)
91 {
92 }
93 
95 {
96 }
97 
98 Dali::Clipboard Clipboard::Get()
99 {
100  if( ! mToolkitClipboard )
101  {
102  mToolkitClipboard = Dali::Clipboard( new Dali::Internal::Adaptor::Clipboard() );
103  }
104  return mToolkitClipboard;
105 }
106 
107 bool Clipboard::SetItem(const std::string &itemData )
108 {
109  return true;
110 }
111 
112 std::string Clipboard::GetItem( unsigned int index )
113 {
114  return "";
115 }
116 
118 {
119  return 0;
120 }
121 
123 {
124 }
125 
127 {
128 }
129 
130 
131 } // namespace Adaptor
132 
133 } // namespace Internal
134 
135 
136 inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
137 {
138  // Bypass any passed in clipboard handle - it probably won't be initialized
139  Dali::Clipboard theClipboard = Dali::Clipboard::Get();
140  BaseObject& object = theClipboard.GetBaseObject();
141  return static_cast<Internal::Adaptor::Clipboard&>(object);
142 }
143 
144 inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
145 {
146  // Bypass any passed in clipboard handle - it probably won't be initialized
147  Dali::Clipboard theClipboard = Dali::Clipboard::Get();
148  const BaseObject& object = theClipboard.GetBaseObject();
149  return static_cast<const Internal::Adaptor::Clipboard&>(object);
150 }
151 
152 
153 Clipboard::Clipboard()
154 {
155 }
156 Clipboard::~Clipboard()
157 {
158 }
159 Clipboard::Clipboard(Internal::Adaptor::Clipboard *impl)
160  : BaseHandle(impl)
161 {
162 }
163 
165 {
167 }
168 bool Clipboard::SetItem( const std::string &itemData)
169 {
170  return GetImplementation(*this).SetItem( itemData );
171 }
172 
173 std::string Clipboard::GetItem( unsigned int index )
174 {
175  return GetImplementation(*this).GetItem( index );
176 }
177 
179 {
180  return GetImplementation(*this).NumberOfItems();
181 }
182 
184 {
185  GetImplementation(*this).ShowClipboard();
186 }
187 
189 {
190  GetImplementation(*this).HideClipboard();
191 }
192 
193 } // namespace Dali
Dali Docs Home
Read more about Dali