00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SCHEDITHEADER_H
00022 #define SCHEDITHEADER_H
00023
00024 #include <qcanvas.h>
00025 #include <qrect.h>
00026 #include <qpointarray.h>
00027 #include <qfileinfo.h>
00028
00029 #include "scheditline.h"
00030 #include "scheditdocbox.h"
00031 #include "scheditpagedef.h"
00032
00033 #define TitleTextPageSizeIndex 4
00034
00035 class ScheditPageDef;
00036 class ScheditTitleBlock;
00037 class ColourValuePref;
00038
00042 class ScheditHeader : public QCanvasItem {
00043 private:
00044 typedef struct _pagedef {
00045 QSize page;
00046 int hDiv;
00047 char vDiv;
00048
00049 QSize getSize ( void );
00050 QRect getRect ( void );
00051 int getHdiv ( void );
00052 int getVdiv ( void );
00053 } PageDef;
00054
00055 #pragma pack (push,1)
00056 typedef struct {
00057 char ucType;
00058 char cPageEnum;
00059 char aucQue2 [2];
00060 char ascilTag [12];
00061 } hdr;
00062 #pragma pack (pop)
00063
00064 hdr header;
00065 QPointArray paHor;
00066 QPointArray paVer;
00067 QPointArray paHorText;
00068 QPointArray paVerText;
00069 QRect rectInner;
00070
00071 QRect rectPage;
00072 ScheditPageDef * pSpd;
00073
00074 static ScheditLinePrefs * lpBackground;
00075 static ColourValuePref * lpLine;
00076 static ScheditFontPrefs * lpText;
00077
00078 QSize setupPage ( int iIndex );
00079 ScheditTitleBlock * pTitleBlock;
00080
00081 static LabelIni * laVisible;
00082 static QCheckBox * cbShowBorders;
00083
00084 public:
00085 ScheditHeader( QCanvas * canvas,
00086 unsigned char * & puc );
00087
00088 ~ScheditHeader();
00089
00090 bool collidesWith ( const QCanvasItem * other ) const;
00091
00092 bool collidesWith( const QCanvasSprite* cs,
00093 const QCanvasPolygonalItem* pi,
00094 const QCanvasRectangle* cr,
00095 const QCanvasEllipse* ce,
00096 const QCanvasText* ct) const;
00097 QRect boundingRect ( void ) const;
00098 void draw ( QPainter& painter );
00099 virtual int rtti () const;
00100
00101 QRect getRect (bool& bDraw);
00102 QSize getSize ( void );
00103 QColor BackgroundColour;
00104 QSize setPageFromEnum ( ScheditPageDef::ePageSize ps );
00105 void setFileData ( QFileInfo qfi );
00106 void setPage (void);
00107
00108 static QSize getSize ( ScheditPageDef::ePageSize ps );
00109
00110 static void setup ( KDialogBase * dlg );
00111
00112 static void readProperties ( KConfig * config );
00113
00114 static void writeProperties ( KConfig * config );
00115 };
00116
00117 #endif