diff options
Diffstat (limited to 'lib/kotext/KFontDialog_local.h')
-rw-r--r-- | lib/kotext/KFontDialog_local.h | 164 |
1 files changed, 83 insertions, 81 deletions
diff --git a/lib/kotext/KFontDialog_local.h b/lib/kotext/KFontDialog_local.h index 5dc853dc..bb69cf57 100644 --- a/lib/kotext/KFontDialog_local.h +++ b/lib/kotext/KFontDialog_local.h @@ -1,7 +1,7 @@ /* $Id: kfontdialog.h,v 1.71 2004/10/10 10:27:49 bhards Exp $ - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997 Bernd Johannes Wuebben <wuebben@kde.org> @@ -29,18 +29,18 @@ #ifndef _K_FONT_DIALOG_LOCAL_H_ #define _K_FONT_DIALOG_LOCAL_H_ -#include <qlineedit.h> -#include <qbutton.h> +#include <tqlineedit.h> +#include <tqbutton.h> #include <kdialogbase.h> #include <koffice_export.h> -class QComboBox; -class QCheckBox; -class QFont; -class QGroupBox; -class QLabel; -class QStringList; +class TQComboBox; +class TQCheckBox; +class TQFont; +class TQGroupBox; +class TQLabel; +class TQStringList; class KListBox; class KIntNumInput; /** @@ -54,10 +54,11 @@ class KIntNumInput; * @author Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org> * @version $Id: kfontdialog.h,v 1.71 2004/10/10 10:27:49 bhards Exp $ */ -class KOTEXT_EXPORT KFontChooser_local : public QWidget +class KOTEXT_EXPORT KFontChooser_local : public TQWidget { Q_OBJECT - Q_PROPERTY( QFont font READ font WRITE setFont ) + TQ_OBJECT + TQ_PROPERTY( TQFont font READ font WRITE setFont ) public: /** @@ -81,14 +82,14 @@ public: * that will be displayed in the dialog. * <p>Consider the following code snippet; * \code - * QStringList list; + * TQStringList list; * KFontChooser_local::getFontList(list,SmoothScalableFonts); * KFontChooser_local chooseFont = new KFontChooser_local(0, "FontList", false, list); * \endcode * <p> * The above creates a font chooser dialog with only SmoothScaleble fonts. * - * @param parent The parent widget. + * @param tqparent The tqparent widget. * @param name The widget name. * @param onlyFixed Only display fonts which have fixed-width * character sizes. @@ -108,11 +109,11 @@ public: * *sizeIsRelativeState, user choice may be retrieved by * calling sizeIsRelative(). */ - KFontChooser_local(QWidget *parent = 0L, const char *name = 0L, + KFontChooser_local(TQWidget *tqparent = 0L, const char *name = 0L, bool onlyFixed = false, - const QStringList &fontList = QStringList(), + const TQStringList &fontList = TQStringList(), bool makeFrame = true, int visibleListSize=8, - bool diff = false, QButton::ToggleState *sizeIsRelativeState = 0L ); + bool diff = false, TQButton::ToggleState *sizeIsRelativeState = 0L ); /** * Destructs the font chooser. @@ -139,10 +140,10 @@ public: * @param onlyFixed Readjust the font list to display only fixed * width fonts if @p true, or vice-versa. */ - void setFont( const QFont &font, bool onlyFixed = false ); + void setFont( const TQFont &font, bool onlyFixed = false ); /** - * @return The bitmask corresponding to the attributes the user + * @return The bittqmask corresponding to the attributes the user * wishes to change. */ int fontDiffFlags(); @@ -150,29 +151,29 @@ public: /** * @return The currently selected font in the chooser. */ - QFont font() const { return selFont; } + TQFont font() const { return selFont; } /** * Sets the color to use in the preview. */ - void setColor( const QColor & col ); + void setColor( const TQColor & col ); /** * @return The color currently used in the preview (default: the text * color of the active color group) */ - QColor color() const; + TQColor color() const; /** * Sets the background color to use in the preview. */ - void setBackgroundColor( const QColor & col ); + void setBackgroundColor( const TQColor & col ); /** * @return The background color currently used in the preview (default: * the base color of the active colorgroup) */ - QColor backgroundColor() const; + TQColor backgroundColor() const; /** * Sets the state of the checkbox indicating whether the font size @@ -180,19 +181,19 @@ public: * NOTE: If parameter sizeIsRelative was not set in the constructor * of the widget this setting will be ignored. */ - void setSizeIsRelative( QButton::ToggleState relative ); + void setSizeIsRelative( TQButton::ToggleState relative ); /** * @return Whether the font size is to be interpreted as relative size - * (default: QButton:Off) + * (default: TQButton:Off) */ - QButton::ToggleState sizeIsRelative() const; + TQButton::ToggleState sizeIsRelative() const; /** * @return The current text in the sample text input area. */ - QString sampleText() const { return sampleEdit->text(); } + TQString sampleText() const { return sampleEdit->text(); } /** * Sets the sample text. @@ -204,7 +205,7 @@ public: * * @param text The new sample text. The current will be removed. */ - void setSampleText( const QString &text ) + void setSampleText( const TQString &text ) { sampleEdit->setText( text ); } @@ -220,13 +221,13 @@ public: } /** - * Converts a QFont into the corresponding X Logical Font + * Converts a TQFont into the corresponding X Logical Font * Description (XLFD). * * @param theFont The font to convert. * @return A string representing the given font in XLFD format. */ - static QString getXLFD( const QFont &theFont ) + static TQString getXLFD( const TQFont &theFont ) { return theFont.rawName(); } /** @@ -249,7 +250,7 @@ public: * @param fontListCriteria should contain all the restrictions for font selection as OR-ed values * @see KFontChooser_local::FontListCriteria for the individual values */ - static void getFontList( QStringList &list, uint fontListCriteria); + static void getFontList( TQStringList &list, uint fontListCriteria); /** * @@ -257,62 +258,62 @@ public: * * @param list The font list. */ - void setFamilyList( QStringList list ); + void setFamilyList( TQStringList list ); /** * Reimplemented for internal reasons. */ - virtual QSize sizeHint( void ) const; + virtual TQSize tqsizeHint( void ) const; signals: /** * Emitted whenever the selected font changes. */ - void fontSelected( const QFont &font ); + void fontSelected( const TQFont &font ); private slots: void toggled_checkbox(); - void family_chosen_slot(const QString&); - void size_chosen_slot(const QString&); - void style_chosen_slot(const QString&); - void displaySample(const QFont &font); + void family_chosen_slot(const TQString&); + void size_chosen_slot(const TQString&); + void style_chosen_slot(const TQString&); + void displaySample(const TQFont &font); void showXLFDArea(bool); void size_value_slot(int); private: void fillFamilyListBox(bool onlyFixedFonts = false); void fillSizeList(); - // This one must be static since getFontList( QStringList, char*) is so - static void addFont( QStringList &list, const char *xfont ); + // This one must be static since getFontList( TQStringList, char*) is so + static void addFont( TQStringList &list, const char *xfont ); void setupDisplay(); // pointer to an optinally supplied list of fonts to // inserted into the fontdialog font-family combo-box - QStringList fontList; + TQStringList fontList; KIntNumInput *sizeOfFont; - QLineEdit *sampleEdit; - QLineEdit *xlfdEdit; + TQLineEdit *sampleEdit; + TQLineEdit *xlfdEdit; - QLabel *familyLabel; - QLabel *styleLabel; - QCheckBox *familyCheckbox; - QCheckBox *styleCheckbox; - QCheckBox *sizeCheckbox; - QLabel *sizeLabel; + TQLabel *familyLabel; + TQLabel *styleLabel; + TQCheckBox *familyCheckbox; + TQCheckBox *styleCheckbox; + TQCheckBox *sizeCheckbox; + TQLabel *sizeLabel; KListBox *familyListBox; KListBox *styleListBox; KListBox *sizeListBox; - QComboBox *charsetsCombo; // BIC: remove in KDE4 - QCheckBox *sizeIsRelativeCheckBox; + TQComboBox *charsetsCombo; // BIC: remove in KDE4 + TQCheckBox *sizeIsRelativeCheckBox; - QFont selFont; + TQFont selFont; - QString selectedFamily; - QString selectedStyle; + TQString selectedFamily; + TQString selectedStyle; int selectedSize; - QMap<QString, QString> currentStyles; + TQMap<TQString, TQString> currentStyles; bool usingFixed; @@ -336,7 +337,7 @@ private: * Example: * * \code - * QFont myFont; + * TQFont myFont; * int result = KFontDialog_local::getFont( myFont ); * if ( result == KFontDialog_local::Accepted ) * ... @@ -349,12 +350,13 @@ private: */ class KOTEXT_EXPORT KFontDialog_local : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** * Constructs a font selection dialog. * - * @param parent The parent widget of the dialog, if any. + * @param tqparent The tqparent widget of the dialog, if any. * @param name The name of the dialog. * @param modal Specifies whether the dialog is modal or not. * @param onlyFixed only display fonts which have fixed-width @@ -373,11 +375,11 @@ public: * calling sizeIsRelative(). * */ - KFontDialog_local( QWidget *parent = 0L, const char *name = 0, + KFontDialog_local( TQWidget *tqparent = 0L, const char *name = 0, bool onlyFixed = false, bool modal = false, - const QStringList &fontlist = QStringList(), + const TQStringList &fontlist = TQStringList(), bool makeFrame = true, bool diff = false, - QButton::ToggleState *sizeIsRelativeState = 0L ); + TQButton::ToggleState *sizeIsRelativeState = 0L ); /** * Sets the currently selected font in the dialog. @@ -386,13 +388,13 @@ public: * @param onlyFixed readjust the font list to display only fixed * width fonts if true, or vice-versa */ - void setFont( const QFont &font, bool onlyFixed = false ) + void setFont( const TQFont &font, bool onlyFixed = false ) { chooser->setFont(font, onlyFixed); } /** * @return The currently selected font in the dialog. */ - QFont font() const { return chooser->font(); } + TQFont font() const { return chooser->font(); } /** * Sets the state of the checkbox indicating whether the font size @@ -400,14 +402,14 @@ public: * NOTE: If parameter sizeIsRelative was not set in the constructor * of the dialog this setting will be ignored. */ - void setSizeIsRelative( QButton::ToggleState relative ) + void setSizeIsRelative( TQButton::ToggleState relative ) { chooser->setSizeIsRelative( relative ); } /** * @return Whether the font size is to be interpreted as relative size * (default: false) */ - QButton::ToggleState sizeIsRelative() const + TQButton::ToggleState sizeIsRelative() const { return chooser->sizeIsRelative(); } /** @@ -417,7 +419,7 @@ public: * @param theFont a reference to the font to write the chosen font * into. * @param onlyFixed if true, only select from fixed-width fonts. - * @param parent Parent widget of the dialog. Specifying a widget different + * @param tqparent Parent widget of the dialog. Specifying a widget different * from 0 (Null) improves centering (looks better). * @param makeFrame Draws a frame with titles around the contents. * @param sizeIsRelativeState If not zero the widget will show a @@ -427,11 +429,11 @@ public: * *sizeIsRelativeState and user choice will be returned * therein. * - * @return QDialog::result(). + * @return TQDialog::result(). */ - static int getFont( QFont &theFont, bool onlyFixed = false, - QWidget *parent = 0L, bool makeFrame = true, - QButton::ToggleState *sizeIsRelativeState = 0L ); + static int getFont( TQFont &theFont, bool onlyFixed = false, + TQWidget *tqparent = 0L, bool makeFrame = true, + TQButton::ToggleState *sizeIsRelativeState = 0L ); /** * Creates a modal font difference dialog, lets the user choose a selection @@ -442,8 +444,8 @@ public: * @param theFont a reference to the font to write the chosen font * into. * @param diffFlags a reference to the int into which the chosen - * difference selection bitmask should be written. - * Check the returned bitmask like: + * difference selection bittqmask should be written. + * Check the returned bittqmask like: * \code * if ( diffFlags & KFontChooser_local::FontDiffFamily ) * [...] @@ -453,7 +455,7 @@ public: * [...] * \endcode * @param onlyFixed if true, only select from fixed-width fonts. - * @param parent Parent widget of the dialog. Specifying a widget different + * @param tqparent Parent widget of the dialog. Specifying a widget different * from 0 (Null) improves centering (looks better). * @param makeFrame Draws a frame with titles around the contents. * @param sizeIsRelativeState If not zero the widget will show a @@ -463,11 +465,11 @@ public: * *sizeIsRelativeState and user choice will be returned * therein. * - * @returns QDialog::result(). + * @returns TQDialog::result(). */ - static int getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed = false, - QWidget *parent = 0L, bool makeFrame = true, - QButton::ToggleState *sizeIsRelativeState = 0L ); + static int getFontDiff( TQFont &theFont, int &diffFlags, bool onlyFixed = false, + TQWidget *tqparent = 0L, bool makeFrame = true, + TQButton::ToggleState *sizeIsRelativeState = 0L ); /** * When you are not only interested in the font selected, but also @@ -477,7 +479,7 @@ public: * into. * @param theString a reference to the example text that was typed. * @param onlyFixed if true, only select from fixed-width fonts. - * @param parent Parent widget of the dialog. Specifying a widget different + * @param tqparent Parent widget of the dialog. Specifying a widget different * from 0 (Null) improves centering (looks better). * @param makeFrame Draws a frame with titles around the contents. * @param sizeIsRelativeState If not zero the widget will show a @@ -488,10 +490,10 @@ public: * therein. * @return The result of the dialog. */ - static int getFontAndText( QFont &theFont, QString &theString, - bool onlyFixed = false, QWidget *parent = 0L, + static int getFontAndText( TQFont &theFont, TQString &theString, + bool onlyFixed = false, TQWidget *tqparent = 0L, bool makeFrame = true, - QButton::ToggleState *sizeIsRelativeState = 0L ); + TQButton::ToggleState *sizeIsRelativeState = 0L ); signals: /** @@ -499,7 +501,7 @@ signals: * Connect to this to monitor the font as it is selected if you are * not running modal. */ - void fontSelected( const QFont &font ); + void fontSelected( const TQFont &font ); protected: KFontChooser_local *chooser; |