MainWindow.hpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 *readOnlyAct;
  44. QAction *firstImageAct;
  45. QAction *previousImageAct;
  46. QAction *nextImageAct;
  47. QAction *lastImageAct;
  48. QAction *aboutAct;
  49. WorkArea *wa;
  50. QStringList *filenames;
  51. int openedImage;
  52. QString *directoryname;
  53. QString *suffix;
  54. bool autoLoad;
  55. void createActions ();
  56. void createMenus ();
  57. void loadImage ();
  58. QMessageBox::StandardButton checkModificationinProgress();
  59. private slots:
  60. void openFile ();
  61. void save ();
  62. void exportPNG ();
  63. void firstImage ();
  64. void previousImage ();
  65. void nextImage ();
  66. void lastImage ();
  67. void automaticLoading ();
  68. void readOnly ();
  69. void about ();
  70. public:
  71. MainWindow ();
  72. };
  73. #endif