1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: QtxFontEdit.h
23 // Author: Sergey TELKOV
37 class QTX_EXPORT QtxFontEdit : public QFrame
42 //! Font widget features
44 Family = 0x01, //!< show font family selection widget
45 Size = 0x02, //!< show font size widget
46 UserSize = 0x04, //!< allow font size direct change
47 Bold = 0x08, //!< show 'bold' widget
48 Italic = 0x10, //!< show 'italic' widget
49 Underline = 0x20, //!< show 'underline' widget
50 Shadow = 0x40, //!< show 'shadow' widget
51 Preview = 0x80, //!< show font preview widget
52 Scripting = Bold | Italic | Underline, //!< show font scripting widgets ('bold','italic','underline')
53 All = Family | Size | UserSize | Scripting | Preview //!< show all font widgets
58 Native, //!< Native mode intended for working with system fonts
59 Custom //!< Custom mode intended for working with manually defined set of fonts
63 QtxFontEdit( const int, QWidget* = 0 );
64 QtxFontEdit( QWidget* = 0 );
65 virtual ~QtxFontEdit();
67 QFont currentFont() const;
68 void setCurrentFont( const QFont& );
71 QString fontFamily() const;
72 int fontScripting() const;
74 void setFontSize( const int );
75 void setFontFamily( const QString& );
76 void setFontScripting( const int );
79 void setFeatures( const int );
81 void setMode( const int );
84 void setFonts( const QStringList& );
85 QStringList fonts() const;
87 void setSizes( const QList<int>& = QList<int>() );
88 QList<int> sizes() const;
91 void changed( const QFont& );
94 void onPreview( bool );
95 void onFontChanged( const QFont& );
96 void onPropertyChanged();
104 QFontComboBox* myFamily;
105 QToolButton* myPreview;
107 QToolButton *myB, *myI, *myU, *myS;
109 QComboBox* myCustomFams;
112 #endif // QTXFONTEDIT_H