Jump to content

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="memItemRight bottomAlign"| <span class="preprocessor">#include </span> |-..."
 
No edit summary
Line 3: Line 3:
= ShareKit Namespace =
= ShareKit Namespace =


<span class="small-subtitle">([[ShareKit_Namespace|QtOhosExtras::ShareKit]])<br />
<span class="small-subtitle">([[ShareKit Namespace|QtOhosExtras::ShareKit]])<br />
</span>
</span>


The [[ShareKit_Namespace|ShareKit]] to expose Share Kit API. [[#details|More...]]
The [[ShareKit Namespace|ShareKit]] to expose Share Kit API. [[#details|More...]]


<div class="table">
<div class="table">
Line 36: Line 36:
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class="memItemLeft rightAlign topAlign"| class
| class="memItemRight bottomAlign"| '''[[QOhosShareControllerOptions_Class|QOhosShareControllerOptions]]'''
| class="memItemRight bottomAlign"| '''[[QOhosShareControllerOptions Class|QOhosShareControllerOptions]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class="memItemLeft rightAlign topAlign"| class
| class="memItemRight bottomAlign"| '''[[QOhosSharedRecord_Class|QOhosSharedRecord]]'''
| class="memItemRight bottomAlign"| '''[[QOhosSharedRecord Class|QOhosSharedRecord]]'''
|}
|}


Line 54: Line 54:
|-
|-
| class="memItemLeft rightAlign topAlign"| enum
| class="memItemLeft rightAlign topAlign"| enum
| class="memItemRight bottomAlign"| '''[[ShareKit_Namespace#ShareAbilityType-enum|ShareAbilityType]]''' { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }
| class="memItemRight bottomAlign"| '''[[ShareKit Namespace#ShareAbilityType-enum|ShareAbilityType]]''' { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }
|}
|}


Line 69: Line 69:
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemRight bottomAlign"| '''[[ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &amp;''mimeType'', const QString &amp;''content'')
| class="memItemRight bottomAlign"| '''[[ShareKit Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &amp;''mimeType'', const QString &amp;''content'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemRight bottomAlign"| '''[[ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''()
| class="memItemRight bottomAlign"| '''[[ShareKit Namespace#createControllerOptions|createControllerOptions]]'''()
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemRight bottomAlign"| '''[[ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &amp;''fileInfo'')
| class="memItemRight bottomAlign"| '''[[ShareKit Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &amp;''fileInfo'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemRight bottomAlign"| '''[[ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &amp;''url'')
| class="memItemRight bottomAlign"| '''[[ShareKit Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &amp;''url'')
|}
|}


Line 90: Line 90:
== Detailed Description ==
== Detailed Description ==


The [[ShareKit_Namespace|ShareKit]] to expose Share Kit API.
The [[ShareKit Namespace|ShareKit]] to expose Share Kit API.




Line 100: Line 100:


<span id="class-qohossharecontrolleroptions"></span>
<span id="class-qohossharecontrolleroptions"></span>
=== class [[QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] ===
=== class [[QOhosShareControllerOptions Class|QOhosShareControllerOptions]] ===


The [[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]. [[QOhosShareControllerOptions_Class#details|More...]]
The [[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]. [[QOhosShareControllerOptions Class#details|More...]]


<span id="class-qohossharedrecord"></span>
<span id="class-qohossharedrecord"></span>
=== class [[QOhosSharedRecord_Class|QOhosSharedRecord]] ===
=== class [[QOhosSharedRecord Class|QOhosSharedRecord]] ===


The [[QOhosSharedRecord_Class|QOhosSharedRecord]] class represents a record to be shared with other application. A record can be created using. [[QOhosSharedRecord_Class#details|More...]]
The [[QOhosSharedRecord Class|QOhosSharedRecord]] class represents a record to be shared with other application. A record can be created using. [[QOhosSharedRecord Class#details|More...]]




Line 127: Line 127:


<span id="createContentRecord"></span>
<span id="createContentRecord"></span>
=== <span id="createContentRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord_Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createContentRecord</span>(const <span class="type">[[../qtcore/qmimetype.html|QMimeType]]</span> &amp;''mimeType'', const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''content'') ===
=== <span id="createContentRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createContentRecord</span>(const <span class="type">[[../qtcore/qmimetype.html|QMimeType]]</span> &amp;''mimeType'', const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''content'') ===


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 &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
Line 136: Line 136:


<span id="createControllerOptions"></span>
<span id="createControllerOptions"></span>
=== <span id="createControllerOptions"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosShareControllerOptions_Class|QtOhosExtras::ShareKit::QOhosShareControllerOptions]]</span>&gt; ShareKit::<span class="name">createControllerOptions</span>() ===
=== <span id="createControllerOptions"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosShareControllerOptions Class|QtOhosExtras::ShareKit::QOhosShareControllerOptions]]</span>&gt; ShareKit::<span class="name">createControllerOptions</span>() ===


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>
=== <span id="createFileRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord_Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createFileRecord</span>(const <span class="type">[[../qtcore/qfileinfo.html|QFileInfo]]</span> &amp;''fileInfo'') ===
=== <span id="createFileRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createFileRecord</span>(const <span class="type">[[../qtcore/qfileinfo.html|QFileInfo]]</span> &amp;''fileInfo'') ===


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 &quot;file&quot; record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record
Line 150: Line 150:


<span id="createUrlRecord"></span>
<span id="createUrlRecord"></span>
=== <span id="createUrlRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord_Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createUrlRecord</span>(const <span class="type">[[../qtcore/qurl.html|QUrl]]</span> &amp;''url'') ===
=== <span id="createUrlRecord"></span><span class="type">[[../qtcore/qsharedpointer.html|QSharedPointer]]</span>&lt;<span class="type">[[QOhosSharedRecord Class|QtOhosExtras::ShareKit::QOhosSharedRecord]]</span>&gt; ShareKit::<span class="name">createUrlRecord</span>(const <span class="type">[[../qtcore/qurl.html|QUrl]]</span> &amp;''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]

Revision as of 05:55, 28 January 2026

ShareKit Namespace

(QtOhosExtras::ShareKit)

The ShareKit to expose Share Kit API. More...

Header: #include
qmake: QT += ohosextras
Since: Qt 5.12.12



Classes

Types

enum ShareAbilityType { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }


Functions

QSharedPointer createContentRecord(const QMimeType &mimeType, const QString &content)
QSharedPointer createControllerOptions()
QSharedPointer createFileRecord(const QFileInfo &fileInfo)
QSharedPointer createUrlRecord(const QUrl &url)


Detailed Description

The ShareKit to expose Share Kit API.


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. See ShareControllerOptions. More...

class QOhosSharedRecord

The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. More...


Type Documentation

enum ShareKit::ShareAbilityType

Function Documentation

[[../qtcore/qsharedpointer.html|QSharedPointer]]<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createContentRecord(const [[../qtcore/qmimetype.html|QMimeType]] &mimeType, const [[../qtcore/qstring.html|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() and ..

[[../qtcore/qsharedpointer.html|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

[[../qtcore/qsharedpointer.html|QSharedPointer]]<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createFileRecord(const [[../qtcore/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 SharedRecord.uri

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

[[../qtcore/qsharedpointer.html|QSharedPointer]]<QtOhosExtras::ShareKit::QOhosSharedRecord> ShareKit::createUrlRecord(const [[../qtcore/qurl.html|QUrl]] &url)

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