koborder.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KoBorder_h
00021 #define KoBorder_h
00022
00023 #include <qcolor.h>
00024 #include <qpen.h>
00025 class QDomElement;
00026 class KoZoomHandler;
00027 class QPainter;
00028
00032 class KoBorder : public Qt
00033 {
00034 public:
00035
00036 enum BorderStyle {SOLID = 0, DASH = 1, DOT = 2, DASH_DOT = 3, DASH_DOT_DOT = 4, DOUBLE_LINE = 5};
00037
00038 KoBorder();
00039 KoBorder( const QColor & c, BorderStyle s, double width );
00040 QColor color;
00041 void setPenWidth(double _w);
00042 void setStyle(BorderStyle _style);
00043 BorderStyle getStyle() const {return style;}
00044 double penWidth() const{ return ptPenWidth;}
00045 double width() const { return ptWidth; }
00046
00047 bool operator==( const KoBorder _brd ) const;
00048 bool operator!=( const KoBorder _brd ) const;
00049
00050
00051 static KoBorder loadBorder( const QDomElement & elem );
00052
00053 void save( QDomElement & elem ) const;
00054
00055
00056 static BorderStyle getStyle( const QString &style );
00057 static QString getStyle( const BorderStyle &style );
00058
00059
00060 static int zoomWidthX( double ptWidth, KoZoomHandler * zoomHandler, int minborder );
00061 static int zoomWidthY( double ptWidth, KoZoomHandler * zoomHandler, int minborder );
00062
00063
00064
00065 static QPen borderPen( const KoBorder & brd, int width, QColor defaultColor );
00066
00067
00068
00069
00070 static void drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, QRect rect,
00071 KoBorder left, KoBorder right, KoBorder top, KoBorder bottom,
00072 int minborder, QPen defaultPen );
00073 private:
00074 double ptWidth;
00075 double ptPenWidth;
00076 BorderStyle style;
00077 };
00078
00079 #endif
This file is part of the documentation for lib Library Version 1.3.5.