diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-15 18:34:54 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-15 18:34:54 +0000 |
commit | 8805e6b17b1460f3316ccb28629e8ad78e4b9c2c (patch) | |
tree | dc9b702962ecf0060cc473397b9f80268c2456c9 /kbarcode/gnubarcode.h | |
download | kbarcode-8805e6b17b1460f3316ccb28629e8ad78e4b9c2c.tar.gz kbarcode-8805e6b17b1460f3316ccb28629e8ad78e4b9c2c.zip |
Added abandoned KDE3 version of kbarcode
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1090667 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/gnubarcode.h')
-rw-r--r-- | kbarcode/gnubarcode.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/kbarcode/gnubarcode.h b/kbarcode/gnubarcode.h new file mode 100644 index 0000000..afdec8e --- /dev/null +++ b/kbarcode/gnubarcode.h @@ -0,0 +1,75 @@ +/*************************************************************************** + gnubarcode.h - description + ------------------- + begin : + copyright : (C) 2005 by Dominik Seichter + email : domseichter@web.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef GNU_BARCODE_H +#define GNU_BARCODE_H + +// #define _ENABLE_NATIVE_GNU_BARCODE + +#ifdef _ENABLE_NATIVE_GNU_BARCODE + +#include "barkodeengine.h" + +struct Barcode_Item; + +class GnuBarcode : public BarkodeEngine { + public: + GnuBarcode(); + ~GnuBarcode(); + + inline EEngine engine() const; + + const QSize size() const; + void update( const QPaintDevice* device ); + void drawBarcode( QPainter & painter, int x, int y ); + + private: + /** Draws the barcodes bars if @p painter is not 0. + * Otherwise only the required width is returned. + */ + int drawBars( QPainter* painter, int x, int y ); + + /** Draws the text if @p painter is not 0. + * Otherwise only the required width is returned. + */ + int drawText( QPainter* painter, int x, int y ); + + /** Fill m_size with the needed space + */ + void setupSize(); + + private: + int m_bar_height; + int m_barcode_height; + int m_font_size; + + double m_scalex; + double m_scaley; + double m_scale_ps_x; + double m_scale_ps_y; + + Barcode_Item* m_item; + QSize m_size; +}; + +EEngine GnuBarcode::engine() const +{ + return GNU_BARCODE; +} + +#endif // _ENABLE_NATIVE_GNU_BARCODE +#endif /* GNU_BARCODE_H */ |