30#ifndef __kspread_dlg_layout_h__
31#define __kspread_dlg_layout_h__
34#include <tqtabdialog.h>
35#include <tqapplication.h>
36#include <tqbuttongroup.h>
37#include <tqgroupbox.h>
39#include <kcompletion.h>
40#include "kspread_view.h"
41#include "kspread_format.h"
42#include "kspread_doc.h"
43#include "kspread_value.h"
44#include "position_cell_format.h"
45#include "font_cell_format.h"
46#include "protection_cell_format.h"
48#include <tqpushbutton.h>
49#include <tqcheckbox.h>
51class KoUnitDoubleSpinBox;
66class KoUnitDoubleSpinBox;
83 BorderType_Horizontal,
84 BorderType_FallingDiagonal,
85 BorderType_RisingDiagonal,
89enum BorderShortcutType
91 BorderShortcutType_Remove = 0,
92 BorderShortcutType_All,
93 BorderShortcutType_Outline,
94 BorderShortcutType_END
97class PatternSelect :
public TQFrame
102 PatternSelect( TQWidget *parent,
const char *_name );
104 void setPenStyle( TQt::PenStyle _pat ) { penStyle = _pat; repaint(); }
105 TQt::PenStyle getPenStyle() {
return penStyle; }
106 void setColor(
const TQColor &_col ) { penColor = _col; repaint(); }
107 const TQColor& getColor() {
return penColor; }
108 void setPenWidth(
int _w ) { penWidth = _w; repaint(); }
109 int getPenWidth() {
return penWidth; }
111 void setPattern(
const TQColor &_color,
int _width, TQt::PenStyle _style );
113 void setDefined() { undefined =
false; repaint(); }
115 bool isDefined() {
return !undefined; }
118 void clicked( PatternSelect *_this );
125 virtual void paintEvent( TQPaintEvent *_ev );
126 virtual void mousePressEvent( TQMouseEvent *_ev );
128 TQt::PenStyle penStyle;
136class GeneralTab :
public TQWidget
142 GeneralTab( TQWidget * parent, CellFormatDialog * _dlg );
145 bool apply( CustomStyle * style );
148 void slotNewParent(
const TQString & parentName );
149 void slotNameChanged();
152 CellFormatDialog * m_dlg;
153 KComboBox * m_parentBox;
154 KLineEdit * m_nameEdit;
159 bool checkParent(
const TQString & parentName );
165class CellFormatPageFont :
public FontTab
170 CellFormatPageFont( TQWidget* parent, CellFormatDialog *_dlg );
172 void apply( CustomStyle * style );
173 void apply( FormatManipulator *_obj );
180 void fontSelected(
const TQFont &font );
184 void family_chosen_slot(
const TQString & );
185 void size_chosen_slot(
const TQString & );
186 void weight_chosen_slot(
const TQString &);
187 void style_chosen_slot(
const TQString &);
188 void underline_chosen_slot();
189 void strike_chosen_slot();
190 void display_example(
const TQFont &font);
191 void slotSetTextColor(
const TQColor &_color );
199 bool bTextColorUndefined;
200 CellFormatDialog *dlg;
208class CellFormatPageFloat :
public TQWidget
218 void slotChangeState();
220 void updateFormatType();
222 void slotChangeValue(
int);
223 void formatChanged(
int);
224 void currencyChanged(
const TQString &);
227 KIntNumInput* precision;
230 TQComboBox *currency;
231 TQLabel *currencyLabel;
232 TQRadioButton *
generic;
233 TQRadioButton *number;
234 TQRadioButton *percent;
236 TQRadioButton *money;
237 TQRadioButton *scientific;
238 TQRadioButton *fraction;
240 TQRadioButton *textFormat;
241 TQRadioButton *customFormat;
242 TQListBox *listFormat;
243 TQLineEdit* customFormatEdit;
244 TQLabel *exampleLabel;
246 FormatType cellFormatType, newFormatType;
248 bool m_bFormatTypeChanged;
249 bool m_bFormatColorChanged;
252class CellFormatPagePosition :
public PositionTab
262 double getSizeHeight()
const;
263 double getSizeWidth()
const;
264 bool getMergedCellState()
const;
267 void slotChangeHeightState();
268 void slotChangeWidthState();
269 void slotChangeAngle(
int);
270 void slotStateChanged(
int);
271 void slotChangeVerticalState();
272 void slotChangeMultiState();
275 KoUnitDoubleSpinBox *width;
276 KoUnitDoubleSpinBox *height;
277 KoUnitDoubleSpinBox *m_indent;
284class Border :
public TQFrame
289 Border( TQWidget *parent,
const char *_name,
bool _oneCol,
bool _oneRow );
292 void choosearea(TQMouseEvent * _ev);
294 virtual void paintEvent( TQPaintEvent *_ev );
295 virtual void mousePressEvent( TQMouseEvent* _ev );
300class BorderButton :
public TQPushButton
305 BorderButton( TQWidget *parent,
const char *_name );
306 void setPenStyle( TQt::PenStyle _pat ) { penStyle = _pat;}
307 TQt::PenStyle getPenStyle() {
return penStyle; }
308 void setColor(
const TQColor &_col ) { penColor = _col; }
309 const TQColor& getColor() {
return penColor; }
310 void setPenWidth(
int _w ) { penWidth = _w; }
311 int getPenWidth() {
return penWidth; }
312 bool isChanged() {
return changed; }
313 void setChanged(
bool _changed ) { changed=_changed;}
317 void clicked(BorderButton *);
319 virtual void mousePressEvent( TQMouseEvent *_ev );
320 TQt::PenStyle penStyle;
327class CellFormatPageBorder :
public TQWidget
335 void invertState(BorderButton *_button);
336 TQPixmap paintFormatPixmap(PenStyle _style);
339 void changeState(BorderButton *_this);
340 void preselect( BorderButton *_this);
342 void slotSetColorButton(
const TQColor &_color );
343 void slotUnselect2( PatternSelect *_select );
344 void loadIcon( TQString pix,BorderButton *_button);
345 void slotPressEvent(TQMouseEvent *_ev);
346 void slotChangeStyle(
int );
347 void slotChangeStyle(
const TQString & );
348 void cutomize_chosen_slot();
353 BorderButton* borderButtons[BorderType_END];
354 BorderButton* shortcutButtons[BorderShortcutType_END];
355#define NUM_BORDER_PATTERNS 10
358 PatternSelect* pattern[NUM_BORDER_PATTERNS];
361 PatternSelect* preview;
365 TQCheckBox* customize;
366 TQColor currentColor;
372 void InitializeGrids();
373 void InitializeBorderButtons();
374 void InitializePatterns();
375 void SetConnections();
385class BrushSelect :
public TQFrame
390 BrushSelect( TQWidget *parent,
const char *_name );
392 void setBrushStyle( TQt::BrushStyle _pat ) { brushStyle = _pat; repaint(); }
393 TQt::BrushStyle getBrushStyle()
const {
return brushStyle; }
394 TQColor getBrushColor()
const {
return brushColor; }
395 void setBrushColor(
const TQColor &_c) { brushColor=_c;}
396 void setPattern(
const TQColor &_color, TQt::BrushStyle _style );
399 void clicked( BrushSelect *_this );
406 virtual void paintEvent( TQPaintEvent *_ev );
407 virtual void mousePressEvent( TQMouseEvent *_ev );
409 TQt::BrushStyle brushStyle;
415class CellFormatPagePattern :
public TQWidget
427 void slotUnselect2( BrushSelect *_select );
428 void slotSetColorButton(
const TQColor &_color );
429 void slotSetBackgroundColor(
const TQColor &_color );
430 void slotNotAnyColor( );
432 BrushSelect *selectedBrush;
442 BrushSelect *brush10;
443 BrushSelect *brush11;
444 BrushSelect *brush12;
445 BrushSelect *brush13;
446 BrushSelect *brush14;
447 BrushSelect *brush15;
448 BrushSelect *current;
450 TQPushButton* notAnyColor;
451 TQColor currentColor;
454 bool bBgColorUndefined;
455 KColorButton *bgColorButton;
460class CellFormatPageProtection :
public ProtectionTab
467 ~CellFormatPageProtection();
501 void initParameters(Format *_obj,
int column,
int row);
502 void checkBorderRight(Format *obj,
int x,
int y);
503 void checkBorderLeft(Format *obj,
int x,
int y);
504 void checkBorderTop(Format *obj,
int x,
int y);
505 void checkBorderBottom(Format *obj,
int x,
int y);
506 void checkBorderVertical(Format *obj,
int x,
int y);
507 void checkBorderHorizontal(Format *obj,
int x,
int y);
513 Doc * getDoc()
const {
return m_doc; }
514 Sheet * getSheet()
const {
return m_sheet; }
516 StyleManager * getStyleManager()
const {
return m_styleManager; }
518 bool isSingleCell() {
return ( left == right && top == bottom ); }
519 bool checkCircle( TQString
const & name, TQString
const & parent );
521 TDELocale * locale()
const {
return m_pView->doc()->locale(); }
524 struct CellBorderFormat
534 CellBorderFormat borders[BorderType_END];
536 TQt::BrushStyle brushStyle;
545 Format::FloatFormat floatFormat;
547 Format::FloatColor floatColor;
548 Format::Currency cCurrency;
555 bool bTextFontItalic;
559 bool bTextFontFamily;
560 TQString textFontFamily;
569 Format::Align alignX;
570 Format::AlignY alignY;
572 TQString styleParent;
582 double defaultHeightSize;
583 double defaultWidthSize;
589 TQPixmap* formatOnlyNegSignedPixmap;
590 TQPixmap* formatRedOnlyNegSignedPixmap;
591 TQPixmap* formatRedNeverSignedPixmap;
592 TQPixmap* formatAlwaysSignedPixmap;
593 TQPixmap* formatRedAlwaysSignedPixmap;
598 FormatType formatType;
607 bool isColumnSelected;
626 const char *_string2,
const TQColor & _color2 );
628 GeneralTab * generalPage;
630 CellFormatPageBorder *borderPage;
631 CellFormatPageFont *fontPage;
632 CellFormatPagePosition *positionPage;
633 CellFormatPagePattern *patternPage;
634 CellFormatPageProtection *protectPage;
641 StyleManager * m_styleManager;
Built-in or custom style defined in StyleManager dialog.
This class holds the data that makes up a spreadsheet.
Provides a wrapper for cell value.
The View class displays a KSpread document.