QNdefNfcSmartPosterRecord Class

The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster. 更多...

头: #include <QNdefNfcSmartPosterRecord>
CMake: find_package(Qt6 REQUIRED COMPONENTS Nfc)
target_link_libraries(mytarget PRIVATE Qt6::Nfc)
qmake: QT += nfc
Since: Qt 5.2
继承: QNdefRecord

公共类型

enum 动作 { UnspecifiedAction, DoAction, SaveAction, EditAction }

公共函数

QNdefNfcSmartPosterRecord ()
QNdefNfcSmartPosterRecord (const QNdefRecord & other )
QNdefNfcSmartPosterRecord (const QNdefNfcSmartPosterRecord & other )
~QNdefNfcSmartPosterRecord ()
QNdefNfcSmartPosterRecord::Action action () const
void addIcon (const QNdefNfcIconRecord & icon )
void addIcon (const QByteArray & type , const QByteArray & data )
bool addTitle (const QNdefNfcTextRecord & text )
bool addTitle (const QString & text , const QString & locale , QNdefNfcTextRecord::Encoding encoding )
bool hasAction () const
bool hasIcon (const QByteArray & mimetype = QByteArray()) const
bool hasSize () const
bool hasTitle (const QString & locale = QString()) const
bool hasTypeInfo () const
QByteArray icon (const QByteArray & mimetype = QByteArray()) const
qsizetype iconCount () const
QNdefNfcIconRecord iconRecord (qsizetype index ) const
QList<QNdefNfcIconRecord> iconRecords () const
bool removeIcon (const QNdefNfcIconRecord & icon )
bool removeIcon (const QByteArray & type )
bool removeTitle (const QNdefNfcTextRecord & text )
bool removeTitle (const QString & locale )
void setAction (QNdefNfcSmartPosterRecord::Action act )
void setIcons (const QList<QNdefNfcIconRecord> & icons )
void setSize (quint32 size )
void setTitles (const QList<QNdefNfcTextRecord> & titles )
void setTypeInfo (const QString & type )
void setUri (const QNdefNfcUriRecord & url )
void setUri (const QUrl & url )
quint32 size () const
QString title (const QString & locale = QString()) const
qsizetype titleCount () const
QNdefNfcTextRecord titleRecord (qsizetype index ) const
QList<QNdefNfcTextRecord> titleRecords () const
QString typeInfo () const
QUrl uri () const
QNdefNfcUriRecord uriRecord () const
QNdefNfcSmartPosterRecord & operator= (const QNdefNfcSmartPosterRecord & other )

详细描述

RTD-SmartPoster encapsulates a Smart Poster.

成员类型文档编制

enum QNdefNfcSmartPosterRecord:: 动作

This enum describes the course of action that a device should take with the content.

常量 描述
QNdefNfcSmartPosterRecord::UnspecifiedAction -1 The action is not defined.
QNdefNfcSmartPosterRecord::DoAction 0 Do the action (send the SMS, launch the browser, make the telephone call).
QNdefNfcSmartPosterRecord::SaveAction 1 Save for later (store the SMS in INBOX, put the URI in a bookmark, save the telephone number in contacts).
QNdefNfcSmartPosterRecord::EditAction 2 Open for editing (open an SMS in the SMS editor, open the URI in a URI editor, open the telephone number for editing).

成员函数文档编制

QNdefNfcSmartPosterRecord:: QNdefNfcSmartPosterRecord ()

Constructs a new empty smart poster.

QNdefNfcSmartPosterRecord:: QNdefNfcSmartPosterRecord (const QNdefRecord & other )

Constructs a new smart poster that is a copy of other .

QNdefNfcSmartPosterRecord:: QNdefNfcSmartPosterRecord (const QNdefNfcSmartPosterRecord & other )

Constructs a new smart poster that is a copy of other .

QNdefNfcSmartPosterRecord:: ~QNdefNfcSmartPosterRecord ()

Destroys the smart poster.

QNdefNfcSmartPosterRecord::Action QNdefNfcSmartPosterRecord:: action () const

Returns the action from the action record if available. Otherwise UnspecifiedAction 被返回。

另请参阅 setAction ().

void QNdefNfcSmartPosterRecord:: addIcon (const QNdefNfcIconRecord & icon )

Adds an icon record icon to the smart poster. If the smart poster already contains an icon record with the same type then the existing icon record is replaced.

void QNdefNfcSmartPosterRecord:: addIcon (const QByteArray & type , const QByteArray & data )

Adds an icon record with type type and data data to the smart poster. If the smart poster already contains an icon record with the same type then the existing icon record is replaced.

bool QNdefNfcSmartPosterRecord:: addTitle (const QNdefNfcTextRecord & text )

Attempts to add a title record text to the smart poster. If the smart poster does not already contain a title record with the same locale as title record text , then the title record is added and the function returns true . Otherwise false 被返回。

bool QNdefNfcSmartPosterRecord:: addTitle (const QString & text , const QString & locale , QNdefNfcTextRecord::Encoding encoding )

Attempts to add a new title record with title text , locale locale 和编码 encoding . If the smart poster does not already contain a title record with locale locale , then the title record is added and the function returns true . Otherwise false 被返回。

bool QNdefNfcSmartPosterRecord:: hasAction () const

返回 true if the smart poster contains an action record, otherwise returns false .

bool QNdefNfcSmartPosterRecord:: hasIcon (const QByteArray & mimetype = QByteArray()) const

返回 true if the smart poster contains an icon record using the type mimetype 。若 mimetype is empty, then true is returned if the smart poster contains at least one icon record. In all other cases, false 被返回。

bool QNdefNfcSmartPosterRecord:: hasSize () const

返回 true if the smart poster contains a size record, otherwise returns false .

bool QNdefNfcSmartPosterRecord:: hasTitle (const QString & locale = QString()) const

返回 true if the smart poster contains a title record using the locale locale 。若 locale is empty, then true is returned if the smart poster contains at least one title record. In all other cases, false 被返回。

bool QNdefNfcSmartPosterRecord:: hasTypeInfo () const

返回 true if the smart poster contains a type record, otherwise returns false .

QByteArray QNdefNfcSmartPosterRecord:: icon (const QByteArray & mimetype = QByteArray()) const

Returns the associated icon record data if the smart poster contains an icon record with MIME type mimetype 。若 mimetype is omitted or empty then the first icon's record data is returned. In all other cases, an empty array is returned.

qsizetype QNdefNfcSmartPosterRecord:: iconCount () const

Returns the number of icon records contained inside the smart poster.

QNdefNfcIconRecord QNdefNfcSmartPosterRecord:: iconRecord ( qsizetype index ) const

Returns the icon record corresponding to the index index inside the smart poster, where index is a value between 0 and iconCount () - 1. Values outside of this range return an empty record.

QList < QNdefNfcIconRecord > QNdefNfcSmartPosterRecord:: iconRecords () const

Returns a copy of all icon records inside the smart poster.

bool QNdefNfcSmartPosterRecord:: removeIcon (const QNdefNfcIconRecord & icon )

Attempts to remove the icon record icon from the smart poster. Removes the record and returns true if the smart poster contains a matching record, otherwise false 被返回。

bool QNdefNfcSmartPosterRecord:: removeIcon (const QByteArray & type )

Attempts to remove the icon record with the type type from the smart poster. Removes the record and returns true if the smart poster contains a matching record, otherwise false 被返回。

bool QNdefNfcSmartPosterRecord:: removeTitle (const QNdefNfcTextRecord & text )

Attempts to remove the title record text from the smart poster. Removes the record and returns true if the smart poster contains a matching record, otherwise false 被返回。

bool QNdefNfcSmartPosterRecord:: removeTitle (const QString & locale )

Attempts to remove a title record with the locale locale from the smart poster. Removes the record and returns true if the smart poster contains a matching record, otherwise false 被返回。

void QNdefNfcSmartPosterRecord:: setAction ( QNdefNfcSmartPosterRecord::Action act )

Sets the action record to act

另请参阅 action ().

void QNdefNfcSmartPosterRecord:: setIcons (const QList < QNdefNfcIconRecord > & icons )

Adds the icon record list icons to the smart poster. Any existing records are overwritten.

另请参阅 hasIcon () 和 icon ().

void QNdefNfcSmartPosterRecord:: setSize ( quint32 size )

Sets the record size . The value contains the size in bytes of the object that the URI refers to.

另请参阅 size () 和 hasSize ().

void QNdefNfcSmartPosterRecord:: setTitles (const QList < QNdefNfcTextRecord > & titles )

Adds the title record list titles to the smart poster. Any existing records are overwritten.

void QNdefNfcSmartPosterRecord:: setTypeInfo (const QString & type )

Sets the type record to type . type describes the type of the object referenced by uri ().

另请参阅 typeInfo ().

void QNdefNfcSmartPosterRecord:: setUri (const QNdefNfcUriRecord & url )

Sets the URI record to url

另请参阅 uri ().

void QNdefNfcSmartPosterRecord:: setUri (const QUrl & url )

Constructs a URI record and sets its content inside the smart poster to url

quint32 QNdefNfcSmartPosterRecord:: size () const

Returns the size from the size record if available; otherwise returns 0.

The value is optional and contains the size in bytes of the object that the URI refers to. It may be used by the device to determine whether it can accommodate the object.

另请参阅 setSize ().

QString QNdefNfcSmartPosterRecord:: title (const QString & locale = QString()) const

Returns the title record text associated with locale locale if available. If locale is empty then the title text of the first available record is returned. In all other cases an empty string is returned.

qsizetype QNdefNfcSmartPosterRecord:: titleCount () const

Returns the number of title records contained inside the smart poster.

QNdefNfcTextRecord QNdefNfcSmartPosterRecord:: titleRecord ( qsizetype index ) const

Returns the title record corresponding to the index index inside the smart poster, where index is a value between 0 and titleCount () - 1. Values outside of this range return an empty record.

QList < QNdefNfcTextRecord > QNdefNfcSmartPosterRecord:: titleRecords () const

Returns a copy of all title records inside the smart poster.

QString QNdefNfcSmartPosterRecord:: typeInfo () const

Returns the MIME type that describes the type of the objects that can be reached via uri ().

If the type is not known, the returned QString is empty.

另请参阅 setTypeInfo () 和 hasTypeInfo ().

QUrl QNdefNfcSmartPosterRecord:: uri () const

Returns the URI from the smart poster's URI record if set. Otherwise an empty URI is returned.

另请参阅 setUri ().

QNdefNfcUriRecord QNdefNfcSmartPosterRecord:: uriRecord () const

Returns the smart poster's URI record if set. Otherwise an empty URI is returned.

QNdefNfcSmartPosterRecord &QNdefNfcSmartPosterRecord:: operator= (const QNdefNfcSmartPosterRecord & other )

赋值 other smart poster record to this record and returns a reference to this record.