Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QTXFONTEDIT_H
00024 #define QTXFONTEDIT_H
00025
00026 #include "Qtx.h"
00027
00028 #include <QFrame>
00029
00030 class QtxComboBox;
00031 class QComboBox;
00032 class QToolButton;
00033 class QFontComboBox;
00034
00035 class QTX_EXPORT QtxFontEdit : public QFrame
00036 {
00037 Q_OBJECT
00038
00039 public:
00041 typedef enum {
00042 Family = 0x01,
00043 Size = 0x02,
00044 UserSize = 0x04,
00045 Bold = 0x08,
00046 Italic = 0x10,
00047 Underline = 0x20,
00048 Shadow = 0x40,
00049 Preview = 0x80,
00050 Scripting = Bold | Italic | Underline,
00051 All = Family | Size | UserSize | Scripting | Preview
00052 } Features;
00053
00054 typedef enum
00055 {
00056 Native,
00057 Custom
00058 } Mode;
00059
00060 public:
00061 QtxFontEdit( const int, QWidget* = 0 );
00062 QtxFontEdit( QWidget* = 0 );
00063 virtual ~QtxFontEdit();
00064
00065 QFont currentFont() const;
00066 void setCurrentFont( const QFont& );
00067
00068 int fontSize() const;
00069 QString fontFamily() const;
00070 int fontScripting() const;
00071
00072 void setFontSize( const int );
00073 void setFontFamily( const QString& );
00074 void setFontScripting( const int );
00075
00076 int features() const;
00077 void setFeatures( const int );
00078
00079 void setMode( const int );
00080 int mode() const;
00081
00082 void setFonts( const QStringList& );
00083 QStringList fonts() const;
00084
00085 void setSizes( const QList<int>& = QList<int>() );
00086 QList<int> sizes() const;
00087
00088 signals:
00089 void changed( const QFont& );
00090
00091 private slots:
00092 void onPreview( bool );
00093 void onFontChanged( const QFont& );
00094 void onPropertyChanged();
00095
00096 private:
00097 void initialize();
00098 void updateState();
00099
00100 private:
00101 QtxComboBox* mySize;
00102 QFontComboBox* myFamily;
00103 QToolButton* myPreview;
00104 int myFeatures;
00105 QToolButton *myB, *myI, *myU, *myS;
00106 int myMode;
00107 QComboBox* myCustomFams;
00108 };
00109
00110 #endif // QTXFONTEDIT_H