Back to index

scribus-ng  1.3.4.dfsg+svn20071115
barcodegenerator.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 
00008 #ifndef BARCODEGENERATOR_H
00009 #define BARCODEGENERATOR_H
00010 
00011 #include "barcodegeneratorbase.h"
00012 #include <qmap.h>
00013 #include <qstring.h>
00014 
00015 class QColor;
00016 class QLabel;
00017 
00018 
00022 class BarcodeType
00023 {
00024        public:
00026               BarcodeType(){};
00033               BarcodeType(QString cmd, QString exa,
00034                                    QString comm, QString regExp,
00035                                bool includeCheck=false, bool includeCheckInText=false);
00036               ~BarcodeType(){};
00038               QString command;
00040               QString example;
00042               QString comment;
00044               QString regularExp;
00045               bool includeCheck;
00046               bool includeCheckInText;
00047 };
00048 
00049 
00051 typedef QMap<QString, BarcodeType> BarcodeMap;
00052 
00053 
00060 class BarcodeGenerator : public BarcodeGeneratorBase
00061 {
00062        Q_OBJECT
00063 
00064        public:
00068               BarcodeGenerator(QWidget* parent = 0, const char* name = 0);
00070               ~BarcodeGenerator();
00071 
00072        protected:
00074               BarcodeMap map;
00076               QColor lnColor;
00078               QColor txtColor;
00080               QColor bgColor;
00082               QString psCommand;
00084               QString tmpFile;
00086               QString psFile;
00089               bool useSamples;
00090               QColor guiColor;
00091 
00100               bool paintBarcode(QString fileName = 0, int dpi = 72);
00105               void paintColorSample(QLabel *l, QColor c);
00108               bool codeEdit_check(const QString& s);
00109 
00110        protected slots:
00111               void bcComboChanged();
00112               void textCheck_changed();
00113               void guardCheck_changed();
00114               void includeCheck_stateChanged(int state);
00115               void includeCheckInText_stateChanged(int state);
00116               void bgColorButton_pressed();
00117               void lnColorButton_pressed();
00118               void txtColorButton_pressed();
00119               void codeEdit_textChanged(const QString& s);
00120               void resetButton_clicked();
00121               void okButton_pressed();
00122               void cancelButton_pressed();
00123 };
00124 
00125 #endif