Changeset View
Changeset View
Standalone View
Standalone View
src/ExportManager.h
1 | /* | 1 | /* This file is part of Spectacle, the KDE screenshot utility | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | 2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Lesser General Public License as published by | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 7 | * (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | * | ||||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||||
18 | */ | 20 | */ | ||
19 | 21 | | |||
20 | #ifndef EXPORTMANAGER_H | 22 | #pragma once | ||
21 | #define EXPORTMANAGER_H | 23 | | ||
24 | #include <SpectacleCommon.h> | ||||
22 | 25 | | |||
23 | #include <QObject> | 26 | #include <QObject> | ||
24 | #include <QIODevice> | 27 | #include <QIODevice> | ||
Context not available. | |||||
27 | #include <QPixmap> | 30 | #include <QPixmap> | ||
28 | #include <QDateTime> | 31 | #include <QDateTime> | ||
29 | #include <QUrl> | 32 | #include <QUrl> | ||
30 | | ||||
31 | #include <KLocalizedString> | 33 | #include <KLocalizedString> | ||
32 | 34 | | |||
33 | #include "PlatformBackends/ImageGrabber.h" | | |||
34 | | ||||
35 | class QTemporaryDir; | 35 | class QTemporaryDir; | ||
36 | 36 | | |||
37 | class ExportManager : public QObject | 37 | class ExportManager: public QObject | ||
38 | { | 38 | { | ||
39 | Q_OBJECT | 39 | Q_OBJECT | ||
40 | 40 | | |||
Context not available. | |||||
56 | 56 | | |||
57 | public: | 57 | public: | ||
58 | 58 | | |||
59 | Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged) | | |||
60 | Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) | | |||
61 | Q_PROPERTY(ImageGrabber::GrabMode grabMode READ grabMode WRITE setGrabMode) | | |||
62 | | ||||
63 | QString defaultSaveLocation() const; | 59 | QString defaultSaveLocation() const; | ||
64 | bool isFileExists(const QUrl &url) const; | 60 | bool isFileExists(const QUrl &url) const; | ||
65 | void setPixmap(const QPixmap &pixmap); | 61 | void setPixmap(const QPixmap &pixmap); | ||
66 | QPixmap pixmap() const; | 62 | QPixmap pixmap() const; | ||
67 | void updatePixmapTimestamp(); | 63 | void updatePixmapTimestamp(); | ||
68 | void setTimestamp(const QDateTime ×tamp); | 64 | void setTimestamp(const QDateTime ×tamp); | ||
69 | void setWindowTitle(const QString &windowTitle); | | |||
70 | QString windowTitle() const; | 65 | QString windowTitle() const; | ||
71 | ImageGrabber::GrabMode grabMode() const; | 66 | Spectacle::CaptureMode captureMode() const; | ||
72 | void setGrabMode(const ImageGrabber::GrabMode &grabMode); | 67 | void setCaptureMode(const Spectacle::CaptureMode &theCaptureMode); | ||
73 | QString formatFilename(const QString &nameTemplate); | 68 | QString formatFilename(const QString &nameTemplate); | ||
74 | 69 | | |||
75 | static const QMap<QString, KLocalizedString> filenamePlaceholders; | 70 | static const QMap<QString, KLocalizedString> filenamePlaceholders; | ||
Context not available. | |||||
86 | QUrl getAutosaveFilename(); | 81 | QUrl getAutosaveFilename(); | ||
87 | QUrl tempSave(); | 82 | QUrl tempSave(); | ||
88 | 83 | | |||
84 | void setWindowTitle(const QString &windowTitle); | ||||
89 | void doSave(const QUrl &url = QUrl(), bool notify = false); | 85 | void doSave(const QUrl &url = QUrl(), bool notify = false); | ||
90 | bool doSaveAs(QWidget *parentWindow = nullptr, bool notify = false); | 86 | bool doSaveAs(QWidget *parentWindow = nullptr, bool notify = false); | ||
91 | void doCopyToClipboard(bool notify); | 87 | void doCopyToClipboard(bool notify); | ||
Context not available. | |||||
111 | QTemporaryDir *mTempDir; | 107 | QTemporaryDir *mTempDir; | ||
112 | QList<QUrl> mUsedTempFileNames; | 108 | QList<QUrl> mUsedTempFileNames; | ||
113 | QString mWindowTitle; | 109 | QString mWindowTitle; | ||
114 | ImageGrabber::GrabMode mGrabMode; | 110 | Spectacle::CaptureMode mCaptureMode { Spectacle::CaptureMode::AllScreens }; | ||
115 | }; | 111 | }; | ||
116 | | ||||
117 | #endif // EXPORTMANAGER_H | | |||
Context not available. |