diff options
Diffstat (limited to 'lib/kotext/KoParagDia.h')
-rw-r--r-- | lib/kotext/KoParagDia.h | 212 |
1 files changed, 111 insertions, 101 deletions
diff --git a/lib/kotext/KoParagDia.h b/lib/kotext/KoParagDia.h index 32e75c26..1c776af6 100644 --- a/lib/kotext/KoParagDia.h +++ b/lib/kotext/KoParagDia.h @@ -22,19 +22,19 @@ #define paragdia_h #include <kdialogbase.h> -#include <qstringlist.h> -#include <qptrlist.h> -#include <qstylesheet.h> +#include <tqstringlist.h> +#include <tqptrlist.h> +#include <tqstylesheet.h> #include <KoRuler.h> #include <KoUnit.h> #include <KoUnitWidgets.h> -#include <qdict.h> -#include <qlineedit.h> +#include <tqdict.h> +#include <tqlineedit.h> #include "KoParagLayout.h" #include "KoParagCounter.h" #include <knuminput.h> -#include <qgroupbox.h> -#include <qvgroupbox.h> +#include <tqgroupbox.h> +#include <tqvgroupbox.h> #include <koffice_export.h> class KoTextZoomHandler; class KButtonBox; @@ -46,21 +46,21 @@ class KoStylePreview; class KPagePreview2; class KPagePreview; class KoSpinBox; -class QButtonGroup; -class QCheckBox; -class QComboBox; -class QGridLayout; -class QGroupBox; -class QLabel; -class QListBox; -class QPushButton; -class QRadioButton; -class QWidget; -class QWidgetStack; +class TQButtonGroup; +class TQCheckBox; +class TQComboBox; +class TQGridLayout; +class TQGroupBox; +class TQLabel; +class TQListBox; +class TQPushButton; +class TQRadioButton; +class TQWidget; +class TQWidgetStack; class KIntNumInput; class KDoubleNumInput; class KComboBox; -class QVBoxLayout; +class TQVBoxLayout; class KoUnitDoubleSpinBox; class KoParagDecorationTab; // From KoParagDecorationTab.ui @@ -69,13 +69,14 @@ class KoParagDecorationTab; // From KoParagDecorationTab.ui * that handles modifying a part of a KoParagLayout. * Used by the paragraph dialog (this file) and by the style editor. */ -class KOTEXT_EXPORT KoParagLayoutWidget : public QWidget +class KOTEXT_EXPORT KoParagLayoutWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - // Constructor: parent widget, flag (PD_SOMETHING) and name - KoParagLayoutWidget( int flag, QWidget * parent, const char * name = 0 ) - : QWidget( parent, name ), m_flag( flag ) + // Constructor: tqparent widget, flag (PD_SOMETHING) and name + KoParagLayoutWidget( int flag, TQWidget * tqparent, const char * name = 0 ) + : TQWidget( tqparent, name ), m_flag( flag ) { } virtual ~KoParagLayoutWidget() {} @@ -92,9 +93,9 @@ public: //virtual bool isModified() = 0; /** return the (i18n-ed) name of the tab */ - virtual QString tabName() = 0; + virtual TQString tabName() = 0; - // Return the part of the paraglayout that this widget cares about + // Return the part of the paragtqlayout that this widget cares about int flag() const { return m_flag; } private: @@ -107,14 +108,15 @@ private: class KOTEXT_EXPORT KoIndentSpacingWidget : public KoParagLayoutWidget { Q_OBJECT + TQ_OBJECT public: - KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth, QWidget * parent,const char * name = 0 ); + KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth, TQWidget * tqparent,const char * name = 0 ); virtual ~KoIndentSpacingWidget() {} virtual void display( const KoParagLayout & lay ); virtual void save( KoParagLayout & lay ); //virtual bool isModified(); - virtual QString tabName(); + virtual TQString tabName(); double leftIndent() const; double rightIndent() const; @@ -135,29 +137,30 @@ private slots: private: void updateLineSpacing( KoParagLayout::SpacingType _type ); - QWidgetStack *sSpacingStack; + TQWidgetStack *sSpacingStack; KIntNumInput *eSpacingPercent; KoUnitDoubleSpinBox *eBefore, *eAfter, *eSpacing; KoUnitDoubleSpinBox *eLeft, *eRight, *eFirstLine; - QComboBox *cSpacing; + TQComboBox *cSpacing; KPagePreview *prev1; KoUnit::Unit m_unit; }; /** - * The widget for editing paragraph alignment (tab 2) + * The widget for editing paragraph tqalignment (tab 2) */ class KOTEXT_EXPORT KoParagAlignWidget : public KoParagLayoutWidget { Q_OBJECT + TQ_OBJECT public: - KoParagAlignWidget(bool breakLine, QWidget * parent, const char * name = 0 ); + KoParagAlignWidget(bool breakLine, TQWidget * tqparent, const char * name = 0 ); virtual ~KoParagAlignWidget() {} virtual void display( const KoParagLayout & lay ); virtual void save( KoParagLayout & lay ); //virtual bool isModified(); - virtual QString tabName(); + virtual TQString tabName(); int pageBreaking() const; int align() const; @@ -172,8 +175,8 @@ protected: void clearAligns(); private: - QRadioButton *rLeft, *rCenter, *rRight, *rJustify; - QCheckBox *cKeepLinesTogether, *cHardBreakBefore, *cHardBreakAfter; + TQRadioButton *rLeft, *rCenter, *rRight, *rJustify; + TQCheckBox *cKeepLinesTogether, *cHardBreakBefore, *cHardBreakAfter; KPagePreview2 *prev2; }; @@ -183,14 +186,15 @@ private: class KOTEXT_EXPORT KoParagDecorationWidget : public KoParagLayoutWidget { Q_OBJECT + TQ_OBJECT public: - KoParagDecorationWidget( QWidget * parent, const char * name = 0 ); + KoParagDecorationWidget( TQWidget * tqparent, const char * name = 0 ); virtual ~KoParagDecorationWidget() {} virtual void display( const KoParagLayout & lay ); virtual void save( KoParagLayout & lay ); //virtual bool isModified(); - virtual QString tabName(); + virtual TQString tabName(); // Borders KoBorder leftBorder() const { return m_leftBorder; } @@ -200,7 +204,7 @@ public: bool joinBorder() const { return m_joinBorder; } // Background color - QColor backgroundColor() const; + TQColor backgroundColor() const; protected slots: void brdLeftToggled( bool ); @@ -208,7 +212,7 @@ protected slots: void brdTopToggled( bool ); void brdBottomToggled( bool ); void brdJoinToggled( bool ); - void slotPressEvent(QMouseEvent *_ev); + void slotPressEvent(TQMouseEvent *_ev); protected: void updateBorders(); @@ -223,7 +227,7 @@ private: //! Get the currently selected border width unsigned int curBorderWidth() const; //! Get the currently selected border color - QColor curBorderColor() const; + TQColor curBorderColor() const; // Borders KoBorder m_leftBorder, m_rightBorder, m_topBorder, m_bottomBorder; @@ -256,30 +260,31 @@ private: }; -class KOTEXT_EXPORT KoCounterStyleWidget : public QWidget +class KOTEXT_EXPORT KoCounterStyleWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KoCounterStyleWidget( bool displayDepth= true, bool onlyStyleTypeLetter = false, bool disableAll=false, QWidget* parent = 0, const char* name = 0 ); + KoCounterStyleWidget( bool displayDepth= true, bool onlyStyleTypeLetter = false, bool disableAll=false, TQWidget* tqparent = 0, const char* name = 0 ); class StyleRepresenter { public: - StyleRepresenter (const QString name, KoParagCounter::Style style, bool bullet=false) { + StyleRepresenter (const TQString name, KoParagCounter::Style style, bool bullet=false) { m_name=name; m_style=style; m_bullet=bullet; } - QString name() const { return m_name; } + TQString name() const { return m_name; } KoParagCounter::Style style() const { return m_style; } bool isBullet() const { return m_bullet; } private: - QString m_name; + TQString m_name; KoParagCounter::Style m_style; bool m_bullet; }; - static void makeCounterRepresenterList( QPtrList<StyleRepresenter>& stylesList , bool onlyStyleTypeLetter = false ); + static void makeCounterRepresenterList( TQPtrList<StyleRepresenter>& stylesList , bool onlyStyleTypeLetter = false ); void fillStyleCombo(KoParagCounter::Numbering type = KoParagCounter::NUM_LIST); void display( const KoParagLayout & lay ); void changeKWSpinboxType(KoParagCounter::Style st); @@ -294,20 +299,20 @@ signals: void sig_restartChanged(bool); void sig_depthChanged(int); void sig_displayLevelsChanged(int); - void sig_suffixChanged(const QString &); - void sig_prefixChanged(const QString &); + void sig_suffixChanged(const TQString &); + void sig_prefixChanged(const TQString &); void sig_numTypeChanged( int ); - void sig_alignmentChanged( int ); - void changeCustomBullet( const QString & , QChar ); + void sig_tqalignmentChanged( int ); + void changeCustomBullet( const TQString & , TQChar ); void changeStyle( KoParagCounter::Style ); protected slots: void startChanged(int i) {m_counter.setStartNumber(i);emit sig_startChanged(i);} void restartChanged(bool b) {m_counter.setRestartCounter(b);emit sig_restartChanged(b);} void depthChanged(int i) {m_counter.setDepth(i);emit sig_depthChanged(i);} void displayLevelsChanged(int i) {m_counter.setDisplayLevels(i);emit sig_displayLevelsChanged(i);} - void alignmentChanged(const QString& s); - void suffixChanged(const QString & txt) {m_counter.setSuffix(txt);emit sig_suffixChanged(txt); } - void prefixChanged(const QString & txt) {m_counter.setPrefix(txt);emit sig_prefixChanged(txt); } + void tqalignmentChanged(const TQString& s); + void suffixChanged(const TQString & txt) {m_counter.setSuffix(txt);emit sig_suffixChanged(txt); } + void prefixChanged(const TQString & txt) {m_counter.setPrefix(txt);emit sig_prefixChanged(txt); } void numStyleChanged(); void selectCustomBullet(); @@ -316,20 +321,20 @@ protected: void displayStyle( KoParagCounter::Style style ); private: - QGroupBox *gStyle; - QPtrList <StyleRepresenter> stylesList; - QListBox *lstStyle; + TQGroupBox *gStyle; + TQPtrList <StyleRepresenter> stylesList; + TQListBox *lstStyle; KoParagCounter m_counter; - QLineEdit *sSuffix, *sPrefix; - QPushButton *bCustom; + TQLineEdit *sSuffix, *sPrefix; + TQPushButton *bCustom; KoSpinBox *spnStart; - QSpinBox *spnDepth; - QSpinBox *spnDisplayLevels; - QLabel *lStart; - QLabel *lCustom; - QCheckBox *cbRestart; + TQSpinBox *spnDepth; + TQSpinBox *spnDisplayLevels; + TQLabel *lStart; + TQLabel *lCustom; + TQCheckBox *cbRestart; KComboBox *cbAlignment; - QLabel *lAlignment; + TQLabel *lAlignment; unsigned int styleBuffer; bool noSignals; }; @@ -340,15 +345,16 @@ private: class KOTEXT_EXPORT KoParagCounterWidget : public KoParagLayoutWidget { Q_OBJECT + TQ_OBJECT public: - KoParagCounterWidget( bool disableAll=false ,QWidget * parent=0L, const char * name = 0 ); + KoParagCounterWidget( bool disableAll=false ,TQWidget * tqparent=0L, const char * name = 0 ); virtual ~KoParagCounterWidget() {} virtual void display( const KoParagLayout & lay ); virtual void save( KoParagLayout & lay ); //virtual bool isModified(); - virtual QString tabName(); + virtual TQString tabName(); const KoParagCounter & counter() const { return m_counter; } @@ -357,20 +363,20 @@ protected slots: //void numStyleChanged(); // selected another style from the combobox void numTypeChanged( int ); // selected another type radiobutton. - void suffixChanged(const QString & txt) {m_counter.setSuffix(txt); updatePreview(); } - void prefixChanged(const QString & txt) {m_counter.setPrefix(txt); updatePreview();} + void suffixChanged(const TQString & txt) {m_counter.setSuffix(txt); updatePreview(); } + void prefixChanged(const TQString & txt) {m_counter.setPrefix(txt); updatePreview();} void startChanged(int i) {m_counter.setStartNumber(i); updatePreview();} void restartChanged(bool b) {m_counter.setRestartCounter(b); } void depthChanged(int i) {m_counter.setDepth(i); updatePreview();} void displayLevelsChanged(int i) {m_counter.setDisplayLevels(i); updatePreview();} - void alignmentChanged(int i) {m_counter.setAlignment(i); updatePreview();} - void slotChangeCustomBullet( const QString & f, QChar c); + void tqalignmentChanged(int i) {m_counter.tqsetAlignment(i); updatePreview();} + void slotChangeCustomBullet( const TQString & f, TQChar c); void styleChanged (KoParagCounter::Style st ); private: void updatePreview(); - QButtonGroup *gNumbering; + TQButtonGroup *gNumbering; KoParagCounter m_counter; KoStylePreview *preview; KoCounterStyleWidget *m_styleWidget; @@ -384,12 +390,13 @@ private: class KoTabulatorsLineEdit : public KoUnitDoubleSpinBox { Q_OBJECT + TQ_OBJECT public: - KoTabulatorsLineEdit( QWidget *parent, double lower, double upper, double step, double value = 0.0, + KoTabulatorsLineEdit( TQWidget *tqparent, double lower, double upper, double step, double value = 0.0, KoUnit::Unit unit = KoUnit::U_PT, unsigned int precision = 2, const char *name = 0 ); protected: - virtual void keyPressEvent ( QKeyEvent * ); + virtual void keyPressEvent ( TQKeyEvent * ); signals: void keyReturnPressed(); }; @@ -400,13 +407,14 @@ protected: class KOTEXT_EXPORT KoParagTabulatorsWidget : public KoParagLayoutWidget { Q_OBJECT + TQ_OBJECT public: - KoParagTabulatorsWidget( KoUnit::Unit unit, double _frameWidth, QWidget * parent, const char * name = 0 ); + KoParagTabulatorsWidget( KoUnit::Unit unit, double _frameWidth, TQWidget * tqparent, const char * name = 0 ); virtual ~KoParagTabulatorsWidget() {} virtual void display( const KoParagLayout & lay ); virtual void save( KoParagLayout & lay ); - virtual QString tabName(); + virtual TQString tabName(); KoTabulatorList tabList() const { return m_tabList; } @@ -414,7 +422,7 @@ public: protected slots: void slotTabValueChanged( double ); - void slotAlignCharChanged( const QString &_text ); + void slotAlignCharChanged( const TQString &_text ); void newClicked(); void deleteClicked(); void deleteAllClicked(); @@ -426,25 +434,25 @@ protected slots: private: void sortLists(); - QString tabToString(const KoTabulator &tab); + TQString tabToString(const KoTabulator &tab); - QVBoxLayout* editLayout; + TQVBoxLayout* editLayout; - QListBox* lstTabs; - QGroupBox* gPosition; + TQListBox* lstTabs; + TQGroupBox* gPosition; KoTabulatorsLineEdit* sTabPos; - QButtonGroup* bgAlign; - QRadioButton* rAlignLeft; - QRadioButton* rAlignCentre; - QRadioButton* rAlignRight; - QRadioButton* rAlignVar; - QLineEdit* sAlignChar; - QGroupBox* gTabLeader; - QComboBox* cFilling; + TQButtonGroup* bgAlign; + TQRadioButton* rAlignLeft; + TQRadioButton* rAlignCentre; + TQRadioButton* rAlignRight; + TQRadioButton* rAlignVar; + TQLineEdit* sAlignChar; + TQGroupBox* gTabLeader; + TQComboBox* cFilling; KoUnitDoubleSpinBox* eWidth; - QPushButton* bNew; - QPushButton* bDelete; - QPushButton* bDeleteAll; + TQPushButton* bNew; + TQPushButton* bDelete; + TQPushButton* bDeleteAll; KoTabulatorList m_tabList; KoUnit::Unit m_unit; @@ -457,12 +465,13 @@ private: * Used in the parag bullet/number tab of the parag dia, * and in the main tab of the stylist. */ -class KoStylePreview : public QGroupBox +class KoStylePreview : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - KoStylePreview( const QString &title, const QString &text, QWidget *parent, const char* name = 0 ); + KoStylePreview( const TQString &title, const TQString &text, TQWidget *tqparent, const char* name = 0 ); virtual ~KoStylePreview(); /** Apply the given @p style to the preview. @@ -473,7 +482,7 @@ public: void setCounter( const KoParagCounter & counter ); protected: - void drawContents( QPainter *painter ); + void drawContents( TQPainter *painter ); KoTextDocument *m_textdoc; KoTextZoomHandler *m_zoomHandler; @@ -489,6 +498,7 @@ protected: class KOTEXT_EXPORT KoParagDia : public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum { PD_SPACING = 1, PD_ALIGN = 2, PD_DECORATION = 4, PD_NUMBERING = 8, @@ -497,7 +507,7 @@ public: /** * breakLine : kpresenter didn't used this attibute, kword use it. */ - KoParagDia( QWidget*, const char*, int flags, KoUnit::Unit unit, double _frameWidth=-1,bool breakLine=true, bool disableAll = false); + KoParagDia( TQWidget*, const char*, int flags, KoUnit::Unit unit, double _frameWidth=-1,bool breakLine=true, bool disableAll = false); ~KoParagDia(); /** Flags passed to constructor */ @@ -536,28 +546,28 @@ public: KoTabulatorList tabListTabulator() const { return m_tabulatorsWidget->tabList(); } KoParagTabulatorsWidget * tabulatorsWidget() const { return m_tabulatorsWidget; } - QColor backgroundColor() const { return m_decorationsWidget->backgroundColor(); } + TQColor backgroundColor() const { return m_decorationsWidget->backgroundColor(); } // Support for "what has changed?" - bool isAlignChanged() const {return oldLayout.alignment!=align();} + bool isAlignChanged() const {return oldLayout.tqalignment!=align();} bool isLineSpacingChanged() const { return (oldLayout.lineSpacingValue() !=lineSpacing() || oldLayout.lineSpacingType != lineSpacingType()); } bool isLeftMarginChanged() const { - return oldLayout.margins[QStyleSheetItem::MarginLeft]!=leftIndent(); + return oldLayout.margins[TQStyleSheetItem::MarginLeft]!=leftIndent(); } bool isRightMarginChanged() const { - return oldLayout.margins[QStyleSheetItem::MarginRight]!=rightIndent(); + return oldLayout.margins[TQStyleSheetItem::MarginRight]!=rightIndent(); } bool isFirstLineChanged() const { - return oldLayout.margins[ QStyleSheetItem::MarginFirstLine]!=firstLineIndent(); + return oldLayout.margins[ TQStyleSheetItem::MarginFirstLine]!=firstLineIndent(); } bool isSpaceBeforeChanged() const { - return oldLayout.margins[QStyleSheetItem::MarginTop]!=spaceBeforeParag(); + return oldLayout.margins[TQStyleSheetItem::MarginTop]!=spaceBeforeParag(); } bool isSpaceAfterChanged() const { - return oldLayout.margins[QStyleSheetItem::MarginBottom]!=spaceAfterParag(); + return oldLayout.margins[TQStyleSheetItem::MarginBottom]!=spaceAfterParag(); } bool isPageBreakingChanged() const { return oldLayout.pageBreaking!=pageBreaking(); |