Main Page | Class List | File List | Class Members

qjpixmapview.h

00001 /* 00002 Copyright(C)2004 Johan Thelin 00003 johan.thelin -at- digitalfanatics.org 00004 00005 Visit: http://www.digitalfanatics.org/e8johan/projects/jseries/index.html 00006 00007 This file is part of the JSeries. 00008 00009 JSeries is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 JSeries is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with JSeries; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 #ifndef QjPIXMAPVIEW_H 00025 #define QjPIXMAPVIEW_H 00026 00027 #include <qscrollview.h> 00028 #include <qpixmap.h> 00029 #include <qpoint.h> 00030 00031 class QPainter; 00032 struct QjPixmapViewPrivate; 00033 00040 class QjPixmapView : public QScrollView 00041 { 00042 Q_OBJECT 00043 00044 public: 00046 QjPixmapView( QWidget *parent = 0, char *name = 0 ); 00048 QjPixmapView( const QPixmap &pm, QWidget *parent = 0, char *name = 0 ); 00050 QjPixmapView( double zoom, const QPixmap &pm, QWidget *parent = 0, char *name = 0 ); 00051 ~QjPixmapView(); 00052 00054 void clear(); 00055 00057 void setPixmap( const QPixmap &pm ); 00059 void setPixmapAndZoom( double zoom, const QPixmap &pm ); 00060 00061 public slots: 00063 void setZoom( double zoom ); 00064 00065 protected: 00067 QPoint pmToViewport( const QPoint &p ); 00069 QPoint viewportToPm( const QPoint &p ); 00070 00071 signals: 00073 void zoomChanged( double ); 00074 00075 protected: 00077 virtual void drawContents( QPainter *p, int clipx, int clipy, int clipw, int cliph ); 00078 00079 private: 00080 QjPixmapViewPrivate *pd; 00081 }; 00082 00083 #endif // QjPIXMAPVIEW_H

Generated on Thu Jul 15 14:25:47 2004 for JSeries by doxygen 1.3.7