on b210fee help sign in
unity8/plugins/ScreenGrabber/screengrabber.h
49 lines 1.3 kB history raw
1/*
2 * Copyright (C) 2014-2015 Canonical, Ltd.
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; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef SNAPSHOTTER_H
18#define SNAPSHOTTER_H
20#include <QObject>
21#include <QString>
22#include <QtConcurrent>
24class ScreenGrabber: public QObject
26 Q_OBJECT
28public:
29 explicit ScreenGrabber(QObject *parent = 0);
30 ~ScreenGrabber() = default;
32public Q_SLOTS:
33 void captureAndSave(int angle = 0);
35Q_SIGNALS:
36 void screenshotSaved(const QString &filename);
38private Q_SLOTS:
39 void onScreenshotSaved();
41private:
42 QString makeFileName() const;
43 QString getFormat() const;
44 QString fileNamePrefix;
45 int screenshotQuality = -1; // default quality for the format
46 QFutureWatcher<QString> m_watcher;
47};
49#endif