The QNdefFilter class provides a filter for matching NDEF messages. More...
#include <QNdefFilter>
This class was introduced in Qt Mobility 1.2.
class | Record |
QNdefFilter () | |
QNdefFilter ( const QNdefFilter & other ) | |
~QNdefFilter () | |
void | appendRecord ( unsigned int min = 1, unsigned int max = 1 ) |
void | appendRecord ( QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray & type, unsigned int min = 1, unsigned int max = 1 ) |
void | appendRecord ( const Record & record ) |
void | clear () |
bool | orderMatch () const |
Record | recordAt ( int i ) const |
int | recordCount () const |
void | setOrderMatch ( bool on ) |
QNdefFilter & | operator= ( const QNdefFilter & other ) |
The QNdefFilter class provides a filter for matching NDEF messages.
The QNdefFilter encapsulates the structure of an NDEF message and is used by QNearFieldManager::registerNdefMessageHandler() to match NDEF message that have a particular structure.
The following filter matches NDEF messages that contain a single smart poster record:
QNdefFilter filter; filter.append(QNdefRecord::NfcRtd, "Sp");
The following filter matches NDEF messages that contain a URI, a localized piece of text and an optional JPEG image. The order of the records must be in the order specified:
QNdefFilter filter; filter.setOrderMatch(true); filter.appendRecord(QNdefRecord::NfcRtd, "U"); filter.appendRecord<QNdefNfcTextRecord>(); filter.appendRecord(QNdefRecord::Mime, "image/jpeg", 0, 1);
Constructs a new NDEF filter.
constructs a new NDEF filter that is a copy of other.
Destroys the NDEF filter.
Appends a record matching the template parameter to the NDEF filter. The record must occur between min and max times in the NDEF message.
Appends a record with type name format typeNameFormat and type type to the NDEF filter. The record must occur between min and max times in the NDEF message.
Appends record to the NDEF filter.
Clears the filter.
Returns true if the filter takes NDEF record order into account when matching; otherwise returns false.
See also setOrderMatch().
Returns the NDEF record at index i.
Returns the number of NDEF records in the filter.
Sets the ording requirements of the filter. If on is true the filter will only match if the order of records in the filter matches the order of the records in the NDEF message. If on is false the order of the records is not taken into account when matching.
By default record order is not taken into account.
See also orderMatch().
Assigns other to this filter and returns a reference to this filter.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.