zint/backend_qt/qzint.h

136 lines
3.5 KiB
C
Raw Normal View History

2008-07-19 02:48:31 +12:00
/***************************************************************************
* Copyright (C) 2008 by BogDan Vatra *
* bogdan@licentia.eu *
* *
* 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 3 of the License, or *
* (at your option) any later version. *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
/* vim: set ts=4 sw=4 et : */
2008-07-19 02:48:31 +12:00
#ifndef BARCODERENDER_H
#define BARCODERENDER_H
#include <QColor>
#include <QPainter>
2008-07-19 02:48:31 +12:00
#include "zint.h"
namespace Zint
{
class QZint
2008-07-19 02:48:31 +12:00
{
2008-10-09 22:55:18 +13:00
private:
2008-07-19 02:48:31 +12:00
public:
enum BorderType{NO_BORDER=0, BIND=2, BOX=4};
enum AspectRatioMode{IgnoreAspectRatio=0, KeepAspectRatio=1, CenterBarCode=2};
2008-07-19 02:48:31 +12:00
public:
QZint();
~QZint();
2008-07-19 02:48:31 +12:00
2017-09-11 03:03:09 +12:00
int symbol() const;
void setSymbol(int symbol);
int inputMode() const;
void setInputMode(int input_mode);
2017-09-11 03:03:09 +12:00
QString text() const;
void setText(const QString & text);
2017-09-11 03:03:09 +12:00
QString primaryMessage() const;
void setPrimaryMessage(const QString & primaryMessage);
int height() const;
void setHeight(int height);
int option2() const;
void setOption2(int option);
void setOption3(int option);
float scale() const;
void setScale(float scale);
2017-10-24 08:37:52 +13:00
void setDotSize(float dot_size);
2017-09-11 03:03:09 +12:00
QColor fgColor() const;
void setFgColor(const QColor & fgColor);
2017-09-11 03:03:09 +12:00
QColor bgColor() const;
void setBgColor(const QColor & bgColor);
2008-07-19 02:48:31 +12:00
2017-09-11 03:03:09 +12:00
BorderType borderType() const;
void setBorderType(BorderType border);
2017-09-11 03:03:09 +12:00
int borderWidth() const;
void setBorderWidth(int boderWidth);
2017-09-11 03:03:09 +12:00
int securityLevel() const;
void setSecurityLevel(int securityLevel);
int mode() const;
void setMode(int securityLevel);
2017-10-24 08:37:52 +13:00
void setWhitespace(int whitespace);
2009-05-20 02:04:49 +12:00
void setHideText(bool hide);
void setTargetSize(int width, int height);
void setGSSep(bool gssep);
void setDebug(bool debug);
2009-05-20 02:04:49 +12:00
int getError() const;
2008-07-19 02:48:31 +12:00
QString error_message() const;
2009-05-20 02:04:49 +12:00
const QString & lastError() const;
bool hasErrors() const;
2017-10-24 08:37:52 +13:00
bool save_to_file(QString filename);
2017-10-24 08:37:52 +13:00
void render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode=IgnoreAspectRatio);
2009-07-08 07:10:22 +12:00
2008-07-19 02:48:31 +12:00
private:
void resetSymbol();
void encode();
2008-07-19 02:48:31 +12:00
private:
int m_symbol;
QString m_text;
QString m_primaryMessage;
int m_height;
BorderType m_border;
int m_borderWidth;
int m_option_2;
int m_securityLevel;
int m_input_mode;
QColor m_fgColor;
QColor m_bgColor;
QString m_lastError;
int m_error;
int m_whitespace;
zint_symbol * m_zintSymbol;
float m_scale;
int m_option_3;
bool m_hidetext;
2017-09-11 03:03:09 +12:00
float m_dot_size;
int target_size_horiz;
int target_size_vert;
bool m_gssep;
bool m_debug;
2008-07-19 02:48:31 +12:00
};
}
#endif
2017-10-24 08:37:52 +13:00