kword

KWTableDia.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
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 /* Class: KWTablePreview                                          */
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 /* Class: KWTableDia                                              */
00066 /******************************************************************/
00067 
00068 class KWTableDia : public KDialogBase
00069 {
00070     Q_OBJECT
00071 
00072 public:
00073     typedef int CellSize; // in fact KWTableFrameSet::CellSize, which is an enum
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 
KDE Home | KDE Accessibility Home | Description of Access Keys