![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster. More...
#include <qndefnfcsmartposterrecord.h>
Public Types | |
enum | Action { UnspecifiedAction = -1 , DoAction = 0 , SaveAction = 1 , EditAction = 2 } |
This enum describes the course of action that a device should take with the content. More... | |
Public Types inherited from QNdefRecord | |
enum | TypeNameFormat { Empty = 0x00 , NfcRtd = 0x01 , Mime = 0x02 , Uri = 0x03 , ExternalRtd = 0x04 , Unknown = 0x05 } |
This enum describes the type name format of an NDEF record. More... |
Public Member Functions | |
QNdefNfcSmartPosterRecord () | |
Constructs a new empty smart poster. | |
QNdefNfcSmartPosterRecord (const QNdefRecord &other) | |
Constructs a new smart poster that is a copy of other. | |
QNdefNfcSmartPosterRecord (const QNdefNfcSmartPosterRecord &other) | |
Constructs a new smart poster that is a copy of other. | |
QNdefNfcSmartPosterRecord & | operator= (const QNdefNfcSmartPosterRecord &other) |
Assigns the other smart poster record to this record and returns a reference to this record. | |
~QNdefNfcSmartPosterRecord () | |
Destroys the smart poster. | |
void | setPayload (const QByteArray &payload) |
bool | hasTitle (const QString &locale=QString()) const |
Returns true if the smart poster contains a title record using the locale locale. | |
bool | hasAction () const |
Returns true if the smart poster contains an action record, otherwise returns false . | |
bool | hasIcon (const QByteArray &mimetype=QByteArray()) const |
Returns true if the smart poster contains an icon record using the type mimetype. | |
bool | hasSize () const |
Returns true if the smart poster contains a size record, otherwise returns false . | |
bool | hasTypeInfo () const |
Returns true if the smart poster contains a type record, otherwise returns false . | |
qsizetype | titleCount () const |
Returns the number of title records contained inside the smart poster. | |
QNdefNfcTextRecord | 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. | |
QString | title (const QString &locale=QString()) const |
Returns the title record text associated with locale locale if available. | |
QList< QNdefNfcTextRecord > | titleRecords () const |
Returns a copy of all title records inside the smart poster. | |
bool | addTitle (const QNdefNfcTextRecord &text) |
Attempts to add a title record text to the smart poster. | |
bool | addTitle (const QString &text, const QString &locale, QNdefNfcTextRecord::Encoding encoding) |
Attempts to add a new title record with title text, locale locale and encoding encoding. | |
bool | removeTitle (const QNdefNfcTextRecord &text) |
Attempts to remove the title record text from the smart poster. | |
bool | removeTitle (const QString &locale) |
Attempts to remove a title record with the locale locale from the smart poster. | |
void | setTitles (const QList< QNdefNfcTextRecord > &titles) |
Adds the title record list titles to the smart poster. | |
QUrl | uri () const |
Returns the URI from the smart poster's URI record if set. | |
QNdefNfcUriRecord | uriRecord () const |
Returns the smart poster's URI record if set. | |
void | setUri (const QNdefNfcUriRecord &url) |
Sets the URI record to url. | |
void | setUri (const QUrl &url) |
Constructs a URI record and sets its content inside the smart poster to url. | |
Action | action () const |
Returns the action from the action record if available. | |
void | setAction (Action act) |
Sets the action record to act. | |
qsizetype | iconCount () const |
Returns the number of icon records contained inside the smart poster. | |
QNdefNfcIconRecord | 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 \l iconCount() - 1. | |
QByteArray | icon (const QByteArray &mimetype=QByteArray()) const |
Returns the associated icon record data if the smart poster contains an icon record with MIME type mimetype. | |
QList< QNdefNfcIconRecord > | iconRecords () const |
Returns a copy of all icon records inside the smart poster. | |
void | addIcon (const QNdefNfcIconRecord &icon) |
Adds an icon record icon to the smart poster. | |
void | addIcon (const QByteArray &type, const QByteArray &data) |
Adds an icon record with type type and data data to the smart poster. | |
bool | removeIcon (const QNdefNfcIconRecord &icon) |
Attempts to remove the icon record icon from the smart poster. | |
bool | removeIcon (const QByteArray &type) |
Attempts to remove the icon record with the type type from the smart poster. | |
void | setIcons (const QList< QNdefNfcIconRecord > &icons) |
Adds the icon record list icons to the smart poster. | |
quint32 | size () const |
Returns the size from the size record if available; otherwise returns 0. | |
void | setSize (quint32 size) |
Sets the record size. | |
QString | typeInfo () const |
Returns the MIME type that describes the type of the objects that can be reached via uri(). | |
void | setTypeInfo (const QString &type) |
Sets the type record to type. | |
Public Member Functions inherited from QNdefRecord | |
QNdefRecord () | |
Constructs a new empty NDEF record. | |
~QNdefRecord () | |
Destroys the NDEF record. | |
QNdefRecord (const QNdefRecord &other) | |
Constructs a new NDEF record that is a copy of other. | |
QNdefRecord & | operator= (const QNdefRecord &other) |
Assigns this NDEF record to other. | |
void | setTypeNameFormat (TypeNameFormat typeNameFormat) |
Sets the type name format of the NDEF record to typeNameFormat. | |
TypeNameFormat | typeNameFormat () const |
Returns the type name format of the NDEF record. | |
void | setType (const QByteArray &type) |
Sets the type of the NDEF record to type. | |
QByteArray | type () const |
Returns the type of the NDEF record. | |
void | setId (const QByteArray &id) |
Sets the id of the NDEF record to id. | |
QByteArray | id () const |
Returns the id of the NDEF record. | |
void | setPayload (const QByteArray &payload) |
Sets the payload of the NDEF record to payload. | |
QByteArray | payload () const |
Returns the payload of the NDEF record. | |
bool | isEmpty () const |
Returns true if the NDEF record contains an empty payload; otherwise returns false . | |
template<typename T> | |
bool | isRecordType () const |
Returns true if the NDEF record is of the specified record type; otherwise returns false . | |
bool | operator== (const QNdefRecord &other) const |
Returns true if other and this NDEF record are the same. | |
bool | operator!= (const QNdefRecord &other) const |
Returns true if this NDEF record does not equal other; otherwise return false . | |
void | clear () |
Additional Inherited Members | |
Protected Member Functions inherited from QNdefRecord | |
QNdefRecord (const QNdefRecord &other, TypeNameFormat typeNameFormat, const QByteArray &type) | |
QNdefRecord (const QNdefRecord &other, TypeNameFormat typeNameFormat) | |
QNdefRecord (TypeNameFormat typeNameFormat, const QByteArray &type) | |
Related Symbols inherited from QNdefRecord | |
size_t | qHash (const QNdefRecord &key) |
\macro Q_DECLARE_NDEF_RECORD(className, typeNameFormat, type, initialPayload) |
The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster.
\inmodule QtNfc
RTD-SmartPoster encapsulates a Smart Poster.
Definition at line 41 of file qndefnfcsmartposterrecord.h.
This enum describes the course of action that a device should take with the content.
\value UnspecifiedAction The action is not defined. \value DoAction Do the action (send the SMS, launch the browser, make the telephone call). \value SaveAction Save for later (store the SMS in INBOX, put the URI in a bookmark, save the telephone number in contacts). \value EditAction Open for editing (open an SMS in the SMS editor, open the URI in a URI editor, open the telephone number for editing).
Enumerator | |
---|---|
UnspecifiedAction | |
DoAction | |
SaveAction | |
EditAction |
Definition at line 44 of file qndefnfcsmartposterrecord.h.
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord | ( | ) |
Constructs a new empty smart poster.
Definition at line 81 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord | ( | const QNdefRecord & | other | ) |
Constructs a new smart poster that is a copy of other.
Definition at line 90 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord | ( | const QNdefNfcSmartPosterRecord & | other | ) |
Constructs a new smart poster that is a copy of other.
Definition at line 101 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcSmartPosterRecord::~QNdefNfcSmartPosterRecord | ( | ) |
Destroys the smart poster.
Definition at line 121 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcSmartPosterRecord::Action QNdefNfcSmartPosterRecord::action | ( | ) | const |
Returns the action from the action record if available.
Otherwise \l UnspecifiedAction is returned.
Definition at line 477 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 572 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 548 of file qndefnfcsmartposterrecord.cpp.
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
is returned.
Definition at line 325 of file qndefnfcsmartposterrecord.cpp.
bool QNdefNfcSmartPosterRecord::addTitle | ( | const QString & | text, |
const QString & | locale, | ||
QNdefNfcTextRecord::Encoding | encoding ) |
Attempts to add a new title record with title text, locale locale and encoding 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
is returned.
Definition at line 354 of file qndefnfcsmartposterrecord.cpp.
bool QNdefNfcSmartPosterRecord::hasAction | ( | ) | const |
Returns true
if the smart poster contains an action record, otherwise returns false
.
Definition at line 233 of file qndefnfcsmartposterrecord.cpp.
bool QNdefNfcSmartPosterRecord::hasIcon | ( | const QByteArray & | mimetype = QByteArray() | ) | const |
Returns true
if the smart poster contains an icon record using the type mimetype.
If mimetype is empty, then true
is returned if the smart poster contains at least one icon record. In all other cases, false
is returned.
Definition at line 244 of file qndefnfcsmartposterrecord.cpp.
bool QNdefNfcSmartPosterRecord::hasSize | ( | ) | const |
Returns true
if the smart poster contains a size record, otherwise returns false
.
Definition at line 260 of file qndefnfcsmartposterrecord.cpp.
Returns true
if the smart poster contains a title record using the locale locale.
If locale is empty, then true
is returned if the smart poster contains at least one title record. In all other cases, false
is returned.
Definition at line 217 of file qndefnfcsmartposterrecord.cpp.
bool QNdefNfcSmartPosterRecord::hasTypeInfo | ( | ) | const |
Returns true
if the smart poster contains a type record, otherwise returns false
.
Definition at line 269 of file qndefnfcsmartposterrecord.cpp.
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.
If mimetype is omitted or empty then the first icon's record data is returned. In all other cases, an empty array is returned.
Definition at line 524 of file qndefnfcsmartposterrecord.cpp.
qsizetype QNdefNfcSmartPosterRecord::iconCount | ( | ) | const |
Returns the number of icon records contained inside the smart poster.
Definition at line 502 of file qndefnfcsmartposterrecord.cpp.
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 \l iconCount() - 1.
Values outside of this range return an empty record.
Definition at line 512 of file qndefnfcsmartposterrecord.cpp.
QList< QNdefNfcIconRecord > QNdefNfcSmartPosterRecord::iconRecords | ( | ) | const |
Returns a copy of all icon records inside the smart poster.
Definition at line 539 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcSmartPosterRecord & QNdefNfcSmartPosterRecord::operator= | ( | const QNdefNfcSmartPosterRecord & | other | ) |
Assigns the other smart poster record to this record and returns a reference to this record.
Definition at line 110 of file qndefnfcsmartposterrecord.cpp.
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
is returned.
Definition at line 612 of file qndefnfcsmartposterrecord.cpp.
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
is returned.
Definition at line 586 of file qndefnfcsmartposterrecord.cpp.
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
is returned.
Definition at line 369 of file qndefnfcsmartposterrecord.cpp.
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
is returned.
Definition at line 395 of file qndefnfcsmartposterrecord.cpp.
Sets the action record to act.
Definition at line 488 of file qndefnfcsmartposterrecord.cpp.
void QNdefNfcSmartPosterRecord::setIcons | ( | const QList< QNdefNfcIconRecord > & | icons | ) |
Adds the icon record list icons to the smart poster.
Any existing records are overwritten.
Definition at line 639 of file qndefnfcsmartposterrecord.cpp.
void QNdefNfcSmartPosterRecord::setPayload | ( | const QByteArray & | payload | ) |
Sets the payload of the NDEF record to payload
Definition at line 135 of file qndefnfcsmartposterrecord.cpp.
Sets the record size.
The value contains the size in bytes of the object that the URI refers to.
Definition at line 670 of file qndefnfcsmartposterrecord.cpp.
void QNdefNfcSmartPosterRecord::setTitles | ( | const QList< QNdefNfcTextRecord > & | titles | ) |
Adds the title record list titles to the smart poster.
Any existing records are overwritten.
Definition at line 419 of file qndefnfcsmartposterrecord.cpp.
Sets the type record to type.
type describes the type of the object referenced by uri().
Definition at line 703 of file qndefnfcsmartposterrecord.cpp.
void QNdefNfcSmartPosterRecord::setUri | ( | const QNdefNfcUriRecord & | url | ) |
Sets the URI record to url.
Definition at line 452 of file qndefnfcsmartposterrecord.cpp.
Constructs a URI record and sets its content inside the smart poster to url.
Definition at line 466 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 656 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 300 of file qndefnfcsmartposterrecord.cpp.
qsizetype QNdefNfcSmartPosterRecord::titleCount | ( | ) | const |
Returns the number of title records contained inside the smart poster.
Definition at line 277 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 287 of file qndefnfcsmartposterrecord.cpp.
QList< QNdefNfcTextRecord > QNdefNfcSmartPosterRecord::titleRecords | ( | ) | const |
Returns a copy of all title records inside the smart poster.
Definition at line 315 of file qndefnfcsmartposterrecord.cpp.
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.
Definition at line 689 of file qndefnfcsmartposterrecord.cpp.
QUrl QNdefNfcSmartPosterRecord::uri | ( | ) | const |
Returns the URI from the smart poster's URI record if set.
Otherwise an empty URI is returned.
Definition at line 430 of file qndefnfcsmartposterrecord.cpp.
QNdefNfcUriRecord QNdefNfcSmartPosterRecord::uriRecord | ( | ) | const |
Returns the smart poster's URI record if set.
Otherwise an empty URI is returned.
Definition at line 441 of file qndefnfcsmartposterrecord.cpp.