Jump to content

Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace: Difference between revisions

From Qt Wiki
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..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- Source: qtohosextras-sharekit.html -->
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]]
<span id="sharekit-namespace"></span>
 
= ShareKit Namespace =
= ShareKit Namespace =


<span class="small-subtitle">([[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|QtOhosExtras::ShareKit]])<br />
The ShareKit to expose Share Kit API. [[#details|More...]]
</span>


The [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]] to expose Share Kit API. [[#details|More...]]
{| class="wikitable"
 
<div class="table">
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| Header:
! Header:
| class="memItemRight bottomAlign"| <span class="preprocessor">#include </span>
| #include <ShareKit>
|-
|-
| class="memItemLeft rightAlign topAlign"| qmake:
! qmake:
| class="memItemRight bottomAlign"| QT += ohosextras
| QT += ohosextras
|-
|-
| class="memItemLeft rightAlign topAlign"| Since:
! Since:
| class="memItemRight bottomAlign"| Qt 5.12.12
| Qt 5.12.12
|}
|}


</div>
<span id="classes"></span>
<span id="classes"></span>
== Classes ==
== Classes ==


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| 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="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosSharedRecord_Class|QOhosSharedRecord]]''' || The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]]'''
|}
|}


</div>
<span id="types"></span>
<span id="types"></span>
== Types ==
== Types ==


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| enum
| enum || '''[[#ShareAbilityType-enum|ShareAbilityType]]''' || { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#ShareAbilityType-enum|ShareAbilityType]]''' { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }
|}
|}


</div>
<span id="functions"></span>
<span id="functions"></span>
== Functions ==
== Functions ==


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createContentRecord|createContentRecord]]'''(const QMimeType &''mimeType'', const QString &''content'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &amp;''mimeType'', const QString &amp;''content'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> || '''[[#createControllerOptions|createControllerOptions]]'''()
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''()
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createFileRecord|createFileRecord]]'''(const QFileInfo &''fileInfo'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &amp;''fileInfo'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> || '''[[#createUrlRecord|createUrlRecord]]'''(const QUrl &''url'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &amp;''url'')
|}
|}


== Detailed Description ==


</div>
<span id="details"></span>
<span id="details"></span>
The ShareKit to expose Share Kit API.


<div class="descr">
<span id="details"></span>
== Detailed Description ==
The [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]] to expose Share Kit API.
</div>
<div class="classes">
<span id="classes-1"></span>
== Classes ==
<span id="class-qohossharecontrolleroptions"></span>
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|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. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions]. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class#details|More...]]
<span id="class-qohossharedrecord"></span>
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] class represents a record to be shared with other application. A record can be created using. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#details|More...]]
</div>
<div class="types">
<span id="type-documentation"></span>
== Type Documentation ==
== Type Documentation ==


<span id="ShareAbilityType-enum"></span>
=== <span id="ShareAbilityType-enum"></span>enum ShareKit::ShareAbilityType ===
=== <span id="ShareAbilityType-enum"></span>enum ShareKit::<span class="name">ShareAbilityType</span> ===




</div>
<div class="func">


<span id="function-documentation"></span>
== Function Documentation ==
== Function Documentation ==


<span id="createContentRecord"></span>
=== <span id="createContentRecord"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content) ===
=== createContentRecord ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content)
</syntaxhighlight>


Creates a shared &quot;content&quot; 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 "content" record with a given ''mimeType'' and ''content''. Shared record can be created with content (this function) or as a file shared record


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() and ..
'''See also:''' QtOhosExtras::ShareKit::createFileRecord().
 
<span id="createControllerOptions"></span>
=== createControllerOptions ===


<syntaxhighlight lang="cpp">
=== <span id="createControllerOptions"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> ShareKit::createControllerOptions() ===
QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions>
ShareKit::createControllerOptions()
</syntaxhighlight>


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>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createFileRecord(const QFileInfo &fileInfo) ===
=== createFileRecord ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createFileRecord(const QFileInfo &fileInfo)
</syntaxhighlight>


Creates a shared &quot;file&quot; record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record
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() and ..
'''See also:''' QtOhosExtras::ShareKit::createContentRecord().
 
<span id="createUrlRecord"></span>
=== createUrlRecord ===


<syntaxhighlight lang="cpp">
=== <span id="createUrlRecord"></span>QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createUrlRecord(const QUrl &url) ===
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createUrlRecord(const QUrl &url)
</syntaxhighlight>


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]]
</div>

Latest revision as of 03:54, 29 January 2026

< Qt for HarmonyOS / qtohosextras doc

ShareKit Namespace

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

enum ShareKit::ShareAbilityType

Function Documentation

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

See SharedRecord.content

See also: QtOhosExtras::ShareKit::createFileRecord().

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 ShareControllerOptions

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createFileRecord(const 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 SharedRecord.uri

See also: QtOhosExtras::ShareKit::createContentRecord().

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createUrlRecord(const QUrl &url)

Creates a shared record with a given url. See SharedRecord.content