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