Jump to content

Qt for HarmonyOS/qtohosextras doc/QOhosSharedRecord Class: Difference between revisions

From Qt Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
(QtOhosExtras::ShareKit::QOhosSharedRecord)
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]]
 
= QOhosSharedRecord Class =
 
The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. [[#details|More...]]


The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. More...
{| class="wikitable"
{| class="wikitable"
|Header:
|#include <QOhosSharedRecord>
|-
|-
|qmake:
! Header:
|QT += ohosextras
| #include <QOhosSharedRecord>
|-
! qmake:
| QT += ohosextras
|-
|-
|Since:
! Since:
|Qt 5.12.12
| Qt 5.12.12
|}
|}


* List of all members, including inherited members
* [[List_of_All_Members_for_QOhosSharedRecord|List of all members, including inherited members]]


== Public Functions ==
== Public Functions ==
{| class="wikitable"
 
|virtual
{| class="wikitable" style="width:100%"
|'''~QOhosSharedRecord'''()
|-
| virtual || '''[[#dtor.QOhosSharedRecord|~QOhosSharedRecord]]'''()
|-
|-
|virtual QString
| virtual QString || '''[[#content|content]]'''() const = 0
|'''content'''() const = 0
|-
|-
|virtual QString
| virtual QString || '''[[#description|description]]'''() const = 0
|'''description'''() const = 0
|-
|-
|virtual QVariantMap
| virtual QVariantMap || '''[[#extraData|extraData]]'''() const = 0
|'''extraData'''() const = 0
|-
|-
|virtual QString
| virtual QString || '''[[#filePath|filePath]]'''() const = 0
|'''filePath'''() const = 0
|-
|-
|virtual bool
| virtual bool || '''[[#isUrlContent|isUrlContent]]'''() const = 0
|'''isUrlContent'''() const = 0
|-
|-
|virtual QString
| virtual QString || '''[[#label|label]]'''() const = 0
|'''label'''() const = 0
|-
|-
|virtual QMimeType
| virtual QMimeType || '''[[#mimeType|mimeType]]'''() const = 0
|'''mimeType'''() const = 0
|-
|-
|virtual void
| virtual void || '''[[#setDescription|setDescription]]'''(const QString &''description'') = 0
|'''setDescription'''(const QString &''description'') = 0
|-
|-
|virtual void
| virtual void || '''[[#setExtraData|setExtraData]]'''(const QVariantMap &''extraData'') = 0
|'''setExtraData'''(const QVariantMap &''extraData'') = 0
|-
|-
|virtual void
| virtual void || '''[[#setLabel|setLabel]]'''(const QString &''label'') = 0
|'''setLabel'''(const QString &''label'') = 0
|-
|-
|virtual void
| virtual void || '''[[#setThumbnail|setThumbnail]]'''(const QByteArray &''thumbnail'') = 0
|'''setThumbnail'''(const QByteArray &''thumbnail'') = 0
|-
|-
|virtual void
| virtual void || '''[[#setThumbnailFilePath|setThumbnailFilePath]]'''(const QString &''thumbnailFilePath'') = 0
|'''setThumbnailFilePath'''(const QString &''thumbnailFilePath'') = 0
|-
|-
|virtual void
| virtual void || '''[[#setTitle|setTitle]]'''(const QString &''title'') = 0
|'''setTitle'''(const QString &''title'') = 0
|-
|-
|virtual QByteArray
| virtual QByteArray || '''[[#thumbnail|thumbnail]]'''() const = 0
|'''thumbnail'''() const = 0
|-
|-
|virtual QString
| virtual QString || '''[[#thumbnailFilePath|thumbnailFilePath]]'''() const = 0
|'''thumbnailFilePath'''() const = 0
|-
|-
|virtual QString
| virtual QString || '''[[#title|title]]'''() const = 0
|'''title'''() const = 0
|}
|}


== Protected Functions ==
== Protected Functions ==
{| class="wikitable"
 
|
{| class="wikitable" style="width:100%"
|'''QOhosSharedRecord'''()
|-
| || '''[[#QOhosSharedRecord|QOhosSharedRecord]]'''()
|}
|}


== Detailed Description ==
== Detailed Description ==
<span id="details"></span>
The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using
The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using


See SharedRecord.
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord].


'''See also''' QtOhosExtras::ShareKit::createContentRecord(), QtOhosExtras::ShareKit::createFileRecord(), or, QtOhosExtras::ShareKit::createUrlRecord(), and ..
'''See also:''' [[ShareKit_Namespace#createContentRecord|ShareKit::createContentRecord()]], [[ShareKit_Namespace#createFileRecord|ShareKit::createFileRecord()]], or [[ShareKit_Namespace#createUrlRecord|ShareKit::createUrlRecord()]].


== Member Function Documentation ==
== Member Function Documentation ==


=== [protected] QOhosSharedRecord::QOhosSharedRecord() ===
=== <span id="QOhosSharedRecord"></span>[protected] QOhosSharedRecord::QOhosSharedRecord() ===
 
Default constructs an instance of QOhosSharedRecord.
Default constructs an instance of QOhosSharedRecord.


=== [virtual] QOhosSharedRecord::~QOhosSharedRecord() ===
=== <span id="dtor.QOhosSharedRecord"></span>[virtual] QOhosSharedRecord::~QOhosSharedRecord() ===
 
Destroys the instance of QOhosSharedRecord. The destructor is virtual.
Destroys the instance of QOhosSharedRecord. The destructor is virtual.


=== [pure virtual] QString QOhosSharedRecord::content() const ===
=== <span id="content"></span>[pure virtual] QString QOhosSharedRecord::content() const ===
Gets the shared record optional content. Either content or file path must be set. If there is no content null string is provided. See SharedRecord.content
 
Gets the shared record optional content. Either content or file path must be set. If there is no content null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content].
 
=== <span id="description"></span>[pure virtual] QString QOhosSharedRecord::description() const ===
 
Gets the optional description of the shared record. If there is no description null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.description].
 
'''See also:''' [[#setDescription|setDescription()]].
 
=== <span id="extraData"></span>[pure virtual] QVariantMap QOhosSharedRecord::extraData() const ===
 
Gets the optional extra data of the shared record. If there is no extra data empty variant map is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.extraData].
 
'''See also:''' [[#setExtraData|setExtraData()]].
 
=== <span id="filePath"></span>[pure virtual] QString QOhosSharedRecord::filePath() const ===
 
Gets the shared record optional file path. Either content or file path must be set. If there is no file path null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content].
 
=== <span id="isUrlContent"></span>[pure virtual] bool QOhosSharedRecord::isUrlContent() const ===
 
Provides information if [[#content|content()]] contains URL string. For URL content the [[#mimeType|mimeType()]] should not be used. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content].
 
=== <span id="label"></span>[pure virtual] QString QOhosSharedRecord::label() const ===
 
Gets the optional label of the shared record. If there is no label null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.label].
 
'''See also:''' [[#setLabel|setLabel()]].
 
=== <span id="mimeType"></span>[pure virtual] QMimeType QOhosSharedRecord::mimeType() const ===
 
Gets the shared record associated mime type. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.utd].
 
=== <span id="setDescription"></span>[pure virtual] void QOhosSharedRecord::setDescription(const QString &''description'') ===


=== [pure virtual] QString QOhosSharedRecord::description() const ===
Sets data record description with a given ''description''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.description].
Gets the optional description of the shared record. If there is no description null string is provided. See SharedRecord.description


'''See also''' setDescription().
'''See also:''' [[#description|description()]].


=== [pure virtual] QVariantMap QOhosSharedRecord::extraData() const ===
=== <span id="setExtraData"></span>[pure virtual] void QOhosSharedRecord::setExtraData(const QVariantMap &''extraData'') ===
Gets the optional extra data of the shared record. If there is no extra data empty variant map is provided. See SharedRecord.extraData


'''See also''' setExtraData().
Sets extra data for sharing with a given ''extraData''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.extraData].


=== [pure virtual] QString QOhosSharedRecord::filePath() const ===
'''See also:''' [[#extraData|extraData()]].
Gets the shared record optional file path. Either content or file path must be set. If there is no file path null string is provided. See SharedRecord.content


=== [pure virtual] bool QOhosSharedRecord::isUrlContent() const ===
=== <span id="setLabel"></span>[pure virtual] void QOhosSharedRecord::setLabel(const QString &''label'') ===
Provides information if content() contains URL string. For URL content the mimeType() should not be used. See SharedRecord.content


=== [pure virtual] QString QOhosSharedRecord::label() const ===
Sets the label indicating the current data record type with a given ''label''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.label].
Gets the optional label of the shared record. If there is no label null string is provided. See SharedRecord.label


'''See also''' setLabel().
'''See also:''' [[#label|label()]].


=== [pure virtual] QMimeType QOhosSharedRecord::mimeType() const ===
=== <span id="setThumbnail"></span>[pure virtual] void QOhosSharedRecord::setThumbnail(const QByteArray &''thumbnail'') ===
Gets the shared record associated mime type. See SharedRecord.utd


=== [pure virtual] void QOhosSharedRecord::setDescription(const QString &''description'') ===
Sets data record thumbnail with a given ''thumbnail''. The thumbnail is an image file content. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnail].
Sets data record description with a given ''description''. See SharedRecord.description


'''See also''' description().
'''See also:''' [[#thumbnail|thumbnail()]].


=== [pure virtual] void QOhosSharedRecord::setExtraData(const QVariantMap &''extraData'') ===
=== <span id="setThumbnailFilePath"></span>[pure virtual] void QOhosSharedRecord::setThumbnailFilePath(const QString &''thumbnailFilePath'') ===
Sets exatra data for sharing with a given ''extraData''. See SharedRecord.extraData


'''See also''' extraData().
Sets data record thumbnail uri with a given ''thumbnailFilePath''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnailUri].


=== [pure virtual] void QOhosSharedRecord::setLabel(const QString &''label'') ===
'''See also:''' [[#thumbnailFilePath|thumbnailFilePath()]].
Sets the label indicating the current data record type with a given ''label''. See SharedRecord.label


'''See also''' label().
=== <span id="setTitle"></span>[pure virtual] void QOhosSharedRecord::setTitle(const QString &''title'') ===


=== [pure virtual] void QOhosSharedRecord::setThumbnail(const QByteArray &''thumbnail'') ===
Sets the title of shared content with a given ''title''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.title].
Sets data record thumbnail with a given ''thumbnail''. The thumbnail is an image file content. See SharedRecord.thumbnail


'''See also''' thumbnail().
'''See also:''' [[#title|title()]].


=== [pure virtual] void QOhosSharedRecord::setThumbnailFilePath(const QString &''thumbnailFilePath'') ===
=== <span id="thumbnail"></span>[pure virtual] QByteArray QOhosSharedRecord::thumbnail() const ===
Sets data record thumbnail uri with a given ''thumbnailFilePath''. See SharedRecord.thumbnailUri


'''See also''' thumbnailFilePath().
Gets the optional thumbnail content of the shared record. If there is no thumbnail empty byte array is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnail].


=== [pure virtual] void QOhosSharedRecord::setTitle(const QString &''title'') ===
'''See also:''' [[#setThumbnail|setThumbnail()]].
Sets the title of shared content with a given ''title''. See SharedRecord.title


'''See also''' title().
=== <span id="thumbnailFilePath"></span>[pure virtual] QString QOhosSharedRecord::thumbnailFilePath() const ===


=== [pure virtual] QByteArray QOhosSharedRecord::thumbnail() const ===
Gets the optional thumbnail file path of the shared record. If there is no thumbnail file path null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnailFilePath].
Gets the optional thumbnail content of the shared record. If there is no thumbnail empty byte array is provided. See SharedRecord.thumbnail


'''See also''' setThumbnail().
'''See also:''' [[#setThumbnailFilePath|setThumbnailFilePath()]].


=== [pure virtual] QString QOhosSharedRecord::thumbnailFilePath() const ===
=== <span id="title"></span>[pure virtual] QString QOhosSharedRecord::title() const ===
Gets the optional thumbnail file path of the shared record. If there is no thumbnail file path null string is provided. See SharedRecord.thumbnailFilePath


'''See also''' setThumbnailFilePath().
Gets the optional title of the shared record. If there is no title null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.title].


=== [pure virtual] QString QOhosSharedRecord::title() const ===
'''See also:''' [[#setTitle|setTitle()]].
Gets the optional title of the shared record. If there is no title null string is provided. See SharedRecord.title


'''See also''' setTitle().
[[Category:Qt for HarmonyOS]]

Latest revision as of 06:28, 29 January 2026

< Qt for HarmonyOS / qtohosextras doc

QOhosSharedRecord Class

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

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

Public Functions

virtual ~QOhosSharedRecord()
virtual QString content() const = 0
virtual QString description() const = 0
virtual QVariantMap extraData() const = 0
virtual QString filePath() const = 0
virtual bool isUrlContent() const = 0
virtual QString label() const = 0
virtual QMimeType mimeType() const = 0
virtual void setDescription(const QString &description) = 0
virtual void setExtraData(const QVariantMap &extraData) = 0
virtual void setLabel(const QString &label) = 0
virtual void setThumbnail(const QByteArray &thumbnail) = 0
virtual void setThumbnailFilePath(const QString &thumbnailFilePath) = 0
virtual void setTitle(const QString &title) = 0
virtual QByteArray thumbnail() const = 0
virtual QString thumbnailFilePath() const = 0
virtual QString title() const = 0

Protected Functions

QOhosSharedRecord()

Detailed Description

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

See SharedRecord.

See also: ShareKit::createContentRecord(), ShareKit::createFileRecord(), or ShareKit::createUrlRecord().

Member Function Documentation

[protected] QOhosSharedRecord::QOhosSharedRecord()

Default constructs an instance of QOhosSharedRecord.

[virtual] QOhosSharedRecord::~QOhosSharedRecord()

Destroys the instance of QOhosSharedRecord. The destructor is virtual.

[pure virtual] QString QOhosSharedRecord::content() const

Gets the shared record optional content. Either content or file path must be set. If there is no content null string is provided. See SharedRecord.content.

[pure virtual] QString QOhosSharedRecord::description() const

Gets the optional description of the shared record. If there is no description null string is provided. See SharedRecord.description.

See also: setDescription().

[pure virtual] QVariantMap QOhosSharedRecord::extraData() const

Gets the optional extra data of the shared record. If there is no extra data empty variant map is provided. See SharedRecord.extraData.

See also: setExtraData().

[pure virtual] QString QOhosSharedRecord::filePath() const

Gets the shared record optional file path. Either content or file path must be set. If there is no file path null string is provided. See SharedRecord.content.

[pure virtual] bool QOhosSharedRecord::isUrlContent() const

Provides information if content() contains URL string. For URL content the mimeType() should not be used. See SharedRecord.content.

[pure virtual] QString QOhosSharedRecord::label() const

Gets the optional label of the shared record. If there is no label null string is provided. See SharedRecord.label.

See also: setLabel().

[pure virtual] QMimeType QOhosSharedRecord::mimeType() const

Gets the shared record associated mime type. See SharedRecord.utd.

[pure virtual] void QOhosSharedRecord::setDescription(const QString &description)

Sets data record description with a given description. See SharedRecord.description.

See also: description().

[pure virtual] void QOhosSharedRecord::setExtraData(const QVariantMap &extraData)

Sets extra data for sharing with a given extraData. See SharedRecord.extraData.

See also: extraData().

[pure virtual] void QOhosSharedRecord::setLabel(const QString &label)

Sets the label indicating the current data record type with a given label. See SharedRecord.label.

See also: label().

[pure virtual] void QOhosSharedRecord::setThumbnail(const QByteArray &thumbnail)

Sets data record thumbnail with a given thumbnail. The thumbnail is an image file content. See SharedRecord.thumbnail.

See also: thumbnail().

[pure virtual] void QOhosSharedRecord::setThumbnailFilePath(const QString &thumbnailFilePath)

Sets data record thumbnail uri with a given thumbnailFilePath. See SharedRecord.thumbnailUri.

See also: thumbnailFilePath().

[pure virtual] void QOhosSharedRecord::setTitle(const QString &title)

Sets the title of shared content with a given title. See SharedRecord.title.

See also: title().

[pure virtual] QByteArray QOhosSharedRecord::thumbnail() const

Gets the optional thumbnail content of the shared record. If there is no thumbnail empty byte array is provided. See SharedRecord.thumbnail.

See also: setThumbnail().

[pure virtual] QString QOhosSharedRecord::thumbnailFilePath() const

Gets the optional thumbnail file path of the shared record. If there is no thumbnail file path null string is provided. See SharedRecord.thumbnailFilePath.

See also: setThumbnailFilePath().

[pure virtual] QString QOhosSharedRecord::title() const

Gets the optional title of the shared record. If there is no title null string is provided. See SharedRecord.title.

See also: setTitle().