karbon

vstrokefillpreview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002, The Karbon Developers
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __VSTROKEFILLPREVIEW_H__
00021 #define __VSTROKEFILLPREVIEW_H__
00022 
00023 #include <qframe.h>
00024 #include <qpixmap.h>
00025 
00026 class VKoPainter;
00027 class VFill;
00028 class VStroke;
00029 class KarbonPart;
00030 
00031 class VStrokeFillPreview : public QFrame
00032 {
00033     Q_OBJECT
00034 
00035 public:
00036     VStrokeFillPreview( KarbonPart *part, QWidget* parent = 0L, const char* name = 0L );
00037     ~VStrokeFillPreview();
00038 
00039     virtual QSize sizeHint() const
00040         { return QSize( 50, 50 ); }
00041     virtual QSize minimumSizeHint() const
00042         { return QSize( 20, 20 ); }
00043     virtual QSizePolicy sizePolicy() const
00044         { return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); }
00045 
00046     void update( const VStroke &, const VFill & );
00047 
00048     virtual bool eventFilter( QObject* object, QEvent* event );
00049 
00050     bool strokeIsSelected() const { return m_strokeWidget; }
00051 
00052 signals:
00053     void strokeChanged( const VStroke & );
00054     void fillChanged( const VFill& );
00055     void fillSelected();
00056     void strokeSelected();
00057 
00058 protected:
00059     virtual void paintEvent( QPaintEvent* event );
00060 
00061 private:
00062     VKoPainter* m_painter;
00063     void drawFill( const VFill & );
00064     void drawStroke( const VStroke & );
00065     QPixmap m_pixmap;
00066     KarbonPart *m_part;
00067     bool m_strokeWidget;
00068     const VFill *m_fill;
00069     const VStroke *m_stroke;
00070 };
00071 
00072 #endif
00073 
KDE Home | KDE Accessibility Home | Description of Access Keys