BarcodeGenerator

Since: BlackBerry 10.2.0

#include <bb/cascades/multimedia/BarcodeGenerator>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmultimedia

Encodes user-supplied data to a barcode.

A BarcodeGenerator creates barcodes in a variety of formats by encoding user-supplied data. When created, a barcode can be written immediately as a file, or retrieved as ImageData and used by other controls.


Overview

Public Functions Index

BarcodeGenerator (QObject *parent=0)
virtual ~BarcodeGenerator ()
Q_INVOKABLE bb::cascades::multimedia::BarcodeGeneratorError::Typeerror () const
Q_INVOKABLE QStringgenerate (const QUrl &filename, bb::cascades::multimedia::BarcodeGeneratorFormat::Type format, const QString &data)
Q_INVOKABLE QStringgenerate (const QUrl &filename, bb::cascades::multimedia::BarcodeGeneratorFormat::Type format, const QString &data, float scale)
Q_INVOKABLE bb::ImageDatagenerate (bb::cascades::multimedia::BarcodeGeneratorFormat::Type format, const QString &data)
Q_INVOKABLE bb::ImageDatagenerate (bb::cascades::multimedia::BarcodeGeneratorFormat::Type format, const QString &data, float scale)

Public Functions

BarcodeGenerator (

Creates an instance of the BarcodeGenerator class.

Parameters
parent

If not 0, the supplied parent will be responsible for deleting this instance.

Since:

BlackBerry 10.2.0

virtual~BarcodeGenerator ()

Destructor.

Since:

BlackBerry 10.2.0

Q_INVOKABLE bb::cascades::multimedia::BarcodeGeneratorError::Type error ()

Indicates the status of the last barcode generation attempt.

Call this method after after attempting to generate a barcode.

Since:

BlackBerry 10.2.0

Q_INVOKABLE QString generate (

Creates a barcode and write it to file.

The barcode image is written in the location and image format specified in the filename parameter. For example, specifying a file name of barcode.png writes in PNG format.

Parameters
filename

The location and image format for the barcode image.

format

The encoding format for the barcode. See bb::cascades::multimedia::BarcodeGeneratorFormat::Type for more details.

data

The data encoded into the barcode.

Return:

The fully-qualified path of the written barcode file. If an empty string is returned an error has occurred. Read error() to obtain the reason why it failed and see bb::cascades::multimedia::BarcodeGeneratorError for more details.

Since:

BlackBerry 10.2.0

Q_INVOKABLE QString generate (

Creates a scaled barcode and writes it to file.

The barcode image is written in the location and image format specified in the filename paramter. For example, specifying a file name of barcode.png writes in PNG format.

Parameters
filename

The location and image format for the barcode image.

format

The encoding format for the barcode. See bb::cascades::multimedia::BarcodeGeneratorFormat::Type for more details.

data

The data encoded into the barcode.

scale

The amount of scaling applied to the barcode image.

Return:

The fully-qualified path of the written barcode file. If an empty string is returned an error has occurred. Read error() to obtain the reason why it failed and see bb::cascades::multimedia::BarcodeGeneratorError for more details.

Since:

BlackBerry 10.2.0

Q_INVOKABLE bb::ImageData generate (

Creates a barcode and returns it as bb::ImageData.

The resulting bb::ImageData is in 32bpp RGBA format and can be used in other Cascades controls such as an bb::cascades::ImageView.

Parameters
format

The encoding format for the barcode. See bb::cascades::multimedia::BarcodeGeneratorFormat::Type for more details.

data

The data encoded into the barcode.

Return:

The bb::ImageData containing the rendered barcode. If the resulting bb::ImageData is not valid, the reason for the failure can be determined by calling error().

Since:

BlackBerry 10.2.0

Q_INVOKABLE bb::ImageData generate (

Creates a scaled barcode and returns it as bb::ImageData.

The resulting bb::ImageData is in 32bpp RGBA format and can be used in other Cascades controls such as an bb::cascades::ImageView.

Parameters
format

The encoding format for the barcode. See bb::cascades::multimedia::BarcodeGeneratorFormat::Type for more details.

data

The data encoded into the barcode.

scale

The amount of scaling applied to the barcode image.

Return:

The bb::ImageData containing the rendered barcode. If the resulting bb::ImageData is not valid, the reason for the failure can be determined by calling error().

Since:

BlackBerry 10.2.0

Last modified: 2014-03-13

comments powered by Disqus