Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace: Difference between revisions
Created page with "<!-- Source: qtohosextras-sharekit.html --> <span id="sharekit-namespace"></span> = ShareKit Namespace = <span class="small-subtitle">(QtOhosExtras::ShareKit)<br /> </span> The ShareKit to expose Share Kit API. More... <div class="table"> {| class="wikitable alignedsummary" |- | class="memItemLeft rightAlign topAlign"| Header: | class="memIte..." |
Update from qdoc output (QTFOROH-2307) |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
< | < [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]] | ||
= ShareKit Namespace = | = ShareKit Namespace = | ||
QtOhosExtras::ShareKit | |||
The | The ShareKit to expose Share Kit API. [[#details|More...]] | ||
{| class="wikitable" | |||
{| class="wikitable | |||
|- | |- | ||
| Header: | |||
| | | #include <ShareKit> | ||
|- | |- | ||
| qmake: | |||
| QT += ohosextras | |||
|- | |- | ||
| Since: | |||
| Qt 5.12.12 | |||
|} | |} | ||
This namespace was introduced in Qt 5.12.12. | |||
== Classes == | == Classes == | ||
{| class="wikitable" | |||
|- | |||
| class | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]''' | |||
|- | |- | ||
| class | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareOperationResult_Class|QOhosShareOperationResult]]''' | |||
|- | |- | ||
| class | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]''' | |||
|} | |} | ||
== Types == | == Types == | ||
{| class="wikitable" | |||
{| class="wikitable | |||
|- | |- | ||
| class | | enum class | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#ShareAbilityType-enum|ShareAbilityType]]''' { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } | |||
|} | |} | ||
== Functions == | == Functions == | ||
{| class="wikitable" | |||
{| class="wikitable | |||
|- | |- | ||
| QSharedPointer<QOhosSharedRecord> | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &''mimeType'', const QString &''content'') | |||
|- | |- | ||
| QSharedPointer<QOhosShareControllerOptions> | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''() | |||
|- | |- | ||
| QSharedPointer<QOhosSharedRecord> | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &''fileInfo'') | |||
|- | |- | ||
| QSharedPointer<QOhosSharedRecord> | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &''url'') | |||
|} | |} | ||
== Detailed Description == | == Detailed Description == | ||
== Classes == | == Classes == | ||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] === | |||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] === | |||
The | The QOhosShareControllerOptions class is to configure items, such as the preview mode of the shared content, selection mode, and other information, and pop-up window anchor. It determines the display style of the sharing panel. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class#details|More...]] | ||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareOperationResult_Class|QOhosShareOperationResult]] === | |||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/ | |||
ShareOperationResult wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section17135118312 ShareOperationResult] interface. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareOperationResult_Class#details|More...]] | |||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] === | |||
The QOhosSharedRecord class represents a record to be shared with other application. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#details|More...]] | |||
== Type Documentation == | == Type Documentation == | ||
=== <span id="ShareAbilityType-enum"></span>enum class ShareKit::ShareAbilityType === | |||
=== <span id="ShareAbilityType-enum"></span>enum ShareKit:: | |||
Enumerates system sharing abilities shown on the sharing panel. Used with [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class#setExcludedAbilities|QOhosShareControllerOptions::setExcludedAbilities]]() to hide selected abilities from the panel. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#shareabilitytype ShareAbilityType]. | |||
{| class="wikitable" | |||
|- | |||
! Constant | |||
! Value | |||
! Description | |||
|- | |||
| <code>QtOhosExtras::ShareKit::ShareAbilityType::CopyToPasteboard</code> | |||
| <code>0</code> | |||
| Copy the shared content to the pasteboard. | |||
|- | |||
| <code>QtOhosExtras::ShareKit::ShareAbilityType::SaveToMediaAsset</code> | |||
| <code>1</code> | |||
| Save the shared content to the Gallery. | |||
|- | |||
| <code>QtOhosExtras::ShareKit::ShareAbilityType::SaveAsFile</code> | |||
| <code>2</code> | |||
| Save the shared content as a file. | |||
|- | |||
| <code>QtOhosExtras::ShareKit::ShareAbilityType::Print</code> | |||
| <code>3</code> | |||
| Print the shared content. | |||
|- | |||
| <code>QtOhosExtras::ShareKit::ShareAbilityType::SaveToSuperHub</code> | |||
| <code>4</code> | |||
| Save the shared content to SuperHub. | |||
|} | |||
This enum was introduced or modified in Qt 5.12.12. | |||
== Function Documentation == | == Function Documentation == | ||
<span id="createContentRecord"></span> | === <span id="createContentRecord"></span>[https://doc.qt.io/qt-5/qsharedpointer.html QSharedPointer]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]> ShareKit::createContentRecord(const [https://doc.qt.io/qt-5/qmimetype.html QMimeType] &''mimeType'', const [https://doc.qt.io/qt-5/qstring.html QString] &''content'') === | ||
QSharedPointer< | |||
ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content) | |||
Creates a shared | Creates a shared "content" record with a given ''mimeType'' and ''content''. Shared record can be created with content (this function) or as a file shared record, see [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]](). See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | ||
=== <span id="createControllerOptions"></span>[https://doc.qt.io/qt-5/qsharedpointer.html QSharedPointer]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]> ShareKit::createControllerOptions() === | |||
ShareKit::createControllerOptions() | |||
Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions] | Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions] | ||
<span id="createFileRecord"></span> | === <span id="createFileRecord"></span>[https://doc.qt.io/qt-5/qsharedpointer.html QSharedPointer]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]> ShareKit::createFileRecord(const [https://doc.qt.io/qt-5/qfileinfo.html QFileInfo] &''fileInfo'') === | ||
Creates a shared "file" record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record, see [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]](). See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.uri] | |||
=== <span id="createUrlRecord"></span>[https://doc.qt.io/qt-5/qsharedpointer.html QSharedPointer]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]> ShareKit::createUrlRecord(const [https://doc.qt.io/qt-5/qurl.html QUrl] &''url'') === | |||
ShareKit::createUrlRecord(const QUrl &url) | |||
Creates a shared record with a given ''url''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | Creates a shared record with a given ''url''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | ||
[[Category:Qt for HarmonyOS]] | |||
Latest revision as of 08:38, 16 September 2026
< Qt for HarmonyOS / qtohosextras doc
QtOhosExtras::ShareKit
The ShareKit to expose Share Kit API. More...
| Header: | #include <ShareKit> |
| qmake: | QT += ohosextras |
| Since: | Qt 5.12.12 |
This namespace was introduced in Qt 5.12.12.
Classes
| class | QOhosShareControllerOptions |
| class | QOhosShareOperationResult |
| class | QOhosSharedRecord |
Types
| enum class | ShareAbilityType { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } |
Functions
| QSharedPointer<QOhosSharedRecord> | createContentRecord(const QMimeType &mimeType, const QString &content) |
| QSharedPointer<QOhosShareControllerOptions> | createControllerOptions() |
| QSharedPointer<QOhosSharedRecord> | createFileRecord(const QFileInfo &fileInfo) |
| QSharedPointer<QOhosSharedRecord> | createUrlRecord(const QUrl &url) |
Detailed Description
Classes
The QOhosShareControllerOptions class is to configure items, such as the preview mode of the shared content, selection mode, and other information, and pop-up window anchor. It determines the display style of the sharing panel. More...
ShareOperationResult wraps Ohos ShareOperationResult interface. More...
The QOhosSharedRecord class represents a record to be shared with other application. More...
Type Documentation
Enumerates system sharing abilities shown on the sharing panel. Used with QOhosShareControllerOptions::setExcludedAbilities() to hide selected abilities from the panel. See ShareAbilityType.
| Constant | Value | Description |
|---|---|---|
QtOhosExtras::ShareKit::ShareAbilityType::CopyToPasteboard
|
0
|
Copy the shared content to the pasteboard. |
QtOhosExtras::ShareKit::ShareAbilityType::SaveToMediaAsset
|
1
|
Save the shared content to the Gallery. |
QtOhosExtras::ShareKit::ShareAbilityType::SaveAsFile
|
2
|
Save the shared content as a file. |
QtOhosExtras::ShareKit::ShareAbilityType::Print
|
3
|
Print the shared content. |
QtOhosExtras::ShareKit::ShareAbilityType::SaveToSuperHub
|
4
|
Save the shared content to SuperHub. |
This enum was introduced or modified in Qt 5.12.12.
Function Documentation
Creates a shared "content" record with a given mimeType and content. Shared record can be created with content (this function) or as a file shared record, see createFileRecord(). See SharedRecord.content
Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See ShareControllerOptions
Creates a shared "file" record with a given fileInfo. Shared record can be created with file (this function) or as a content record, see createContentRecord(). See SharedRecord.uri
Creates a shared record with a given url. See SharedRecord.content