MainWindow.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*********************************************************************/
  2. /* */
  3. /* Copyright 2022-2023 Rémi Synave - remi.synave@univ-littoral.fr */
  4. /* */
  5. /* This file is part of DSL. */
  6. /* This software uses Qt to build the Graphical User Interface */
  7. /* https://www.qt.io/ */
  8. /* */
  9. /* DSL is free software: you can redistribute it and/or modify */
  10. /* it under the terms of the GNU General Public License as published */
  11. /* by the Free Software Foundation, either version 3 of the License, */
  12. /* or (at your option) any later version. */
  13. /* */
  14. /* DSL is distributed in the hope that it will be useful, */
  15. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  16. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  17. /* GNU General Public License for more details. */
  18. /* */
  19. /* You should have received a copy of the GNU General Public License */
  20. /* along with DSL. If not, see <http://www.gnu.org/licenses/>. */
  21. /* */
  22. /*********************************************************************/
  23. #ifndef MAINWINDOW_HPP
  24. #define MAINWINDOW_HPP
  25. #include <QMainWindow>
  26. #include <QAction>
  27. #include <QMenu>
  28. #include <QString>
  29. #include <QMessageBox>
  30. #include "WorkArea.hpp"
  31. class MainWindow: public QMainWindow
  32. {
  33. Q_OBJECT
  34. private:
  35. QMenu *fileMenu;
  36. QMenu *editMenu;
  37. QMenu *imageMenu;
  38. QAction *openAct;
  39. QAction *saveAct;
  40. QAction *exportAct;
  41. QAction *exitAct;
  42. QAction *automaticLoadingAct;
  43. QAction *automaticSavingAct;
  44. QAction *readOnlyAct;
  45. QAction *firstImageAct;
  46. QAction *previousImageAct;
  47. QAction *nextImageAct;
  48. QAction *lastImageAct;
  49. QAction *aboutAct;
  50. WorkArea *wa;
  51. QStringList *filenames;
  52. int openedImage;
  53. QString *directoryname;
  54. QString *suffix;
  55. bool autoLoad;
  56. bool autoSave;
  57. void createActions ();
  58. void createMenus ();
  59. void loadImage ();
  60. QMessageBox::StandardButton checkModificationinProgress();
  61. private slots:
  62. void openFile ();
  63. void save ();
  64. void exportPNG ();
  65. void exportJPG ();
  66. void firstImage ();
  67. void previousImage ();
  68. void nextImage ();
  69. void lastImage ();
  70. void automaticLoading ();
  71. void automaticSaving ();
  72. void readOnly ();
  73. void about ();
  74. public:
  75. MainWindow ();
  76. };
  77. #endif