24#include <kdialogbase.h>
25#include <tqstringlist.h>
27#include <tqstylesheet.h>
30#include <KoUnitWidgets.h>
32#include <tqlineedit.h>
33#include "KoParagLayout.h"
34#include "KoParagCounter.h"
36#include <tqgroupbox.h>
37#include <tqvgroupbox.h>
38#include <koffice_export.h>
65class KoParagDecorationTab;
79 : TQWidget( parent, name ), m_flag( flag )
99 int flag() const { return m_flag; }
119 virtual TQString tabName();
121 double leftIndent() const;
122 double rightIndent() const;
123 double firstLineIndent() const;
124 double spaceBeforeParag() const;
125 double spaceAfterParag() const;
126 double lineSpacing() const;
129 void leftChanged( double );
130 void rightChanged( double );
131 void firstChanged( double );
132 void spacingActivated( int );
133 void spacingChanged( double );
134 void spacingChanged( int );
135 void beforeChanged( double );
136 void afterChanged( double );
140 TQWidgetStack *sSpacingStack;
144 TQComboBox *cSpacing;
163 virtual TQString tabName();
165 int pageBreaking() const;
178 TQRadioButton *rLeft, *rCenter, *rRight, *rJustify;
179 TQCheckBox *cKeepLinesTogether, *cHardBreakBefore, *cHardBreakAfter;
180 KPagePreview2 *prev2;
197 virtual TQString tabName();
200 KoBorder leftBorder() const { return m_leftBorder; }
201 KoBorder rightBorder() const { return m_rightBorder; }
202 KoBorder topBorder() const { return m_topBorder; }
203 KoBorder bottomBorder() const { return m_bottomBorder; }
204 bool joinBorder() const { return m_joinBorder; }
207 TQColor backgroundColor() const;
210 void brdLeftToggled( bool );
211 void brdRightToggled( bool );
212 void brdTopToggled( bool );
213 void brdBottomToggled( bool );
214 void brdJoinToggled( bool );
215 void slotPressEvent(TQMouseEvent *_ev);
218 void updateBorders();
222 KoBorderPreview *wPreview;
224 KoParagDecorationTab *wDeco;
226 KoBorder::BorderStyle curBorderStyle() const;
228 unsigned int curBorderWidth() const;
230 TQColor curBorderColor() const;
233 KoBorder m_leftBorder, m_rightBorder, m_topBorder, m_bottomBorder;
252 void clickedBorderPreview( KoBorder& border, KoBorder::BorderType position,
256 void updateBorder( KoBorder& border );
258 bool borderChanged( const KoBorder& border );
263class KOTEXT_EXPORT KoCounterStyleWidget : public TQWidget
268 KoCounterStyleWidget( bool displayDepth= true, bool onlyStyleTypeLetter = false, bool disableAll= false, TQWidget* parent = 0, const char* name = 0 );
270 class StyleRepresenter {
272 StyleRepresenter ( const TQString name, KoParagCounter::Style style, bool bullet= false) {
277 TQString name() const { return m_name; }
278 KoParagCounter::Style style() const { return m_style; }
279 bool isBullet() const { return m_bullet; }
283 KoParagCounter::Style m_style;
287 static void makeCounterRepresenterList( TQPtrList<StyleRepresenter>& stylesList , bool onlyStyleTypeLetter = false );
288 void fillStyleCombo(KoParagCounter::Numbering type = KoParagCounter::NUM_LIST);
290 void changeKWSpinboxType(KoParagCounter::Style st);
295 void numTypeChanged( int nType );
298 void sig_startChanged( int );
299 void sig_restartChanged( bool);
300 void sig_depthChanged( int);
301 void sig_displayLevelsChanged( int);
302 void sig_suffixChanged( const TQString &);
303 void sig_prefixChanged( const TQString &);
304 void sig_numTypeChanged( int );
305 void sig_alignmentChanged( int );
306 void changeCustomBullet( const TQString & , TQChar );
307 void changeStyle( KoParagCounter::Style );
309 void startChanged( int i) {m_counter.setStartNumber(i);emit sig_startChanged(i);}
310 void restartChanged( bool b) {m_counter.setRestartCounter(b);emit sig_restartChanged(b);}
311 void depthChanged( int i) {m_counter.setDepth(i);emit sig_depthChanged(i);}
312 void displayLevelsChanged( int i) {m_counter.setDisplayLevels(i);emit sig_displayLevelsChanged(i);}
313 void alignmentChanged( const TQString& s);
314 void suffixChanged( const TQString & txt) {m_counter.setSuffix(txt);emit sig_suffixChanged(txt); }
315 void prefixChanged( const TQString & txt) {m_counter.setPrefix(txt);emit sig_prefixChanged(txt); }
317 void numStyleChanged();
318 void selectCustomBullet();
321 void displayStyle( KoParagCounter::Style style );
325 TQPtrList <StyleRepresenter> stylesList;
328 TQLineEdit *sSuffix, *sPrefix;
329 TQPushButton *bCustom;
332 TQSpinBox *spnDisplayLevels;
335 TQCheckBox *cbRestart;
338 unsigned int styleBuffer;
357 virtual TQString tabName();
364 void numTypeChanged( int );
366 void suffixChanged( const TQString & txt) {m_counter.setSuffix(txt); updatePreview(); }
367 void prefixChanged( const TQString & txt) {m_counter.setPrefix(txt); updatePreview();}
368 void startChanged( int i) {m_counter.setStartNumber(i); updatePreview();}
369 void restartChanged( bool b) {m_counter.setRestartCounter(b); }
370 void depthChanged( int i) {m_counter.setDepth(i); updatePreview();}
371 void displayLevelsChanged( int i) {m_counter.setDisplayLevels(i); updatePreview();}
372 void alignmentChanged( int i) {m_counter.setAlignment(i); updatePreview();}
373 void slotChangeCustomBullet( const TQString & f, TQChar c);
374 void styleChanged (KoParagCounter::Style st );
377 void updatePreview();
379 TQButtonGroup *gNumbering;
382 KoCounterStyleWidget *m_styleWidget;
383 unsigned int styleBuffer;
395 KoTabulatorsLineEdit( TQWidget *parent, double lower, double upper, double step, double value = 0.0,
399 virtual void keyPressEvent ( TQKeyEvent * );
401 void keyReturnPressed();
417 virtual TQString tabName();
419 KoTabulatorList tabList() const { return m_tabList; }
421 void setCurrentTab( double tabPos );
424 void slotTabValueChanged( double );
425 void slotAlignCharChanged( const TQString &_text );
427 void deleteClicked();
428 void deleteAllClicked();
429 void setActiveItem( int selected);
430 void updateAlign( int selected);
431 void updateFilling( int selected);
439 TQVBoxLayout* editLayout;
442 TQGroupBox* gPosition;
443 KoTabulatorsLineEdit* sTabPos;
444 TQButtonGroup* bgAlign;
445 TQRadioButton* rAlignLeft;
446 TQRadioButton* rAlignCentre;
447 TQRadioButton* rAlignRight;
448 TQRadioButton* rAlignVar;
449 TQLineEdit* sAlignChar;
450 TQGroupBox* gTabLeader;
451 TQComboBox* cFilling;
454 TQPushButton* bDelete;
455 TQPushButton* bDeleteAll;
457 KoTabulatorList m_tabList;
474 KoStylePreview( const TQString &title, const TQString &text, TQWidget *parent, const char* name = 0 );
485 void drawContents( TQPainter *painter );
487 KoTextDocument *m_textdoc;
504 enum { PD_SPACING = 1, PD_ALIGN = 2, PD_DECORATION = 4, PD_NUMBERING = 8,
510 KoParagDia( TQWidget*, const char*, int flags, KoUnit::Unit unit, double _frameWidth=-1, bool breakLine= true, bool disableAll = false);
517 void setCurrentPage( int page );
523 double leftIndent() const { return m_indentSpacingWidget->leftIndent(); }
524 double rightIndent() const { return m_indentSpacingWidget->rightIndent(); }
525 double firstLineIndent() const { return m_indentSpacingWidget->firstLineIndent(); }
526 double spaceBeforeParag() const { return m_indentSpacingWidget->spaceBeforeParag(); }
527 double spaceAfterParag() const { return m_indentSpacingWidget->spaceAfterParag(); }
528 double lineSpacing() const { return m_indentSpacingWidget->lineSpacing(); }
532 int align() const { return m_alignWidget->align(); }
533 int pageBreaking() const { return m_alignWidget->pageBreaking(); }
536 KoBorder leftBorder() const { return m_decorationsWidget->leftBorder(); }
537 KoBorder rightBorder() const { return m_decorationsWidget->rightBorder(); }
538 KoBorder topBorder() const { return m_decorationsWidget->topBorder(); }
539 KoBorder bottomBorder() const { return m_decorationsWidget->bottomBorder(); }
540 bool joinBorder() const { return m_decorationsWidget->joinBorder(); }
543 const KoParagCounter & counter() const { return m_counterWidget->counter(); }
546 KoTabulatorList tabListTabulator() const { return m_tabulatorsWidget->tabList(); }
549 TQColor backgroundColor() const { return m_decorationsWidget->backgroundColor(); }
552 bool isAlignChanged() const { return oldLayout.alignment!=align();}
553 bool isLineSpacingChanged() const {
554 return (oldLayout.lineSpacingValue() !=lineSpacing() ||
555 oldLayout.lineSpacingType != lineSpacingType());
557 bool isLeftMarginChanged() const {
558 return oldLayout.margins[TQStyleSheetItem::MarginLeft]!=leftIndent();
560 bool isRightMarginChanged() const {
561 return oldLayout.margins[TQStyleSheetItem::MarginRight]!=rightIndent();
563 bool isFirstLineChanged() const {
564 return oldLayout.margins[ TQStyleSheetItem::MarginFirstLine]!=firstLineIndent();
566 bool isSpaceBeforeChanged() const {
567 return oldLayout.margins[TQStyleSheetItem::MarginTop]!=spaceBeforeParag();
569 bool isSpaceAfterChanged() const {
570 return oldLayout.margins[TQStyleSheetItem::MarginBottom]!=spaceAfterParag();
572 bool isPageBreakingChanged() const {
573 return oldLayout.pageBreaking!=pageBreaking();
575 bool isCounterChanged() const;
576 bool isBorderChanged() const {
577 return (oldLayout.leftBorder!=leftBorder() ||
578 oldLayout.rightBorder!=rightBorder() ||
579 oldLayout.topBorder!=topBorder() ||
580 oldLayout.bottomBorder!=bottomBorder() );
582 bool isJoinBorderChanged() const { return oldLayout.joinBorder!=joinBorder(); }
583 bool listTabulatorChanged() const { return oldLayout.tabList()!=tabListTabulator();}
584 bool isBackgroundColorChanged() const { return oldLayout.backgroundColor != backgroundColor(); }
588 int changedFlags() const;
592 virtual void slotOk();
593 virtual void slotApply();
595 void applyParagStyle();
This class represents a border - for anything, like paragraph, or frame.
This is the structure associated with a paragraph (KoTextParag), to define the bullet or numbering of...
The complete(*) dialog for changing attributes of a paragraph.
int getFlags() const Flags passed to constructor.
This class holds the paragraph-specific formatting information It's separated from KoTextParag so tha...
SpacingType Line spacing values Assuming h is the height of the biggest char in the line, and v is the linespacin...
A paragraph style is a combination of a character style and paragraph-layout attributes,...
void setCounter(const KoParagCounter &counter) Set the given counter to the preview.
void setStyle(KoParagStyle *style) Apply the given style to the preview.
This class extends KoZoomHandler to add support for WYSIWYG text layouting.
Spin box for double precision numbers with unit display.
Unit Length units supported by KOffice.
const char * name(StdAction id)
Struct: KoTabulator Defines the position of a tabulation (in pt), and its type.
|