1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.widgets.fontcombobox; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.coreevent; 19 import qt.core.flags; 20 import qt.core.size; 21 import qt.gui.font; 22 import qt.gui.fontdatabase; 23 import qt.helpers; 24 import qt.widgets.combobox; 25 import qt.widgets.widget; 26 27 /+ QT_REQUIRE_CONFIG(fontcombobox); +/ 28 29 30 extern(C++, class) struct QFontComboBoxPrivate; 31 32 class /+ Q_WIDGETS_EXPORT +/ QFontComboBox : QComboBox 33 { 34 mixin(Q_OBJECT); 35 /+ Q_PROPERTY(QFontDatabase::WritingSystem writingSystem READ writingSystem WRITE setWritingSystem) 36 Q_PROPERTY(FontFilters fontFilters READ fontFilters WRITE setFontFilters) 37 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged) +/ 38 39 public: 40 /+ explicit +/this(QWidget parent = null); 41 ~this(); 42 43 final void setWritingSystem(QFontDatabase.WritingSystem); 44 final QFontDatabase.WritingSystem writingSystem() const; 45 46 enum FontFilter { 47 AllFonts = 0, 48 ScalableFonts = 0x1, 49 NonScalableFonts = 0x2, 50 MonospacedFonts = 0x4, 51 ProportionalFonts = 0x8 52 } 53 /+ Q_DECLARE_FLAGS(FontFilters, FontFilter) +/ 54 alias FontFilters = QFlags!(FontFilter); /+ Q_FLAG(FontFilters) +/ 55 56 final void setFontFilters(FontFilters filters); 57 final FontFilters fontFilters() const; 58 59 final QFont currentFont() const; 60 override QSize sizeHint() const; 61 62 public /+ Q_SLOTS +/: 63 @QSlot final void setCurrentFont(ref const(QFont) f); 64 65 /+ Q_SIGNALS +/public: 66 @QSignal final void currentFontChanged(ref const(QFont) f); 67 68 protected: 69 override bool event(QEvent e); 70 71 private: 72 /+ Q_DISABLE_COPY(QFontComboBox) +/ 73 /+ Q_DECLARE_PRIVATE(QFontComboBox) +/ 74 /+ Q_PRIVATE_SLOT(d_func(), void _q_currentChanged(const QString &)) 75 Q_PRIVATE_SLOT(d_func(), void _q_updateModel()) +/ 76 } 77 /+pragma(inline, true) QFlags!(QFontComboBox.FontFilters.enum_type) operator |(QFontComboBox.FontFilters.enum_type f1, QFontComboBox.FontFilters.enum_type f2)/+noexcept+/{return QFlags!(QFontComboBox.FontFilters.enum_type)(f1)|f2;}+/ 78 /+pragma(inline, true) QFlags!(QFontComboBox.FontFilters.enum_type) operator |(QFontComboBox.FontFilters.enum_type f1, QFlags!(QFontComboBox.FontFilters.enum_type) f2)/+noexcept+/{return f2|f1;}+/ 79 /+pragma(inline, true) QIncompatibleFlag operator |(QFontComboBox.FontFilters.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/ 80 81 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontComboBox::FontFilters) +/