libs/flake
KoLineBorder.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 * Copyright (C) 2006-2007 Thomas Zander <zander@kde.org> 00003 * Copyright (C) 2006-2008 Jan Hambrecht <jaham@gmx.net> 00004 * Copyright (C) 2007,2009 Thorsten Zachmann <zachmann@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KOLINEBORDER_H 00023 #define KOLINEBORDER_H 00024 00025 #include "KoInsets.h" 00026 #include "KoShapeBorderModel.h" 00027 00028 #include "flake_export.h" 00029 00030 class KoShape; 00031 class QPainter; 00032 class QColor; 00033 class KoViewConverter; 00034 00038 class FLAKE_EXPORT KoLineBorder : public KoShapeBorderModel 00039 { 00040 public: 00042 KoLineBorder(); 00043 00045 KoLineBorder(const KoLineBorder &other); 00046 00052 explicit KoLineBorder(qreal lineWidth, const QColor &color = Qt::black); 00053 virtual ~KoLineBorder(); 00054 00056 KoLineBorder& operator = (const KoLineBorder &rhs); 00057 00059 void setCapStyle(Qt::PenCapStyle style); 00061 Qt::PenCapStyle capStyle() const; 00063 void setJoinStyle(Qt::PenJoinStyle style); 00065 Qt::PenJoinStyle joinStyle() const; 00067 void setLineWidth(qreal lineWidth); 00069 qreal lineWidth() const; 00071 void setMiterLimit(qreal miterLimit); 00073 qreal miterLimit() const; 00075 void setLineStyle(Qt::PenStyle style, const QVector<qreal> &dashes); 00077 Qt::PenStyle lineStyle() const; 00079 QVector<qreal> lineDashes() const; 00081 void setDashOffset(qreal dashOffset); 00083 qreal dashOffset() const; 00084 00086 const QColor & color() const; 00088 void setColor(const QColor & color); 00089 00091 void setLineBrush(const QBrush & brush); 00093 QBrush lineBrush() const; 00094 00095 virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context); 00096 virtual void borderInsets(const KoShape *shape, KoInsets &insets); 00097 virtual bool hasTransparency(); 00098 virtual void paintBorder(KoShape *shape, QPainter &painter, const KoViewConverter &converter); 00099 virtual void paintBorder(KoShape *shape, QPainter &painter, const KoViewConverter &converter, const QColor & color ); 00100 00101 private: 00102 class Private; 00103 Private * const d; 00104 }; 00105 00106 Q_DECLARE_METATYPE( KoLineBorder ) 00107 00108 #endif
