glbarcode++
 
Loading...
Searching...
No Matches
glbarcode::Barcode Class Referenceabstract

#include </home/evins/glbarcode/glbarcode/Barcode.hpp>

Inheritance diagram for glbarcode::Barcode:
Collaboration diagram for glbarcode::Barcode:

Public Member Functions

virtual ~Barcode ()
 
 Barcode (const Barcode &)=delete
 
void operator= (const Barcode &)=delete
 
BarcodesetShowText (bool value)
 
bool showText () const
 
BarcodesetChecksum (bool value)
 
bool checksum () const
 
virtual Barcodebuild (const std::string &data, double w=0, double h=0)=0
 
void render (Renderer &renderer)
 
bool isEmpty () const
 
bool isDataValid () const
 
double width () const
 
double height () const
 

Protected Member Functions

 Barcode ()
 
void clear ()
 
void addLine (double x, double y, double w, double h)
 
void addBox (double x, double y, double w, double h)
 
void addText (double x, double y, double size, const std::string &text, HAlign halign=H_ALIGN_CENTER)
 
void addRing (double x, double y, double r, double w)
 
void addHexagon (double x, double y, double h)
 
void setIsEmpty (bool value)
 
void setIsDataValid (bool value)
 
void setWidth (double w)
 
void setHeight (double h)
 

Detailed Description

The Barcode class is the base class for all barcode implementations. This class provides the public interfaces and basic infrastructure for all barcode implementations. Implementations would not typically directly implement this class, but instead would implement either Barcode1dBase (for 1D symbologies) or Barcode2dBase (for 2D symbologies).

See Barcode1dBase or Barcode2dBase.

Constructor & Destructor Documentation

◆ Barcode() [1/2]

glbarcode::Barcode::Barcode ( )
protected

Default constructor.

◆ ~Barcode()

virtual glbarcode::Barcode::~Barcode ( )
virtual

Destructor.

◆ Barcode() [2/2]

glbarcode::Barcode::Barcode ( const Barcode )
delete

Member Function Documentation

◆ addBox()

void glbarcode::Barcode::addBox ( double  x,
double  y,
double  w,
double  h 
)
protected

Add box drawing primitive

To be used by build() implementations during vectorization.

Box primitive properties
Parameters
[in]xX coordinate of box's origin (points)
[in]yY coordinate of box's origin (points)
[in]wWidth of box (points)
[in]hHeight of box (points)

◆ addHexagon()

void glbarcode::Barcode::addHexagon ( double  x,
double  y,
double  h 
)
protected

Add hexagon drawing primitive

To be used by build() implementations during vectorization.

Hexagon primitive properties
Parameters
[in]xX coordinate of hexagon's origin (points)
[in]yY coordinate of hexagon's origin (points)
[in]hHeight of hexagon (points)

◆ addLine()

void glbarcode::Barcode::addLine ( double  x,
double  y,
double  w,
double  h 
)
protected

Add line drawing primitive

To be used by build() implementations during vectorization.

Line primitive properties
Parameters
[in]xX coordinate of line's origin (points)
[in]yY coordinate of line's origin (points)
[in]wBar width (points)
[in]hBar height (points)

◆ addRing()

void glbarcode::Barcode::addRing ( double  x,
double  y,
double  r,
double  w 
)
protected

Add ring drawing primitive

To be used by build() implementations during vectorization.

Ring primitive properties
Parameters
[in]xX coordinate of ring's origin (points)
[in]yY coordinate of ring's origin (points)
[in]rRadius of ring (points)
[in]wLine width of ring (points)

◆ addText()

void glbarcode::Barcode::addText ( double  x,
double  y,
double  size,
const std::string &  text,
HAlign  halign = H_ALIGN_CENTER 
)
protected

Add text drawing primitive

To be used by build() implementations during vectorization.

Text primitive properties
Parameters
[in]xX coordinate of text's origin (points)
[in]yY coordinate of text's origin (points)
[in]sizeFont size of text (points)
[in]textText
[in]halignHorizontal text alignment

◆ build()

virtual Barcode & glbarcode::Barcode::build ( const std::string &  data,
double  w = 0,
double  h = 0 
)
pure virtual

Build barcode from data.

Parameters
[in]dataData to encode in barcode
[in]wRequested width of barcode (0 = auto size)
[in]hRequested height of barcode (0 = auto size)
Returns
A reference to this Barcode object for chaining methods

Implemented in glbarcode::Barcode1dBase, and glbarcode::Barcode2dBase.

◆ checksum()

bool glbarcode::Barcode::checksum ( ) const

Get accessor for "checksum" property.

Returns
Value of boolean "checksum" property
See also
setChecksum()

◆ clear()

void glbarcode::Barcode::clear ( )
protected

Clear drawing primitives.

◆ height()

double glbarcode::Barcode::height ( ) const

Get actual height of barcode (may differ from requested height).

Returns
Actual height of barcode (points)
See also
setHeight()

◆ isDataValid()

bool glbarcode::Barcode::isDataValid ( ) const

Is barcode data valid?

Returns
True if barcode data is valid
False if barcode data is not valid for implemented barcode type
See also
setIsDataValid()

◆ isEmpty()

bool glbarcode::Barcode::isEmpty ( ) const

Is barcode data empty?

Returns
True if barcode data is empty
False if barcode data is not empty
See also
setIsEmpty()

◆ operator=()

void glbarcode::Barcode::operator= ( const Barcode )
delete

◆ render()

void glbarcode::Barcode::render ( Renderer renderer)

Render barcode using given Renderer object.

Parameters
[in]rendererA Renderer object

◆ setChecksum()

Barcode & glbarcode::Barcode::setChecksum ( bool  value)

Set accessor for "checksum" property.

Parameters
[in]valueBoolean value
Returns
A reference to this Barcode object for property chaining
See also
checksum()

◆ setHeight()

void glbarcode::Barcode::setHeight ( double  h)
protected

Set new height of barcode.

To be used by build() implementations to override requested height of barcode.

Parameters
[in]hActual height of barcode (points)
See also
height()

◆ setIsDataValid()

void glbarcode::Barcode::setIsDataValid ( bool  value)
protected

Set is data valid property.

To be used by build() implementations to indicate if input data is valid or not.

Parameters
[in]valueBoolean value of flag
See also
isDataValid()

◆ setIsEmpty()

void glbarcode::Barcode::setIsEmpty ( bool  value)
protected

Set is empty property.

To be used by build() implementations to indicate if input data is empty.

Parameters
[in]valueBoolean value of flag
See also
isEmpty()

◆ setShowText()

Barcode & glbarcode::Barcode::setShowText ( bool  value)

Set accessor for "showText" property.

Parameters
[in]valueBoolean value
Returns
A reference to this Barcode object for property chaining
See also
showText()

◆ setWidth()

void glbarcode::Barcode::setWidth ( double  w)
protected

Set new width of barcode.

To be used by build() implementations to override requested width of barcode.

Parameters
[in]wActual width of barcode (points)
See also
width()

◆ showText()

bool glbarcode::Barcode::showText ( ) const

Get accessor for "showText" property.

Returns
Value of boolean "showText" property
See also
setShowText()

◆ width()

double glbarcode::Barcode::width ( ) const

Get actual width of barcode (may differ from requested width).

Returns
Actual width of barcode (points)
See also
setWidth()

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