8#include <QtCore/QString>
9#include <QtCore/QStringList>
109void QNdefNfcSmartPosterRecord::cleanup()
171void QNdefNfcSmartPosterRecord::convertToPayload()
213 if (locale.isEmpty() ||
text.locale() == locale)
253 return d->
m_size !=
nullptr;
262 return d->
m_type !=
nullptr;
280 if (
index >= 0 && index < d->m_titleList.size())
296 if (locale.isEmpty() ||
text.locale() == locale)
318 const bool status = addTitleInternal(
text);
332 if (rec.locale() ==
text.locale())
393 if (rec.locale() == locale) {
428 return d->
m_uri->uri();
509 if (
index >= 0 && index < d->m_iconList.size())
545 addIconInternal(
icon);
753 data[0] = (int) ((
size & 0xFF000000) >> 24);
754 data[1] = (int) ((
size & 0x00FF0000) >> 16);
755 data[2] = (int) ((
size & 0x0000FF00) >> 8);
756 data[3] = (int) ((
size & 0x000000FF));
768 return ((
p[0] << 24) & 0xFF000000) + ((
p[1] << 16) & 0x00FF0000)
769 + ((
p[2] << 8) & 0x0000FF00) + (
p[3] & 0x000000FF);
772void QNdefNfcTypeRecord::setTypeInfo(
const QString &
type)
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
qsizetype size() const noexcept
void removeAt(qsizetype i)
void append(parameter_type t)
The QNdefMessage class provides an NFC NDEF message.
static Q_NFC_EXPORT QNdefMessage fromByteArray(const QByteArray &message)
Returns an NDEF message parsed from the contents of message.
Q_DECLARE_NDEF_RECORD(QNdefNfcActRecord, QNdefRecord::NfcRtd, "act", QByteArray(0, char(0))) void setAction(QNdefNfcSmartPosterRecord QNdefNfcSmartPosterRecord::Action action() const
The QNdefNfcIconRecord class provides an NFC MIME record to hold an icon.
QByteArray data() const
Returns the icon data as \l QByteArray.
QNdefNfcSizeRecord * m_size
QNdefNfcActRecord * m_action
QList< QNdefNfcTextRecord > m_titleList
QList< QNdefNfcIconRecord > m_iconList
QNdefNfcTypeRecord * m_type
QNdefNfcUriRecord * m_uri
The QNdefNfcSmartPosterRecord class provides an NFC RTD-SmartPoster.
QNdefNfcTextRecord titleRecord(qsizetype index) const
Returns the title record corresponding to the index index inside the smart poster,...
~QNdefNfcSmartPosterRecord()
Destroys the smart poster.
bool hasTitle(const QString &locale=QString()) const
Returns true if the smart poster contains a title record using the locale locale.
QUrl uri() const
Returns the URI from the smart poster's URI record if set.
Action action() const
Returns the action from the action record if available.
void setUri(const QNdefNfcUriRecord &url)
Sets the URI record to url.
QByteArray icon(const QByteArray &mimetype=QByteArray()) const
Returns the associated icon record data if the smart poster contains an icon record with MIME type mi...
QNdefNfcSmartPosterRecord & operator=(const QNdefNfcSmartPosterRecord &other)
Assigns the other smart poster record to this record and returns a reference to this record.
bool hasIcon(const QByteArray &mimetype=QByteArray()) const
Returns true if the smart poster contains an icon record using the type mimetype.
void setSize(quint32 size)
Sets the record size.
bool removeIcon(const QNdefNfcIconRecord &icon)
Attempts to remove the icon record icon from the smart poster.
void setAction(Action act)
Sets the action record to act.
void setTitles(const QList< QNdefNfcTextRecord > &titles)
Adds the title record list titles to the smart poster.
QString typeInfo() const
Returns the MIME type that describes the type of the objects that can be reached via uri().
bool hasTypeInfo() const
Returns true if the smart poster contains a type record, otherwise returns false.
void setTypeInfo(const QString &type)
Sets the type record to type.
QList< QNdefNfcTextRecord > titleRecords() const
Returns a copy of all title records inside the smart poster.
bool removeTitle(const QNdefNfcTextRecord &text)
Attempts to remove the title record text from the smart poster.
void setPayload(const QByteArray &payload)
qsizetype titleCount() const
Returns the number of title records contained inside the smart poster.
bool addTitle(const QNdefNfcTextRecord &text)
Attempts to add a title record text to the smart poster.
bool hasAction() const
Returns true if the smart poster contains an action record, otherwise returns false.
QNdefNfcIconRecord iconRecord(qsizetype index) const
Returns the icon record corresponding to the index index inside the smart poster, where index is a va...
bool hasSize() const
Returns true if the smart poster contains a size record, otherwise returns false.
QNdefNfcSmartPosterRecord()
Constructs a new empty 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 addIcon(const QNdefNfcIconRecord &icon)
Adds an icon record icon to the smart poster.
qsizetype iconCount() const
Returns the number of icon records contained inside the smart poster.
Action
This enum describes the course of action that a device should take with the content.
QList< QNdefNfcIconRecord > iconRecords() const
Returns a copy of all icon records inside the smart poster.
QNdefNfcUriRecord uriRecord() const
Returns the smart poster's URI record if set.
QString title(const QString &locale=QString()) const
Returns the title record text associated with locale locale if available.
The QNdefNfcTextRecord class provides an NFC RTD-Text.
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 setEncoding(Encoding encoding)
Sets the enconding of the contents to encoding.
Encoding
This enum describes the text encoding standard used.
Encoding encoding() const
Returns the encoding of the contents.
void setText(const QString text)
Sets the contents of the text record to text.
The QNdefNfcUriRecord class provides an NFC RTD-URI.
void setUri(const QUrl &uri)
Sets the URI of this URI record to uri.
The QNdefRecord class provides an NFC NDEF record.
void setPayload(const QByteArray &payload)
Sets the payload of the NDEF record to payload.
QByteArray type() const
Returns the type of the NDEF record.
QByteArray payload() const
Returns the payload of the NDEF record.
void setType(const QByteArray &type)
Sets the type of the NDEF record to type.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QUrl url("example.com")
[constructor-url-reference]