zint/frontend_qt/mainwindow.h

99 lines
3.8 KiB
C
Raw Normal View History

2008-07-19 02:49:14 +12:00
/***************************************************************************
2009-04-27 10:04:51 +12:00
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
2020-04-07 03:37:34 +12:00
* Copyright (C) 2009-2020 by Robin Stuart <rstuart114@gmail.com> *
2008-07-19 02:49:14 +12:00
* *
* This program is free software: you can redistribute it and/or modify *
2008-07-19 02:49:14 +12:00
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
2008-07-19 02:49:14 +12:00
* (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/>. *
2008-07-19 02:49:14 +12:00
***************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui>
#include <QGraphicsItem>
2009-05-22 09:00:23 +12:00
#include <QMainWindow>
2016-12-15 12:33:17 +13:00
#include <QGraphicsScene>
2008-07-19 02:49:14 +12:00
#include "ui_mainWindow.h"
#include "barcodeitem.h"
2009-05-22 09:00:23 +12:00
class QLabel;
2009-05-20 02:05:26 +12:00
2008-07-19 02:49:14 +12:00
class MainWindow : public QWidget, private Ui::mainWindow
{
Q_OBJECT
2008-07-19 02:49:14 +12:00
public:
MainWindow(QWidget *parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
~MainWindow();
2008-07-19 02:49:14 +12:00
public slots:
void update_preview();
void change_options();
void on_fgcolor_clicked();
void on_bgcolor_clicked();
void composite_ui_set();
void composite_ean_check();
void maxi_scm();
void msi_plessey_ui_set();
void change_print_scale();
void change_cmyk();
void autoheight_ui_set();
void HRTShow_ui_set();
void dotty_ui_set();
void on_encoded();
void filter_symbologies();
2009-05-20 02:05:26 +12:00
2016-12-15 12:33:17 +13:00
protected:
void resizeEvent(QResizeEvent *event);
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base);
void set_gs1_mode(bool gs1_mode);
void set_smaller_font(QLabel *note);
const char *get_setting_name(int symbology);
int get_button_group_index(const QStringList &children);
void set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children, int default_val = 0);
int get_combobox_index(const QString &child);
void set_combobox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
int get_checkbox_val(const QString &child);
void set_checkbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
double get_doublespinbox_val(const QString &child);
void set_doublespinbox_from_setting(QSettings &settings, const QString &setting, const QString &child, float default_val = 0.0f);
QString get_lineedit_val(const QString &child);
void set_lineedit_from_setting(QSettings &settings, const QString &setting, const QString &child, const char *default_val = "");
int get_spinbox_val(const QString &child);
void set_spinbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
void save_sub_settings(QSettings &settings, int symbology);
void load_sub_settings(QSettings &settings, int symbology);
2017-10-24 08:37:52 +13:00
2009-05-20 02:05:26 +12:00
private slots:
bool save();
void about();
void quit_now();
void reset_view();
int open_data_dialog();
int open_sequence_dialog();
2017-05-16 08:12:19 +12:00
void copy_to_clipboard_svg();
void copy_to_clipboard_bmp();
2008-07-19 02:49:14 +12:00
private:
QColor m_fgcolor,m_bgcolor;
BarcodeItem m_bc;
QWidget *m_optionWidget;
QGraphicsScene *scene;
int m_symbology;
2008-07-19 02:49:14 +12:00
};
#endif