Logo Search packages:      
Sourcecode: kbarcode version File versions  Download package

BarCode Class Reference

#include <mybarcode.h>

Inheritance diagram for BarCode:


List of all members.

Detailed Description

This class creates a QPixmap from a barcodeData struct. Several backends are supported to generate the pixmap. GNU Barcode pdf417_enc TBarcode (http://www.tec-it.com)

This tools generate a postscript file. The ps file is transformed to a PBM file scaled to the requested resolution or screen resolution using ghostscript.

The generated barcodes are cached using BarcodeCache. To fill a barcodeData struct with data from the user, you might want to use BarcodeWidget.

A small example, of how to generate a valid Barcode in your application without the use of BarcodeWidget:

  barcodeData data;
  BarCode::fillDefault( &data ); // setup a barcode object with valid data
  data.value = "KBARCODE";
  data.type = "code39";
  BarCode b( &data ); // create a barcode object
  QPixmap p = b.pixmap(); // get a pixmap of the barcode

See also:


Dominik Seichter

Definition at line 177 of file mybarcode.h.

Public Member Functions

 BarCode ()
 BarCode (const barcodeData *data)
barcodeData data () const
const QPixmap pixmap ()
const QPixmap printerPixmap (QPaintDevice *device)
void redrawBarcode ()
QString sequenceValue ()
void setData (barcodeData *d)
void setIndex (int i)
bool validBarcode ()

Static Public Member Functions

static void fillDefault (barcodeData *data)
static const QString getMaxLength (const QString &name)
static bool hasFeature (const QString &type, unsigned int feature)
static bool haveBarcode ()
static bool haveGNUBarcode ()
static bool havePDFBarcode ()
static bool haveTBarcode ()
static void setHaveBarcode ()

Private Member Functions

QPixmap addMargin (QPixmap *pic, int margin)
void cleanUp (KTempFile *file, KTempFile *file2, QPixmap *target)
void createBarcode (QPixmap *target, QPaintDevice *device)
bool createPdf417 (KTempFile *output)
bool createPixmap (QPixmap *target, int resx, int resy)
QString createSequence (const QString &value)
bool createTBarcode (KTempFile *output)
QPixmap cut (QPixmap *pic, double cut)
QSize getBoundingBox (const QString &filename)

Static Private Member Functions

static barcodeFormat fillStruct (const QString &name, const QString &text, const int feature)

Private Attributes

barcodeData barcode
int m_index
QString m_value
QPixmap p
QPixmap pp

Static Private Attributes

static bool m_haveGnuBarcode = false
static bool m_havePdfEncode = false
static bool m_haveTBarcode = false

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

Generated by  Doxygen 1.6.0   Back to index