Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace
< 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