1 /** -*- mode: c++ ; c-basic-offset: 2 -*-
2  *
3  *  @file InOutPanel.h
4  *
5  *  Copyright 2017 Sebastien Fourey
6  *
7  *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
8  *  editors, offering hundreds of filters thanks to the underlying G'MIC
9  *  image processing framework.
10  *
11  *  gmic_qt is free software: you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation, either version 3 of the License, or
14  *  (at your option) any later version.
15  *
16  *  gmic_qt is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
23  *
24  */
25 #ifndef GMIC_QT_INOUTPANEL_H
26 #define GMIC_QT_INOUTPANEL_H
27 
28 #include <QWidget>
29 #include "Host/host.h"
30 #include "InputOutputState.h"
31 #include "gmic_qt.h"
32 
33 namespace Ui
34 {
35 class InOutPanel;
36 }
37 
38 class QSettings;
39 class QPalette;
40 class FilterThread;
41 
42 class InOutPanel : public QWidget {
43   Q_OBJECT
44 
45 public:
46   explicit InOutPanel(QWidget * parent = nullptr);
47   ~InOutPanel();
48 
49 public:
50   GmicQt::InputMode inputMode() const;
51   GmicQt::OutputMode outputMode() const;
52   GmicQt::PreviewMode previewMode() const;
53   GmicQt::OutputMessageMode outputMessageMode() const;
54   void reset();
55 
56   void disableNotifications();
57   void enableNotifications();
58   void setInputMode(GmicQt::InputMode mode);
59   void setOutputMode(GmicQt::OutputMode mode);
60   void setPreviewMode(GmicQt::PreviewMode mode);
61 
62   GmicQt::InputOutputState state() const;
63   void setState(const GmicQt::InputOutputState & state, bool notify);
64 
65   void setEnabled(bool);
66   void disable();
67   void enable();
68 
69 signals:
70   void inputModeChanged(GmicQt::InputMode);
71   void previewModeChanged(GmicQt::PreviewMode);
72 
73 public slots:
74   void onInputModeSelected(int);
75   void onOutputModeSelected(int);
76   void onPreviewModeSelected(int);
77   void onResetButtonClicked();
78   void setDarkTheme();
79 
80 private:
81   bool _notifyValueChange;
82   Ui::InOutPanel * ui;
83   static const int NoSelection = -1;
84 };
85 
86 #endif // GMIC_QT_INOUTPANEL_H
87