Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosclipboardobject.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOHOSCLIPBOARDOBJECT_H
5#define QOHOSCLIPBOARDOBJECT_H
6
7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/qglobal.h>
9#include <QtCore/qmimedata.h>
10#include <database/pasteboard/oh_pasteboard.h>
11#include <memory>
12#include <optional>
13#include <qohosjsscopedataowner.h>
14
16
18{
19public:
25
31
33 std::function<void(std::optional<PasteboardDataSource>)> &&pasteboardUpdatesNotifier);
34
36 void setMimeDataSync(
37 std::shared_ptr<QMimeData> mimeData, const std::optional<bool> &shareInAppOnly);
38
39protected:
40 QOhosClipboardObject(std::function<void(std::optional<PasteboardDataSource>)> &&pasteboardUpdatesNotifier);
41
42private:
43 struct JsScopeData
44 {
45 std::shared_ptr<::OH_Pasteboard> pasteboard;
46 std::shared_ptr<void> pasteboardDataChangedListenerHandle;
47 };
48
49 std::shared_ptr<QOhosConsumer<std::optional<PasteboardDataSource>>> m_pasteboardUpdatesNotifier;
50 QtOhos::JsScopeDataOwner<JsScopeData> m_jsScopeData;
51};
52
53QT_END_NAMESPACE
54
55#endif
void setMimeDataSync(std::shared_ptr< QMimeData > mimeData, const std::optional< bool > &shareInAppOnly)
QOhosClipboardObject(std::function< void(std::optional< PasteboardDataSource >)> &&pasteboardUpdatesNotifier)
PasteboardData getPasteboardDataWithLazyFetch()
static std::unique_ptr< QOhosClipboardObject > makeInstance(std::function< void(std::optional< PasteboardDataSource >)> &&pasteboardUpdatesNotifier)
Combined button and popup list for selecting options.
std::shared_ptr<::OH_PasteboardObserver > createPasteboardDataObserver()
std::shared_ptr< void > subscribePasteboardObserver(std::shared_ptr<::OH_Pasteboard > pasteboard, std::shared_ptr<::OH_PasteboardObserver > pasteboardObserver, ::Pasteboard_NotifyType notifyType, std::function< void()> dataChangedFunc)
const char * getPasteboardDataSourceAsString(QOhosClipboardObject::PasteboardDataSource dataSource)
std::shared_ptr< void > addPasteboardDataChangedListener(std::shared_ptr<::OH_Pasteboard > pasteboard, std::function< void()> dataChangedListener, std::vector<::Pasteboard_NotifyType > monitoredNotifyTypes)
const char * getPasteboardNotifyTypeAsString(::Pasteboard_NotifyType notifyType)
std::unique_ptr< QOhosUdmfData > tryGetUdmfDataFromPasteboard(::OH_Pasteboard *pasteboard)
std::unique_ptr< QMimeData > lazyFetchingData
std::optional< PasteboardDataSource > dataSource
std::weak_ptr< QOhosClipboardObject > weakThis