krita

kis_previewwidget.h

00001 /*
00002  *  kis_previewwidget.h - part of Krita
00003  *
00004  *  Copyright (c) 2001 John Califf  <jcaliff@compuzone.net>
00005  *  Copyright (c) 2004 Bart Coppens <kde@bartcoppens.be>
00006  *  Copyright (c) 2005 Cyrille Berger <cberger@cberger.net>
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021  */
00022 #ifndef __kis_previewwidget_h__
00023 #define __kis_previewwidget_h__
00024 
00025 #include <qimage.h>
00026 #include <qevent.h>
00027 
00028 #include "kis_types.h"
00029 
00030 #include "kis_previewwidgetbase.h"
00031 
00032 class QWidget;
00033 class KisProfile;
00042 class KisPreviewWidget : public PreviewWidgetBase
00043 {
00044     Q_OBJECT
00045 
00046 public:
00048     KisPreviewWidget( QWidget* parent = 0, const char* name = 0 );
00049 
00051     KisPaintDeviceSP getDevice();
00052 
00054     bool getAutoUpdate() const;
00055 
00056     void wheelEvent(QWheelEvent * e);
00057     
00058 public slots:
00059 
00061     void slotSetDevice(KisPaintDeviceSP dev);
00062 
00066     void slotUpdate();
00067 
00069     void slotSetAutoUpdate(bool set);
00070 
00072     void setPreviewDisplayed(bool v);
00073     
00075     void needUpdate();
00076     
00077 signals:
00079     void updated();
00080 
00081 private slots:
00082 
00083     void zoomIn();
00084     void zoomOut();
00085 
00086     void forceUpdate();
00087     
00088 private:
00089 
00090     bool zoomChanged();
00091     
00092     bool m_autoupdate, m_previewIsDisplayed;
00093 
00094     QImage m_scaledOriginal;
00095     QImage m_scaledPreview;
00096     KisPaintDeviceSP m_previewDevice;
00097     
00098     double m_zoom;
00099     KisProfile * m_profile;
00100 
00101     KisPaintDeviceSP m_origDevice;
00102 };
00103 
00104 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys