Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QNdefNfcTextRecord Class Reference

The QNdefNfcTextRecord class provides an NFC RTD-Text. More...

#include <qndefnfctextrecord.h>

+ Inheritance diagram for QNdefNfcTextRecord:
+ Collaboration diagram for QNdefNfcTextRecord:

Public Types

enum  Encoding { Utf8 , Utf16 }
 This enum describes the text encoding standard used. 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

 Q_DECLARE_NDEF_RECORD (QNdefNfcTextRecord, QNdefRecord::NfcRtd, "T", QByteArray(1, char(0))) QString locale() const
 
void setLocale (const QString &locale)
 Sets the locale of the text record to locale.
 
QString text () const
 Returns the contents of the text record as a string.
 
void setText (const QString text)
 Sets the contents of the text record to text.
 
Encoding encoding () const
 Returns the encoding of the contents.
 
void setEncoding (Encoding encoding)
 Sets the enconding of the contents to encoding.
 
- 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 QNdefNfcTextRecord class provides an NFC RTD-Text.

\inmodule QtNfc

Since
5.2

RTD-Text encapsulates a user displayable text record.

Definition at line 12 of file qndefnfctextrecord.h.

Member Enumeration Documentation

◆ Encoding

This enum describes the text encoding standard used.

\value Utf8 The text is encoded with UTF-8. \value Utf16 The text is encoding with UTF-16.

Enumerator
Utf8 
Utf16 

Definition at line 28 of file qndefnfctextrecord.h.

Member Function Documentation

◆ encoding()

QNdefNfcTextRecord::Encoding QNdefNfcTextRecord::encoding ( ) const

Returns the encoding of the contents.

Definition at line 129 of file qndefnfctextrecord.cpp.

References QNdefRecord::isEmpty(), QNdefRecord::payload(), Utf16, and Utf8.

Referenced by QNdefNfcSmartPosterRecord::removeTitle(), and setEncoding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Q_DECLARE_NDEF_RECORD()

QNdefNfcTextRecord::Q_DECLARE_NDEF_RECORD ( QNdefNfcTextRecord ,
QNdefRecord::NfcRtd ,
"T" ,
QByteArray(1, char(0))  ) const

◆ setEncoding()

void QNdefNfcTextRecord::setEncoding ( Encoding encoding)

Sets the enconding of the contents to encoding.

Definition at line 149 of file qndefnfctextrecord.cpp.

References encoding(), QNdefRecord::payload(), QNdefRecord::setPayload(), setText(), text(), and Utf8.

Referenced by QNdefNfcSmartPosterRecord::addTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocale()

void QNdefNfcTextRecord::setLocale ( const QString & locale)

Sets the locale of the text record to locale.

Definition at line 63 of file qndefnfctextrecord.cpp.

References QNdefRecord::payload(), and QNdefRecord::setPayload().

Referenced by QNdefNfcSmartPosterRecord::addTitle(), and setText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setText()

void QNdefNfcTextRecord::setText ( const QString text)

Sets the contents of the text record to text.

Definition at line 103 of file qndefnfctextrecord.cpp.

References QNdefRecord::isEmpty(), QNdefRecord::payload(), setLocale(), QNdefRecord::setPayload(), QStringConverterBase::Stateless, text(), QStringConverter::Utf16BE, QStringConverter::Utf8, and QStringConverterBase::WriteBom.

Referenced by QNdefNfcSmartPosterRecord::addTitle(), and setEncoding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ text()

QString QNdefNfcTextRecord::text ( ) const

Returns the contents of the text record as a string.

Definition at line 82 of file qndefnfctextrecord.cpp.

References QNdefRecord::payload(), QStringConverterBase::Stateless, QStringConverter::Utf16BE, and QStringConverter::Utf8.

Referenced by QNdefNfcSmartPosterRecord::removeTitle(), setEncoding(), and setText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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