Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QNdefNfcSmartPosterRecord Class Reference

The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster. More...

#include <qndefnfcsmartposterrecord.h>

Inheritance diagram for QNdefNfcSmartPosterRecord:
Collaboration diagram for QNdefNfcSmartPosterRecord:

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.
QNdefNfcSmartPosterRecordoperator= (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< QNdefNfcTextRecordtitleRecords () 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< QNdefNfcIconRecordiconRecords () 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.
QNdefRecordoperator= (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)

Detailed Description

The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster.

\inmodule QtNfc

Since
Qt 5.2

RTD-SmartPoster encapsulates a Smart Poster.

Definition at line 41 of file qndefnfcsmartposterrecord.h.

Member Enumeration Documentation

◆ Action

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.

Constructor & Destructor Documentation

◆ QNdefNfcSmartPosterRecord() [1/3]

QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord ( )

Constructs a new empty smart poster.

Definition at line 81 of file qndefnfcsmartposterrecord.cpp.

◆ QNdefNfcSmartPosterRecord() [2/3]

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() [3/3]

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::~QNdefNfcSmartPosterRecord ( )

Destroys the smart poster.

Definition at line 121 of file qndefnfcsmartposterrecord.cpp.

Member Function Documentation

◆ action()

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.

◆ addIcon() [1/2]

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.

◆ addIcon() [2/2]

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.

◆ addTitle() [1/2]

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.

◆ addTitle() [2/2]

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.

◆ hasAction()

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.

◆ hasIcon()

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.

◆ hasSize()

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.

◆ hasTitle()

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

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.

◆ hasTypeInfo()

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.

◆ icon()

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.

◆ iconCount()

qsizetype QNdefNfcSmartPosterRecord::iconCount ( ) const

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

Definition at line 502 of file qndefnfcsmartposterrecord.cpp.

◆ iconRecord()

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.

◆ iconRecords()

QList< QNdefNfcIconRecord > QNdefNfcSmartPosterRecord::iconRecords ( ) const

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

Definition at line 539 of file qndefnfcsmartposterrecord.cpp.

◆ operator=()

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.

◆ removeIcon() [1/2]

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.

◆ removeIcon() [2/2]

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.

◆ removeTitle() [1/2]

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.

◆ removeTitle() [2/2]

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.

◆ setAction()

void QNdefNfcSmartPosterRecord::setAction ( Action act)

Sets the action record to act.

Definition at line 488 of file qndefnfcsmartposterrecord.cpp.

◆ setIcons()

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

Adds the icon record list icons to the smart poster.

Any existing records are overwritten.

See also
hasIcon(), icon()

Definition at line 639 of file qndefnfcsmartposterrecord.cpp.

◆ setPayload()

void QNdefNfcSmartPosterRecord::setPayload ( const QByteArray & payload)

Sets the payload of the NDEF record to payload

Definition at line 135 of file qndefnfcsmartposterrecord.cpp.

◆ setSize()

void QNdefNfcSmartPosterRecord::setSize ( quint32 size)

Sets the record size.

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

See also
size(), hasSize()

Definition at line 670 of file qndefnfcsmartposterrecord.cpp.

◆ setTitles()

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.

◆ setTypeInfo()

void QNdefNfcSmartPosterRecord::setTypeInfo ( const QString & type)

Sets the type record to type.

type describes the type of the object referenced by uri().

See also
typeInfo()

Definition at line 703 of file qndefnfcsmartposterrecord.cpp.

◆ setUri() [1/2]

void QNdefNfcSmartPosterRecord::setUri ( const QNdefNfcUriRecord & url)

Sets the URI record to url.

Definition at line 452 of file qndefnfcsmartposterrecord.cpp.

◆ setUri() [2/2]

void QNdefNfcSmartPosterRecord::setUri ( const QUrl & url)

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

Definition at line 466 of file qndefnfcsmartposterrecord.cpp.

◆ size()

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.

See also
setSize()

Definition at line 656 of file qndefnfcsmartposterrecord.cpp.

◆ title()

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.

Definition at line 300 of file qndefnfcsmartposterrecord.cpp.

◆ titleCount()

qsizetype QNdefNfcSmartPosterRecord::titleCount ( ) const

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

Definition at line 277 of file qndefnfcsmartposterrecord.cpp.

◆ titleRecord()

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.

◆ titleRecords()

QList< QNdefNfcTextRecord > QNdefNfcSmartPosterRecord::titleRecords ( ) const

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

Definition at line 315 of file qndefnfcsmartposterrecord.cpp.

◆ typeInfo()

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.

See also
setTypeInfo(), hasTypeInfo()

Definition at line 689 of file qndefnfcsmartposterrecord.cpp.

◆ uri()

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.

◆ uriRecord()

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.


The documentation for this class was generated from the following files: