kword
KWTableDia.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef tabledia_h
00021 #define tabledia_h
00022
00023 #include <kdialogbase.h>
00024 #include <qptrlist.h>
00025
00026 #include "defs.h"
00027 #include <KoBorder.h>
00028
00029 class KWCanvas;
00030 class KWDocument;
00031 class KWTableTemplateSelector;
00032
00033 class QGridLayout;
00034 class QLabel;
00035 class QListBox;
00036 class QWidget;
00037 class QCheckBox;
00038 class QButtonGroup;
00039 class QComboBox;
00040 class QSpinBox;
00041
00042
00043
00044
00045
00046 class KWTablePreview : public QWidget
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 KWTablePreview( QWidget *_parent, int _rows, int _cols )
00052 : QWidget( _parent ), rows( _rows ), cols( _cols ) {}
00053
00054 void setRows( int _rows ) { rows = _rows; repaint( true ); }
00055 void setCols( int _cols ) { cols = _cols; repaint( true ); }
00056
00057 protected:
00058 void paintEvent( QPaintEvent *e );
00059
00060 int rows, cols;
00061
00062 };
00063
00064
00065
00066
00067
00068 class KWTableDia : public KDialogBase
00069 {
00070 Q_OBJECT
00071
00072 public:
00073 typedef int CellSize;
00074 enum UseMode{ NEW, EDIT };
00075 KWTableDia( QWidget *parent, const char *name, UseMode _useMode, KWCanvas *_canvas,
00076 KWDocument *_doc, int rows, int cols, CellSize wid, CellSize hei, bool floating,
00077 const QString & _templateName, int format);
00078
00079 protected:
00080 void setupTab1( int rows, int cols, CellSize wid, CellSize hei, bool floating );
00081 void setupTab2( const QString &_templateName, int format);
00082
00083 QWidget *tab1;
00084 QLabel *lRows, *lCols;
00085 #ifdef ALLOW_NON_INLINE_TABLES
00086 QLabel *lWid, *lHei;
00087 QComboBox *cHei, *cWid;
00088 QCheckBox *cbIsFloating;
00089 #endif
00090 QSpinBox *nRows, *nCols;
00091 KWTablePreview *preview;
00092 QCheckBox *cbReapplyTemplate1, *cbReapplyTemplate2;
00093
00094 QGridLayout *grid;
00095 KWTableTemplateSelector *tableTemplateSelector;
00096
00097 UseMode m_useMode;
00098 KWCanvas *canvas;
00099 KWDocument *doc;
00100
00101 int oldRowCount, oldColCount;
00102 QString oldTemplateName;
00103 protected slots:
00104 void rowsChanged( int );
00105 void colsChanged( int );
00106 void slotSetReapply( bool );
00107 virtual void slotOk();
00108 void slotInlineTable( bool );
00109 };
00110
00111 #endif
00112
00113
|