scalewindow.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Zint Barcode Generator - the open source barcode generator
  3. Copyright (C) 2022-2023 Robin Stuart <rstuart114@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. /* SPDX-License-Identifier: GPL-3.0-or-later */
  17. #ifndef SCALEWINDOW_H
  18. #define SCALEWINDOW_H
  19. #include "ui_extScale.h"
  20. #include "barcodeitem.h"
  21. class ScaleWindow : public QDialog, private Ui::ScaleDialog
  22. {
  23. Q_OBJECT
  24. private:
  25. BarcodeItem *m_bc;
  26. public:
  27. ScaleWindow(BarcodeItem *bc, struct Zint::QZintXdimDpVars *vars, double originalScale);
  28. ~ScaleWindow();
  29. bool Valid;
  30. struct Zint::QZintXdimDpVars m_vars;
  31. signals:
  32. void scaleChanged(double scale);
  33. public slots:
  34. void size_msg_ui_set();
  35. private slots:
  36. void unset_scale();
  37. void okay();
  38. void update_scale();
  39. void x_dim_units_change();
  40. void x_dim_default();
  41. void resolution_units_change();
  42. void resolution_default();
  43. private:
  44. float get_x_dim_mm() const;
  45. float get_dpmm() const;
  46. const char *getFileType() const;
  47. void set_maxima();
  48. double update_vars();
  49. double m_originalScale;
  50. bool m_unset;
  51. };
  52. /* vim: set ts=4 sw=4 et : */
  53. #endif