1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: QtxFontEdit.h
21 // Author: Sergey TELKOV
35 class QTX_EXPORT QtxFontEdit : public QFrame
40 //! Font widget features
42 Family = 0x01, //!< show font family selection widget
43 Size = 0x02, //!< show font size widget
44 UserSize = 0x04, //!< allow font size direct change
45 Bold = 0x08, //!< show 'bold' widget
46 Italic = 0x10, //!< show 'italic' widget
47 Underline = 0x20, //!< show 'underline' widget
48 Shadow = 0x40, //!< show 'shadow' widget
49 Preview = 0x80, //!< show font preview widget
50 Scripting = Bold | Italic | Underline, //!< show font scripting widgets ('bold','italic','underline')
51 All = Family | Size | UserSize | Scripting | Preview //!< show all font widgets
56 Native, //!< Native mode intended for working with system fonts
57 Custom //!< Custom mode intended for working with manually defined set of fonts
61 QtxFontEdit( const int, QWidget* = 0 );
62 QtxFontEdit( QWidget* = 0 );
63 virtual ~QtxFontEdit();
65 QFont currentFont() const;
66 void setCurrentFont( const QFont& );
69 QString fontFamily() const;
70 int fontScripting() const;
72 void setFontSize( const int );
73 void setFontFamily( const QString& );
74 void setFontScripting( const int );
77 void setFeatures( const int );
79 void setMode( const int );
82 void setFonts( const QStringList& );
83 QStringList fonts() const;
85 void setSizes( const QList<int>& = QList<int>() );
86 QList<int> sizes() const;
89 void changed( const QFont& );
92 void onPreview( bool );
93 void onFontChanged( const QFont& );
94 void onPropertyChanged();
102 QFontComboBox* myFamily;
103 QToolButton* myPreview;
105 QToolButton *myB, *myI, *myU, *myS;
107 QComboBox* myCustomFams;
110 #endif // QTXFONTEDIT_H