Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace: Difference between revisions
No edit summary |
Update from qdoc output (QTFOROH-2307) |
||
| Line 2: | Line 2: | ||
= ShareKit Namespace = | = ShareKit Namespace = | ||
QtOhosExtras::ShareKit | |||
The ShareKit to expose Share Kit API. [[#details|More...]] | The ShareKit to expose Share Kit API. [[#details|More...]] | ||
| Line 7: | Line 9: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Header: | |||
| #include <ShareKit> | | #include <ShareKit> | ||
|- | |- | ||
| qmake: | |||
| QT += ohosextras | | QT += ohosextras | ||
|- | |- | ||
| Since: | |||
| Qt 5.12.12 | | Qt 5.12.12 | ||
|} | |} | ||
This namespace was introduced in Qt 5.12.12. | |||
== Classes == | == Classes == | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |||
| class | |||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]''' | |||
|- | |- | ||
| class | | class | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareOperationResult_Class|QOhosShareOperationResult]]''' | |||
|- | |- | ||
| class | | class | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]''' | |||
|} | |} | ||
== Types == | == Types == | ||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
| enum | | enum class | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#ShareAbilityType-enum|ShareAbilityType]]''' { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } | |||
|} | |} | ||
== Functions == | == Functions == | ||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
| QSharedPointer< | | QSharedPointer<QOhosSharedRecord> | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &''mimeType'', const QString &''content'') | |||
|- | |- | ||
| QSharedPointer< | | QSharedPointer<QOhosShareControllerOptions> | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''() | |||
|- | |- | ||
| QSharedPointer< | | QSharedPointer<QOhosSharedRecord> | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &''fileInfo'') | |||
|- | |- | ||
| QSharedPointer< | | QSharedPointer<QOhosSharedRecord> | ||
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &''url'') | |||
|} | |} | ||
== Detailed Description == | == Detailed Description == | ||
== Classes == | |||
The | |||
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] === | |||
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]] === | |||
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 == | |||
== | === <span id="ShareAbilityType-enum"></span>enum class ShareKit::ShareAbilityType === | ||
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 == | |||
=== <span id=" | === <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'') === | ||
Creates a | 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=" | === <span id="createControllerOptions"></span>[https://doc.qt.io/qt-5/qsharedpointer.html QSharedPointer]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]> ShareKit::createControllerOptions() === | ||
Creates a | 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>[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>QSharedPointer< | === <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'') === | ||
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]] | [[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