Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

BarcodeGenerator Class Reference

Active tasts for BC GUI. It's inherited from BarcodeGeneratorBase() class which is created by uic from designer. Don't change anything in BarcodeGeneratorBase manually! It will be overwritten automatically by uic. More...

#include <barcodegenerator.h>

List of all members.

Public Member Functions

 BarcodeGenerator (QWidget *parent=0, const char *name=0)
 Create modal BC dialog.
 ~BarcodeGenerator ()
 Erase the temporary files here.

Protected Slots

void bcComboChanged ()
void textCheck_changed ()
void guardCheck_changed ()
void includeCheck_stateChanged (int state)
void includeCheckInText_stateChanged (int state)
void bgColorButton_pressed ()
void lnColorButton_pressed ()
void txtColorButton_pressed ()
void codeEdit_textChanged (const QString &s)
void resetButton_clicked ()
void okButton_pressed ()
void cancelButton_pressed ()

Protected Member Functions

bool paintBarcode (QString fileName=0, int dpi=72)
 Create bitmap for current BC. When tt's called for preview, the 72dpi, small PNG image is created each time user change GUI. No need to call it for final rendering because we have PS file created from "preview" run.
void paintColorSample (QLabel *l, QColor c)
 Create color preview. Used for Color box feedback.
bool codeEdit_check (const QString &s)
 Perform BarcodeCheckType checks here.

Protected Attributes

Ui::BarcodeGeneratorBase ui
 GUI namespace content. See designer.
BarcodeMap map
 BC/BC type mapping. QMap keys are used as BC names.
QColor lnColor
 Color of the BC lines.
QColor txtColor
 Color of the BC font.
QColor bgColor
 Background color of the BC.
QString psCommand
 A PS command taken from barcode.ps with scribus related addons.
QString tmpFile
 A temporary png pixmap to store the preview image.
QString psFile
 A temporary PS file to store commants for Ghostscript.
bool useSamples
 Flag if user modified the codeEditor. To stop replacing his code with samples.
QColor guiColor


Detailed Description

Active tasts for BC GUI. It's inherited from BarcodeGeneratorBase() class which is created by uic from designer. Don't change anything in BarcodeGeneratorBase manually! It will be overwritten automatically by uic.

Author:
Petr Vanek <petr@yarpen.cz>

Definition at line 59 of file barcodegenerator.h.


Constructor & Destructor Documentation

BarcodeGenerator::BarcodeGenerator ( QWidget *  parent = 0,
const char *  name = 0 
)

Create modal BC dialog.

Parameters:
parent Parent of the dialog.
name name od the QObject to debug

Definition at line 34 of file barcodegenerator.cpp.

References bcComboChanged(), bgColor, ScPaths::getTempFileDir(), guiColor, ScPaths::instance(), lnColor, loadIcon(), map, paintColorSample(), psCommand, psFile, tmpFile, tr(), CommonStrings::tr_Cancel, CommonStrings::tr_OK, txtColor, ui, and useSamples.

BarcodeGenerator::~BarcodeGenerator (  ) 

Erase the temporary files here.

Definition at line 133 of file barcodegenerator.cpp.

References psFile, and tmpFile.


Member Function Documentation

bool BarcodeGenerator::paintBarcode ( QString  fileName = 0,
int  dpi = 72 
) [protected]

Create bitmap for current BC. When tt's called for preview, the 72dpi, small PNG image is created each time user change GUI. No need to call it for final rendering because we have PS file created from "preview" run.

Parameters:
fileName a optional file name to store on user's filesyste,
dpi optional DPI value. Default is 72 for preview.
Return values:
bool true on success.

Definition at line 274 of file barcodegenerator.cpp.

References bgColor, callGS(), lnColor, map, psCommand, psFile, tmpFile, tr(), txtColor, and ui.

Referenced by bcComboChanged(), bgColorButton_pressed(), codeEdit_check(), guardCheck_changed(), includeCheck_stateChanged(), includeCheckInText_stateChanged(), lnColorButton_pressed(), textCheck_changed(), and txtColorButton_pressed().

void BarcodeGenerator::paintColorSample ( QLabel *  l,
QColor  c 
) [protected]

Create color preview. Used for Color box feedback.

Parameters:
l A pointer to the sample QLabel
c A color to fill

Definition at line 192 of file barcodegenerator.cpp.

Referenced by BarcodeGenerator(), bgColorButton_pressed(), lnColorButton_pressed(), and txtColorButton_pressed().

bool BarcodeGenerator::codeEdit_check ( const QString &  s  )  [protected]

Perform BarcodeCheckType checks here.

Parameters:
s new string

Definition at line 246 of file barcodegenerator.cpp.

References paintBarcode().

Referenced by bcComboChanged(), and codeEdit_textChanged().

void BarcodeGenerator::bcComboChanged (  )  [protected, slot]

void BarcodeGenerator::textCheck_changed (  )  [protected, slot]

Definition at line 169 of file barcodegenerator.cpp.

References paintBarcode(), and ui.

void BarcodeGenerator::guardCheck_changed (  )  [protected, slot]

Definition at line 177 of file barcodegenerator.cpp.

References paintBarcode().

void BarcodeGenerator::includeCheck_stateChanged ( int  state  )  [protected, slot]

Definition at line 182 of file barcodegenerator.cpp.

References paintBarcode().

void BarcodeGenerator::includeCheckInText_stateChanged ( int  state  )  [protected, slot]

Definition at line 187 of file barcodegenerator.cpp.

References paintBarcode().

void BarcodeGenerator::bgColorButton_pressed (  )  [protected, slot]

Definition at line 200 of file barcodegenerator.cpp.

References bgColor, paintBarcode(), paintColorSample(), and ui.

void BarcodeGenerator::lnColorButton_pressed (  )  [protected, slot]

Definition at line 210 of file barcodegenerator.cpp.

References lnColor, paintBarcode(), paintColorSample(), and ui.

void BarcodeGenerator::txtColorButton_pressed (  )  [protected, slot]

Definition at line 220 of file barcodegenerator.cpp.

References paintBarcode(), paintColorSample(), txtColor, and ui.

void BarcodeGenerator::codeEdit_textChanged ( const QString &  s  )  [protected, slot]

Definition at line 268 of file barcodegenerator.cpp.

References codeEdit_check(), and useSamples.

Referenced by bcComboChanged().

void BarcodeGenerator::resetButton_clicked (  )  [protected, slot]

Definition at line 336 of file barcodegenerator.cpp.

References bcComboChanged(), and useSamples.

void BarcodeGenerator::okButton_pressed (  )  [protected, slot]

void BarcodeGenerator::cancelButton_pressed (  )  [protected, slot]

Definition at line 241 of file barcodegenerator.cpp.


Member Data Documentation

Ui::BarcodeGeneratorBase BarcodeGenerator::ui [protected]

BC/BC type mapping. QMap keys are used as BC names.

Definition at line 76 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), bcComboChanged(), and paintBarcode().

QColor BarcodeGenerator::lnColor [protected]

Color of the BC lines.

Definition at line 78 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), lnColorButton_pressed(), and paintBarcode().

QColor BarcodeGenerator::txtColor [protected]

Color of the BC font.

Definition at line 80 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), paintBarcode(), and txtColorButton_pressed().

QColor BarcodeGenerator::bgColor [protected]

Background color of the BC.

Definition at line 82 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), bgColorButton_pressed(), and paintBarcode().

QString BarcodeGenerator::psCommand [protected]

A PS command taken from barcode.ps with scribus related addons.

Definition at line 84 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), and paintBarcode().

QString BarcodeGenerator::tmpFile [protected]

A temporary png pixmap to store the preview image.

Definition at line 86 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), paintBarcode(), and ~BarcodeGenerator().

QString BarcodeGenerator::psFile [protected]

A temporary PS file to store commants for Ghostscript.

Definition at line 88 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), okButton_pressed(), paintBarcode(), and ~BarcodeGenerator().

bool BarcodeGenerator::useSamples [protected]

Flag if user modified the codeEditor. To stop replacing his code with samples.

Definition at line 91 of file barcodegenerator.h.

Referenced by BarcodeGenerator(), bcComboChanged(), codeEdit_textChanged(), and resetButton_clicked().

QColor BarcodeGenerator::guiColor [protected]

Definition at line 92 of file barcodegenerator.h.

Referenced by BarcodeGenerator().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.