1 #ifndef DALI_INTERNAL_CLIPBOARD_H
2 #define DALI_INTERNAL_CLIPBOARD_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/object/base-object.h>
25 #include <dali/devel-api/adaptor-framework/clipboard.h>
34 * Implementation of the Clip Board
37 class Clipboard : public Dali::BaseObject
40 // Hide the specific windowing system
44 * @copydoc Dali::Clipboard::Get()
46 static Dali::Clipboard Get();
49 * @copydoc Dali::Clipboard::IsAvailable()
51 static bool IsAvailable();
55 * @param[in] impl Some data from a specific windowing system.
57 Clipboard(Impl* impl);
62 ~Clipboard() override;
65 * @copydoc Dali::Clipboard::SetItem()
67 bool SetItem(const std::string& itemData);
70 * @copydoc Dali::Clipboard::RequestItem()
75 * @copydoc Dali::Clipboard::NumberOfClipboardItems()
77 unsigned int NumberOfItems();
80 * @copydoc Dali::Clipboard::ShowClipboard()
85 * @copydoc Dali::Clipboard::HideClipboard()
87 void HideClipboard(bool skipFirstHide);
90 * @copydoc Dali::Clipboard::IsVisible()
92 bool IsVisible() const;
95 * @brief sending buffered data
97 * @param[in] event information pointer
99 void ExcuteSend(void* event);
102 * @brief receiving buffered data
104 * @param[in] event information pointer
105 * @param[out] data The buffer pointer for receive data
106 * @param[out] length The buffer length for receive data
108 void ExcuteReceive(void* event, char*& data, int& length);
112 Clipboard(const Clipboard&);
113 Clipboard& operator=(Clipboard&);
119 }; // class clipboard
121 } // namespace Adaptor
123 } // namespace Internal
125 inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
127 DALI_ASSERT_ALWAYS(clipboard && "Clipboard handle is empty");
128 BaseObject& handle = clipboard.GetBaseObject();
129 return static_cast<Internal::Adaptor::Clipboard&>(handle);
132 inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
134 DALI_ASSERT_ALWAYS(clipboard && "Clipboard handle is empty");
135 const BaseObject& handle = clipboard.GetBaseObject();
136 return static_cast<const Internal::Adaptor::Clipboard&>(handle);
141 #endif // DALI_INTERNAL_CLIPBOARD_H