kpresenter
KPrPolygonPreview.h
00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- 00002 /* This file is part of the KDE project 00003 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org> 00004 Base code from Kontour. 00005 Copyright (C) 1998 Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de) 00006 Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org> 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public 00010 License as published by the Free Software Foundation; either 00011 version 2 of the License, or (at your option) any later version. 00012 00013 This library 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 GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public License 00019 along with this library; see the file COPYING.LIB. If not, write to 00020 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 */ 00023 00024 #ifndef POLYGONPREVIEW_H 00025 #define POLYGONPREVIEW_H 00026 00027 #include <qframe.h> 00028 #include <qpen.h> 00029 #include <qbrush.h> 00030 00031 class QPainter; 00032 00033 class KPrPolygonPreview : public QFrame 00034 { 00035 Q_OBJECT 00036 00037 public: 00038 KPrPolygonPreview( QWidget* parent, const char*); 00039 ~KPrPolygonPreview() {} 00040 00041 void setPenBrush( const QPen &_pen, const QBrush &_brush ) 00042 { pen = _pen; brush = _brush; repaint( true ); } 00043 00044 public slots: 00045 void slotConvexConcave( bool convexConcave ); 00046 void slotConvexPolygon(); 00047 void slotConcavePolygon(); 00048 void slotCornersValue( int value ); 00049 void slotSharpnessValue( int value ); 00050 00051 protected: 00052 void drawContents( QPainter* ); 00053 00054 int nCorners; 00055 int sharpness; 00056 bool isConcave; 00057 QPen pen; 00058 QBrush brush; 00059 }; 00060 00061 #endif /* POLYGONPREVIEW_H */