00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LINESTYLE_H
00021 #define LINESTYLE_H
00022
00023 #include <qgridview.h>
00024 #include <qpen.h>
00025
00026 #include "labelini.h"
00027
00028 class KConfigGroup;
00029
00030
00031 #define QCoord QPoint
00032
00036 class LineStyle : public QGridView {
00037 Q_OBJECT
00038
00039 private:
00040 typedef QValueList<PenStyle> StyleList;
00041
00042 static StyleList styleList;
00043
00044 QPen pen;
00045
00046 int selected;
00047
00048 LabelIni * label;
00049
00050 int index ( QCoord qc );
00051
00052 QCoord coord (int iIndex);
00053
00054 void updateCell ( int iIndex, bool bErase );
00055
00056 void setSelected ( QMouseEvent * e);
00057
00058 protected:
00059 void paintCell ( QPainter * p, int row, int col );
00060
00061 public:
00062 LineStyle ( QWidget * parent,
00063 const char *name,
00064 LabelIni * li );
00065
00066 void setPen ( QPen pen );
00067 QPen& getPen ();
00068 void mousePressEvent ( QMouseEvent * e );
00069 void setSelected (int iIndex);
00070 int getSelected ();
00071 QSize sizeHint () const;
00072 void write ( KConfigGroup * config, QString sKey );
00073 void read (KConfigGroup * config, QString sKey );
00074 void setupPainter (QPainter& painter);
00075
00076 signals:
00077 void selectionChanged(int);
00078 };
00079
00080 #endif