diff options
Diffstat (limited to 'ksnapshot/ksnapshot.h')
| -rw-r--r-- | ksnapshot/ksnapshot.h | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/ksnapshot/ksnapshot.h b/ksnapshot/ksnapshot.h index 5db7c0e6..45734f88 100644 --- a/ksnapshot/ksnapshot.h +++ b/ksnapshot/ksnapshot.h @@ -1,11 +1,11 @@ -// -*- c++ -*- - #ifndef KSNAPSHOT_H #define KSNAPSHOT_H #include "ksnapshotiface.h" #include <tqbitmap.h> #include <tqcursor.h> +#include <tqdatetime.h> +#include <tqdragobject.h> #include <tqlabel.h> #include <tqpainter.h> #include <tqpixmap.h> @@ -16,14 +16,16 @@ #include <tdeglobalsettings.h> #include <kdialogbase.h> #include <kurl.h> +#include <ktrader.h> class RegionGrabber; class KSnapshotWidget; +class KTempFile; +class TDEProcess; class KSnapshotPreview : public TQLabel { - Q_OBJECT - + TQ_OBJECT public: KSnapshotPreview(TQWidget *parent, const char *name = 0) @@ -44,14 +46,14 @@ class KSnapshotPreview : public TQLabel { TQPainter p(&mask); - style().tqdrawPrimitive(TQStyle::PE_SizeGrip, &p, TQRect(0, 0, 15, 15), palette().active()); + style().drawPrimitive(TQStyle::PE_SizeGrip, &p, TQRect(0, 0, 15, 15), palette().active()); p.end(); handle.setMask(mask); } { TQPainter p(&handle); - style().tqdrawPrimitive(TQStyle::PE_SizeGrip, &p, TQRect(0, 0, 15, 15), palette().active()); + style().drawPrimitive(TQStyle::PE_SizeGrip, &p, TQRect(0, 0, 15, 15), palette().active()); p.end(); } @@ -91,8 +93,7 @@ class KSnapshotPreview : public TQLabel class KSnapshot : public KDialogBase, virtual public KSnapshotIface { - Q_OBJECT - + TQ_OBJECT public: KSnapshot(TQWidget *parent= 0, const char *name= 0, bool grabCurrent=false); @@ -102,18 +103,23 @@ public: bool save( const TQString &filename ); TQString url() const { return filename.url(); } + TQString localFile(); protected slots: + void slotAboutToQuit(); void slotGrab(); void slotSave(); void slotSaveAs(); void slotCopy(); void slotPrint(); + void slotOpenWith(int id); + void slotOpenWithKP(); void slotMovePointer( int x, int y ); void setTime(int newTime); void setURL(const TQString &newURL); void setGrabMode( int m ); + void setPixmap(const TQPixmap &newImage); void exit(); protected: @@ -122,21 +128,24 @@ protected: virtual void closeEvent( TQCloseEvent * e ); void resizeEvent(TQResizeEvent*); bool eventFilter( TQObject*, TQEvent* ); - + private slots: void grabTimerDone(); void slotDragSnapshot(); void updateCaption(); void updatePreview(); void slotRegionGrabbed( const TQPixmap & ); - void slotWindowGrabbed( const TQPixmap & ); + void newSnapshot( const TQPixmap & ); private: bool save( const KURL& url ); + void openWithExternalApp(const KService &service); void performGrab(); void autoincFilename(); int grabMode(); int timeout(); + TQString saveTempFile(); + void setLocalFilePath(TQString fp); TQPixmap snapshot; TQTimer grabTimer; @@ -145,7 +154,28 @@ private: KURL filename; KSnapshotWidget *mainWidget; RegionGrabber *rgnGrab; + TQDateTime timestamp; bool modified; + TDETrader::OfferList openWithOffers; + TQString localFilePath; + TQDateTime currentFilePathTimestamp; + TQValueList<TQString> tempFiles; + TQPoint oldWinPos; +}; + + +/** + * A small wrapper around TQImageDrag that also passes text/uri-list with a + * temporary file as a fallback variant. + */ +class SnapshotDrag : public TQImageDrag { + TQ_OBJECT + KSnapshot *ksnap; + TQValueList<TQCString> formats; +public: + SnapshotDrag( TQImage image, KSnapshot * dragSource, const char * name = 0 ); + const char * format(int i) const; + TQByteArray encodedData(const char* format) const; }; #endif // KSNAPSHOT_H |
