Debian Codegraph @

src/widgets/MainToolBar.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2019 Damir Porobic <https://github.com/damirporobic>
3 *
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 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21 #ifndef KSNIP_MAINTOOLBAR_H
22 #define KSNIP_MAINTOOLBAR_H
23
24 #include <QToolBar>
25 #include <QAction>
26 #include <QLabel>
27
28 #include "CaptureModePicker.h"
29 #include "CustomSpinBox.h"
30 #include "src/common/provider/scaledSizeProvider/IScaledSizeProvider.h"
31
32 class MainToolBar : public QToolBar
33 {
34 Q_OBJECT
35 public:
36 explicit MainToolBar(
37 const QList<CaptureModes> &captureModes,
38 QAction* undoAction,
39 QAction* redoAction,
40 const QSharedPointer<IIconLoader> &iconLoader,
41 const QSharedPointer<IScaledSizeProvider> &scaledSizeProvider);
42 ~MainToolBar() override;
43 void selectCaptureMode(CaptureModes captureModes);
44 void setCaptureDelay(int delay);
45 void setSaveActionEnabled(bool enabled);
46 void setCopyActionEnabled(bool enabled);
47 void setCropEnabled(bool enabled);
48 QAction* newCaptureAction() const;
49 QAction* saveAction() const;
50 QAction* copyToClipboardAction() const;
51 QAction* cropAction() const;
52 QAction* undoAction() const;
53 QAction* redoAction() const;
54 QList<QAction*> captureActions() const;
55 void setCollapsed(bool isCollapsed);
56 bool isCollapsed() const;
57
58 signals:
59 void captureModeSelected(CaptureModes mode) const;
60 void saveActionTriggered() const;
61 void copyActionTriggered() const;
62 void captureDelayChanged(int delay) const;
63 void cropActionTriggered() const;
64
65 public slots:
66 void newCaptureTriggered();
67
68 private:
69 QToolButton *mSaveButton;
70 QToolButton *mCopyButton;
71 QToolButton *mCropButton;
72 QToolButton *mUndoButton;
73 QToolButton *mRedoButton;
74 CaptureModePicker *mCaptureModePicker;
75 CustomSpinBox *mDelayPicker;
76 QLabel *mDelayLabel;
77 QAction *mNewCaptureAction;
78 QAction *mSaveAction;
79 QAction *mCopyAction;
80 QAction *mCropAction;
81 QAction *mUndoAction;
82 QAction *mRedoAction;
83 };
84
85 #endif //KSNIP_MAINTOOLBAR_H