00001 // $Id: screenshot.h,v 1.1 2005/06/13 13:20:28 rcr_muc Exp $ 00002 // do different kinds of screenshots, save them as PNG 00003 // 2005-06-08 rcr 00004 00005 #ifndef SCREENSHOT_H 00006 #define SCREENSHOT_H 00007 00008 #include <qrect.h> 00009 #include <qpixmap.h> 00010 #include <qimage.h> 00011 #include <qstring.h> 00012 00013 #include "screenshotui.h" 00014 00015 class QTimer; 00016 class AreaGrab; 00017 00018 class ScreenShot : public ScreenShotUI 00019 { 00020 Q_OBJECT 00021 00022 enum Mode { screen, window, area }; 00023 Mode mode; 00024 int delay; 00025 QTimer* timer; 00026 QPixmap shotPixmap; 00027 QImage shotImage; 00028 bool haveImage; 00029 QString workDir, fileName, baseName; 00030 int shotCount; 00031 QRect areaRect; 00032 AreaGrab* selectArea; 00033 00034 void getWindow(); 00035 void displayShot(); 00036 public: 00037 ScreenShot( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 00038 00039 public slots: 00040 void shoot(); 00041 void save(); 00042 void target( int ); 00043 void delaychanged( int ); 00044 void fileSelect(); 00045 void fileChanged(); 00046 void timeout(); 00047 void areaSelected( const QRect& ); 00048 void areaSelect(); 00049 00050 /* just to help me remember the names... 00051 QFrame* shotFrame; 00052 QButtonGroup* buttonGroup1; 00053 QRadioButton* screenRadioButton; 00054 QRadioButton* windowRadioButton; 00055 QRadioButton* areaRadioButton; 00056 QSpinBox* timerSpinBox; 00057 QToolButton* fileToolButton; 00058 QLineEdit* fileLineEdit; 00059 QPushButton* shootPushButton; 00060 QPushButton* savePushButton; 00061 QPushButton* cancelPushButton; 00062 */ 00063 }; 00064 00065 #endif // SCREENSHOT_H