Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSWidget.h
Show All 18 Lines | |||||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | 19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #pragma once | 22 | #pragma once | ||
23 | 23 | | |||
24 | #include <QWidget> | 24 | #include <QWidget> | ||
25 | #include <QPixmap> | 25 | #include <QPixmap> | ||
26 | 26 | | |||
27 | #include "SpectacleCommon.h" | 27 | #include "BackendInterfaces/ScreenshotInterface.h" | ||
28 | #include "Platforms/Platform.h" | | |||
29 | 28 | | |||
30 | class QAction; | 29 | class QAction; | ||
31 | class QGridLayout; | 30 | class QGridLayout; | ||
32 | class QHBoxLayout; | 31 | class QHBoxLayout; | ||
33 | class QVBoxLayout; | 32 | class QVBoxLayout; | ||
34 | class QFormLayout; | 33 | class QFormLayout; | ||
35 | class QComboBox; | 34 | class QComboBox; | ||
36 | class QCheckBox; | 35 | class QCheckBox; | ||
37 | class QLabel; | 36 | class QLabel; | ||
38 | 37 | | |||
39 | class KSImageWidget; | 38 | class KSImageWidget; | ||
40 | class ProgressButton; | 39 | class ProgressButton; | ||
41 | class SmartSpinBox; | 40 | class SmartSpinBox; | ||
42 | 41 | | |||
43 | class KSWidget : public QWidget | 42 | class KSWidget : public QWidget | ||
44 | { | 43 | { | ||
45 | Q_OBJECT | 44 | Q_OBJECT | ||
46 | 45 | | |||
47 | public: | 46 | public: | ||
48 | 47 | | |||
49 | explicit KSWidget(const Platform::GrabModes &theGrabModes, QWidget *parent = nullptr); | 48 | explicit KSWidget(const CaptureModes &theCaptureModes, QWidget *parent = nullptr); | ||
50 | virtual ~KSWidget() = default; | 49 | virtual ~KSWidget() = default; | ||
51 | 50 | | |||
52 | 51 | | |||
53 | enum class State { | 52 | enum class State { | ||
54 | TakeNewScreenshot, | 53 | TakeNewScreenshot, | ||
55 | Cancel | 54 | Cancel | ||
56 | }; | 55 | }; | ||
57 | 56 | | |||
58 | int imagePaddingWidth() const; | 57 | int imagePaddingWidth() const; | ||
59 | 58 | | |||
60 | Q_SIGNALS: | 59 | Q_SIGNALS: | ||
61 | 60 | | |||
62 | void dragInitiated(); | 61 | void dragInitiated(); | ||
63 | void newScreenshotRequest(Spectacle::CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | 62 | void newScreenshotRequest(CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | ||
64 | void screenshotCanceled(); | 63 | void screenshotCanceled(); | ||
65 | 64 | | |||
66 | public Q_SLOTS: | 65 | public Q_SLOTS: | ||
67 | 66 | | |||
67 | void initComboBox(const CaptureModes &theCaptureModes); | ||||
68 | | ||||
68 | void setScreenshotPixmap(const QPixmap &thePixmap); | 69 | void setScreenshotPixmap(const QPixmap &thePixmap); | ||
69 | void lockOnClickDisabled(); | 70 | void lockOnClickDisabled(); | ||
70 | void lockOnClickEnabled(); | 71 | void lockOnClickEnabled(); | ||
71 | void setButtonState(State state); | 72 | void setButtonState(State state); | ||
72 | void setProgress(double progress); | 73 | void setProgress(double progress); | ||
73 | 74 | | |||
74 | private Q_SLOTS: | 75 | private Q_SLOTS: | ||
75 | 76 | | |||
Show All 26 Lines |