compile
[kdegraphics.git] / ksnapshot / ksnapshotobject.h
blobed6469ea1379206718b7d62192e8ccdfcfdf36f9
1 /*
2 * Copyright (C) 1997-2002 Richard J. Moore <rich@kde.org>
3 * Copyright (C) 2000 Matthias Ettrich <ettrich@troll.no>
4 * Copyright (C) 2002 Aaron J. Seigo <aseigo@kde.org>
5 * Copyright (C) 2003 Nadeem Hasan <nhasan@kde.org>
6 * Copyright (C) 2004 Bernd Brandstetter <bbrand@freenet.de>
7 * Copyright (C) 2006 Urs Wolfer <uwolfer @ kde.org>
8 * Copyright (C) 2007 Montel Laurent <montel@kde.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
26 #ifndef KSNAPSHOTOBJECT_H
27 #define KSNAPSHOTOBJECT_H
29 #include <KUrl>
30 #include <QPixmap>
31 class QWidget;
32 class RegionGrabber;
33 class QString;
35 class KSnapshotObject
37 public:
38 enum CaptureMode { FullScreen=0, WindowUnderCursor=1, Region=2, ChildWindow=3, CurrentScreen=4 };
39 KSnapshotObject();
40 virtual ~KSnapshotObject();
42 bool save( const QString &filename, QWidget* widget = 0);
43 bool save( const KUrl& url, QWidget *widget );
44 bool saveEqual( const KUrl& url,QWidget *widget );
45 bool saveImage( QIODevice *device, const QByteArray &format );
47 protected:
48 void autoincFilename();
49 virtual void refreshCaption(){}
51 void changeUrl(const QString &newUrl);
53 KUrl filename;
54 RegionGrabber *rgnGrab;
55 QWidget* grabber;
56 QPixmap snapshot;
57 QString title;
58 QString windowClass;
61 #endif