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
qohossharekit_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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 QOHOSSHAREKIT_P_H
5#define QOHOSSHAREKIT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtHarmonyExtras/private/qtharmonyextrasglobal_p.h>
19
20#include <QtGui/qwindow.h>
21
22#include <QtCore/qbytearray.h>
23#include <QtCore/qfileinfo.h>
24#include <QtCore/qlist.h>
25#include <QtCore/qmimetype.h>
26#include <QtCore/qpoint.h>
27#include <QtCore/qrect.h>
28#include <QtCore/qstring.h>
29#include <QtCore/qurl.h>
30#include <QtCore/qvariant.h>
31
32#include <functional>
33#include <memory>
34
35QT_BEGIN_NAMESPACE
36
37namespace QtHarmonyExtras {
38
39namespace ShareKit {
40
42
50Q_ENUM_NS(ShareAbilityType)
51
52class Q_HARMONYEXTRAS_EXPORT SharedRecord
53{
54public:
55 virtual ~SharedRecord();
56
57 virtual QMimeType mimeType() const = 0;
58 virtual QString content() const = 0;
59 virtual QString filePath() const = 0;
60 virtual bool isUrlContent() const = 0;
61
62 virtual void setTitle(const QString &title) = 0;
63 virtual QString title() const = 0;
64
65 virtual void setLabel(const QString &label) = 0;
66 virtual QString label() const = 0;
67
68 virtual void setDescription(const QString &description) = 0;
69 virtual QString description() const = 0;
70
71 virtual void setThumbnail(const QByteArray &thumbnail) = 0;
72 virtual QByteArray thumbnail() const = 0;
73
75 virtual QString thumbnailFilePath() const = 0;
76
77 virtual void setExtraData(const QVariantMap &extraData) = 0;
78 virtual QVariantMap extraData() const = 0;
79
80protected:
82
83private:
85};
86
87class Q_HARMONYEXTRAS_EXPORT ShareControllerOptions
88{
89public:
91
93 virtual void setAnchor(QRect anchor) = 0;
97
98protected:
100
101private:
103};
104
105class Q_HARMONYEXTRAS_EXPORT ShareOperationResult
106{
107public:
109
110 virtual QString targetAbilityName() const = 0;
111
112protected:
114
115private:
117};
118
120 const QMimeType &mimeType, const QString &content);
123
125
126}
127
128}
129
130namespace QtHarmonyExtras::Private {
131
132std::shared_ptr<void> shareData(
133 QWindow *optMainWindow, const QList<std::shared_ptr<ShareKit::SharedRecord>> &records,
134 std::shared_ptr<ShareKit::ShareControllerOptions> controllerOptions,
135 std::function<void()> panelClosedCallback,
136 std::function<void(std::shared_ptr<ShareKit::ShareOperationResult>)> shareCompletedCallback);
137
138}
139
140QT_END_NAMESPACE
141
142#endif // QOHOSSHAREKIT_P_H
Combined button and popup list for selecting options.
std::shared_ptr< void > shareData(QWindow *optMainWindow, const QList< std::shared_ptr< SharedRecord > > &records, std::shared_ptr< ShareControllerOptions > controllerOptions, std::function< void()> panelClosedCallback, std::function< void(std::shared_ptr< ShareKit::ShareOperationResult >)> shareCompletedCallback)
std::shared_ptr< SharedRecord > createUrlRecord(const QUrl &url)
Creates a shared record with a given url.
std::shared_ptr< SharedRecord > createFileRecord(const QFileInfo &fileInfo)
Creates a shared "file" record with a given fileInfo.
std::shared_ptr< SharedRecord > createContentRecord(const QMimeType &mimeType, const QString &content)
Creates a shared "content" record with a given mimeType and content.
std::shared_ptr< ShareControllerOptions > createControllerOptions()
Creates a controller options instnace.