Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
< | < [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]] | ||
= ShareKit Namespace = | = ShareKit Namespace = | ||
The ShareKit to expose Share Kit API. [[#details|More...]] | |||
The | |||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
! Header: | |||
| | | #include <ShareKit> | ||
|- | |- | ||
! qmake: | |||
| QT += ohosextras | |||
|- | |- | ||
! Since: | |||
| Qt 5.12.12 | |||
|} | |} | ||
== Classes == | == Classes == | ||
{| class="wikitable" style="width:100%" | |||
|- | |- | ||
| class | | class || '''[[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. | ||
|- | |- | ||
| class | | class || '''[[QOhosSharedRecord_Class|QOhosSharedRecord]]''' || The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. | ||
|} | |} | ||
== Types == | == Types == | ||
{| class="wikitable" style="width:100%" | |||
|- | |- | ||
| enum || '''[[#ShareAbilityType-enum|ShareAbilityType]]''' || { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } | |||
| | |||
|} | |} | ||
== Functions == | == Functions == | ||
{| class="wikitable" style="width:100%" | |||
|- | |- | ||
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createContentRecord|createContentRecord]]'''(const QMimeType &''mimeType'', const QString &''content'') | |||
| | |||
|- | |- | ||
| QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> || '''[[#createControllerOptions|createControllerOptions]]'''() | |||
| | |||
|- | |- | ||
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createFileRecord|createFileRecord]]'''(const QFileInfo &''fileInfo'') | |||
| | |||
|- | |- | ||
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createUrlRecord|createUrlRecord]]'''(const QUrl &''url'') | |||
| | |||
|} | |} | ||
== Detailed Description == | |||
<span id="details"></span> | <span id="details"></span> | ||
The ShareKit to expose Share Kit API. | |||
== Type Documentation == | |||
<span id=" | === <span id="ShareAbilityType-enum"></span>enum ShareKit::ShareAbilityType === | ||
== Function Documentation == | == Function Documentation == | ||
=== createContentRecord === | === <span id="createContentRecord"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content) === | ||
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 | |||
Creates a shared | |||
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | ||
'''See also''' QtOhosExtras::ShareKit::createFileRecord() | '''See also:''' QtOhosExtras::ShareKit::createFileRecord(). | ||
< | === <span id="createControllerOptions"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> ShareKit::createControllerOptions() === | ||
QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> | |||
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>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createFileRecord(const QFileInfo &fileInfo) === | ||
< | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | |||
ShareKit::createFileRecord(const QFileInfo &fileInfo) | |||
Creates a shared | Creates a shared "file" record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record | ||
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.uri] | See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.uri] | ||
'''See also''' QtOhosExtras::ShareKit::createContentRecord() | '''See also:''' QtOhosExtras::ShareKit::createContentRecord(). | ||
=== | === <span id="createUrlRecord"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createUrlRecord(const QUrl &url) === | ||
< | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | |||
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 03:54, 29 January 2026
< Qt for HarmonyOS / qtohosextras doc
The ShareKit to expose Share Kit API. More...
| Header: | #include <ShareKit> |
|---|---|
| qmake: | QT += ohosextras |
| Since: | Qt 5.12.12 |
Classes
| 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. |
| class | QOhosSharedRecord | The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. |
Types
| enum | ShareAbilityType | { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } |
Functions
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | createContentRecord(const QMimeType &mimeType, const QString &content) |
| QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> | createControllerOptions() |
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | createFileRecord(const QFileInfo &fileInfo) |
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | createUrlRecord(const QUrl &url) |
Detailed Description
The ShareKit to expose Share Kit API.
Type Documentation
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 also: QtOhosExtras::ShareKit::createFileRecord().
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 SharedRecord.uri
See also: QtOhosExtras::ShareKit::createContentRecord().
Creates a shared record with a given url. See SharedRecord.content