kword

KWTableDia.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef tabledia_h
21#define tabledia_h
22
23#include <kdialogbase.h>
24#include <tqptrlist.h>
25
26#include "defs.h"
27#include <KoBorder.h>
28
29class KWCanvas;
30class KWDocument;
31class KWTableTemplateSelector;
32
33class TQGridLayout;
34class TQLabel;
35class TQListBox;
36class TQWidget;
37class TQCheckBox;
38class TQButtonGroup;
39class TQComboBox;
40class TQSpinBox;
41
42/******************************************************************/
43/* Class: KWTablePreview */
44/******************************************************************/
45
46class KWTablePreview : public TQWidget
47{
48 TQ_OBJECT
49
50
51public:
52 KWTablePreview( TQWidget *_parent, int _rows, int _cols )
53 : TQWidget( _parent ), rows( _rows ), cols( _cols ) {}
54
55 void setRows( int _rows ) { rows = _rows; repaint( true ); }
56 void setCols( int _cols ) { cols = _cols; repaint( true ); }
57
58protected:
59 void paintEvent( TQPaintEvent *e );
60
61 int rows, cols;
62
63};
64
65/******************************************************************/
66/* Class: KWTableDia */
67/******************************************************************/
68
69class KWTableDia : public KDialogBase
70{
71 TQ_OBJECT
72
73
74public:
75 typedef int CellSize; // in fact KWTableFrameSet::CellSize, which is an enum
76 enum UseMode{ NEW, EDIT };
77 KWTableDia( TQWidget *parent, const char *name, UseMode _useMode, KWCanvas *_canvas,
78 KWDocument *_doc, int rows, int cols, CellSize wid, CellSize hei, bool floating,
79 const TQString & _templateName, int format);
80
81protected:
82 void setupTab1( int rows, int cols, CellSize wid, CellSize hei, bool floating );
83 void setupTab2( const TQString &_templateName, int format);
84
85 TQWidget *tab1;
86 TQLabel *lRows, *lCols;
87#ifdef ALLOW_NON_INLINE_TABLES
88 TQLabel *lWid, *lHei;
89 TQComboBox *cHei, *cWid;
90 TQCheckBox *cbIsFloating;
91#endif
92 TQSpinBox *nRows, *nCols;
93 KWTablePreview *preview;
94 TQCheckBox *cbReapplyTemplate1, *cbReapplyTemplate2;
95
96 TQGridLayout *grid;
97 KWTableTemplateSelector *tableTemplateSelector;
98
99 UseMode m_useMode;
100 KWCanvas *canvas;
101 KWDocument *doc;
102
103 int oldRowCount, oldColCount;
104 TQString oldTemplateName;
105protected slots:
106 void rowsChanged( int );
107 void colsChanged( int );
108 void slotSetReapply( bool );
109 virtual void slotOk();
110 void slotInlineTable( bool );
111};
112
113#endif
114
115
Class: KWCanvas This class is responsible for the rendering of the frames to the screen as well as th...
Definition KWCanvas.h:61