Page MenuHomePhabricator (Chris)

screenshot.h
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

screenshot.h

/*
* Copyright (C) 2011 Christian Kaiser
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef SCREENSHOT_H
#define SCREENSHOT_H
#include <QObject>
#include <QDir>
#include <QPixmap>
class Screenshot : public QObject
{
Q_OBJECT
public:
enum Format
{
PNG = 0,
JPEG = 1,
BMP = 2,
TIFF = 3
};
enum Naming
{
Numeric = 0,
Date = 1,
Timestamp = 2,
Empty = 3
};
enum Mode
{
WholeScreen = 0,
ActiveWindow = 1,
SelectedArea = 2,
SelectedWindow = 3
};
enum Result
{
Fail = 0,
Success = 1,
Cancel = 2
};
struct NamingOptions
{
Naming naming;
bool flip;
int leadingZeros;
QString dateFormat;
};
struct Options
{
QString fileName;
Result result;
Format format;
QString prefix;
NamingOptions namingOptions;
QDir directory;
int mode;
int quality;
bool currentMonitor;
bool clipboard;
bool file;
bool preview;
bool magnify;
bool cursor;
bool saveAs;
bool animations;
bool replace;
};
Screenshot(QObject *parent, Screenshot::Options options);
~Screenshot();
Screenshot::Options options() const;
QPixmap &pixmap();
static QString getName(NamingOptions options, QString prefix, QDir directory);
public slots:
void take();
void confirm(bool result = true);
void discard();
void save();
void setPixmap(QPixmap pixmap);
void confirmation();
signals:
void askConfirmation();
void finished();
private:
void activeWindow();
QString newFileName();
QString extension();
void selectedArea();
void selectedWindow();
void wholeScreen();
void grabDesktop();
private:
Screenshot::Options mOptions;
QPixmap mPixmap;
bool mPixmapDelay;
bool mUnloaded;
QString mUnloadFilename;
};
#endif // SCREENSHOT_H

File Metadata

Mime Type
text/x-c++
Expires
Sun, Nov 15, 1:42 AM (2 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
135640
Default Alt Text
screenshot.h (2 KB)

Event Timeline