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
qohosabilitycontext_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
QOHOSABILITYCONTEXT_P_H
5
#
define
QOHOSABILITYCONTEXT_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
/
qohosoperationstatus_p
.
h
>
19
#
include
<
QtHarmonyExtras
/
private
/
qohossharekit_p
.
h
>
20
#
include
<
QtHarmonyExtras
/
private
/
qohosstartoptions_p
.
h
>
21
#
include
<
QtHarmonyExtras
/
private
/
qohoswant_p
.
h
>
22
#
include
<
QtHarmonyExtras
/
private
/
qtharmonyextrasglobal_p
.
h
>
23
24
#
include
<
QtGui
/
qwindow
.
h
>
25
#
include
<
QtWidgets
/
qwidget
.
h
>
26
27
#
include
<
QtCore
/
qbytearray
.
h
>
28
#
include
<
QtCore
/
qjsonobject
.
h
>
29
#
include
<
QtCore
/
qlist
.
h
>
30
#
include
<
QtCore
/
qstring
.
h
>
31
32
#
include
<
functional
>
33
#
include
<
memory
>
34
#
include
<
optional
>
35
36
QT_BEGIN_NAMESPACE
37
38
namespace
QtHarmonyExtras
{
39
40
class
Q_HARMONYEXTRAS_EXPORT
OpenLinkOptions
41
{
42
public
:
43
virtual
~
OpenLinkOptions
();
44
45
virtual
void
setAppLinkingOnly
(
bool
appLinkingOnly
) = 0;
46
47
protected
:
48
OpenLinkOptions
();
49
50
private
:
51
Q_DISABLE_COPY
(
OpenLinkOptions
)
52
};
53
54
Q_HARMONYEXTRAS_EXPORT
std
::
shared_ptr
<
OpenLinkOptions
>
createOpenLinkOptions
();
55
56
class
Q_HARMONYEXTRAS_EXPORT
OnContinueContext
57
{
58
public
:
59
virtual
~
OnContinueContext
();
60
61
virtual
void
sendAgreeResponse
(
const
QByteArray
&
responseData
) = 0;
62
virtual
void
sendRejectResponse
() = 0;
63
virtual
void
sendMismatchResponse
() = 0;
64
65
virtual
void
setExitAppOnSourceDeviceAfterMigration
(
bool
exitAfterMigration
) = 0;
66
67
virtual
int
sourceApplicationVersionCode
()
const
= 0;
68
69
protected
:
70
OnContinueContext
();
71
72
private
:
73
Q_DISABLE_COPY
(
OnContinueContext
)
74
};
75
76
struct
StartAbilityResult
77
{
78
int
resultCode
= 0;
79
std
::
optional
<
Want
>
want
;
80
};
81
82
class
Q_HARMONYEXTRAS_EXPORT
AbilityContext
:
public
QObject
83
{
84
Q_OBJECT
85
86
public
:
87
static
AbilityContext
*
defaultInstance
();
88
static
AbilityContext
*
instanceForMainWindow
(
QWindow
*
instanceMainWindow
);
89
90
virtual
void
setDestroyFromSystemEnabled
(
bool
destroyEnabled
) = 0;
91
92
virtual
void
startAbilityForResult
(
93
const
Want
&
want
,
std
::
shared_ptr
<
StartOptions
>
options
,
QObject
*
context
,
94
std
::
function
<
void
(
std
::
optional
<
StartAbilityResult
>)>
callback
) = 0;
95
96
virtual
void
shareDataWithShareKit
(
97
const
QList
<
std
::
shared_ptr
<
ShareKit
::
SharedRecord
>> &
records
,
98
std
::
shared_ptr
<
ShareKit
::
ShareControllerOptions
>
controllerOptions
,
99
QObject
*
context
,
100
std
::
function
<
void
(
std
::
shared_ptr
<
ShareKit
::
ShareOperationResult
>)>
onShareCompleted
,
101
std
::
function
<
void
()>
onPanelClosed
) = 0;
102
103
virtual
bool
tryOpenLink
(
const
QString
&
link
,
std
::
shared_ptr
<
OpenLinkOptions
>
options
) = 0;
104
105
virtual
void
setContinuationActive
(
bool
continuationActive
) = 0;
106
107
Q_SIGNALS
:
108
void
newWantInfoReceived
(
std
::
shared_ptr
<
WantInfo
>
wantInfo
);
109
void
continueRequestReceived
(
std
::
shared_ptr
<
OnContinueContext
>
onContinueContext
);
110
111
protected
:
112
AbilityContext
();
113
~
AbilityContext
()
override
;
114
115
Q_DISABLE_COPY
(
AbilityContext
)
116
};
117
118
Q_HARMONYEXTRAS_EXPORT
std
::
shared_ptr
<
OperationStatus
>
startAbility
(
const
Want
&
want
,
std
::
shared_ptr
<
StartOptions
>
options
=
nullptr
);
119
120
Q_HARMONYEXTRAS_EXPORT
std
::
shared_ptr
<
OperationStatus
>
startAbilityByType
(
const
QString
&
appType
,
const
QJsonObject
&
wantParameters
);
121
122
Q_HARMONYEXTRAS_EXPORT
void
startNewAbilityInstance
(QWidget *instanceWidget);
123
124
Q_HARMONYEXTRAS_EXPORT
void
startAppProcess
(
const
QString &processId,
const
Want &requestWant, std::shared_ptr<StartOptions> options =
nullptr
);
125
126
Q_HARMONYEXTRAS_EXPORT
void
setAbilityInstanceDestroyEnabled
(QWindow *instanceWindow,
bool
destroyEnabled);
127
128
Q_HARMONYEXTRAS_EXPORT
std
::
optional
<
QByteArray
>
tryGetOnContinueData
(
const
Want
&
want
);
129
130
}
131
132
QT_END_NAMESPACE
133
134
#
endif
// QOHOSABILITYCONTEXT_P_H
QtHarmonyExtras::AbilityContext
\inmodule QtHarmonyExtras
Definition
qohosabilitycontext_p.h:83
QtHarmonyExtras::OnContinueContext
\inmodule QtHarmonyExtras
Definition
qohosabilitycontext_p.h:57
QtHarmonyExtras::OpenLinkOptions
Definition
qohosabilitycontext_p.h:41
QtHarmonyExtras
Definition
qohosabilitycontext.cpp:36
QtHarmonyExtras::startAppProcess
void startAppProcess(const QString &processId, const Want &requestWant, std::shared_ptr< StartOptions > options)
Starts application process for a given processId, requestWant and options; pass a null options to sta...
Definition
qohosabilitycontext.cpp:1208
QtHarmonyExtras::createOpenLinkOptions
std::shared_ptr< OpenLinkOptions > createOpenLinkOptions()
Definition
qohosabilitycontext.cpp:1266
QtHarmonyExtras::startNewAbilityInstance
void startNewAbilityInstance(QWidget *instanceWidget)
Starts another instance of the UIAbility used by the Qt app with specified widget inside.
Definition
qohosabilitycontext.cpp:1197
QtHarmonyExtras::setAbilityInstanceDestroyEnabled
void setAbilityInstanceDestroyEnabled(QWindow *instanceWindow, bool destroyEnabled)
Sets whether the Ability related with instanceWindow can be automatically destroyed by the system whe...
Definition
qohosabilitycontext.cpp:1226
QtHarmonyExtras::startAbilityByType
std::shared_ptr< OperationStatus > startAbilityByType(const QString &appType, const QJsonObject &wantParameters)
Starts an Ability for a given appType and wantParameters.
Definition
qohosabilitycontext.cpp:1186
QtHarmonyExtras::tryGetOnContinueData
std::optional< QByteArray > tryGetOnContinueData(const Want &want)
Tries to get continuation / migration related data that was provided on the source device.
Definition
qohosabilitycontext.cpp:1239
QtHarmonyExtras::startAbility
std::shared_ptr< OperationStatus > startAbility(const Want &want, std::shared_ptr< StartOptions > options)
Starts an Ability for a given want and options; pass a null options to start without any start option...
Definition
qohosabilitycontext.cpp:1171
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QtHarmonyExtras::StartAbilityResult
Definition
qohosabilitycontext_p.h:77
QtHarmonyExtras::StartAbilityResult::resultCode
int resultCode
Definition
qohosabilitycontext_p.h:78
QtHarmonyExtras::StartAbilityResult::want
std::optional< Want > want
Definition
qohosabilitycontext_p.h:79
qtbase
src
plugins
platforms
ohos
extras
qohosabilitycontext_p.h
Generated on
for Qt by
1.16.1