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.actiongroup; 15 extern(C++): 16 17 import qt.config; 18 import qt.helpers; 19 version(QT_NO_ACTION){}else 20 { 21 import qt.core.list; 22 import qt.core.object; 23 import qt.core.string; 24 import qt.gui.icon; 25 import qt.widgets.action; 26 } 27 28 version(QT_NO_ACTION){}else 29 { 30 31 extern(C++, class) struct QActionGroupPrivate; 32 33 class /+ Q_WIDGETS_EXPORT +/ QActionGroup : QObject 34 { 35 mixin(Q_OBJECT); 36 /+ Q_DECLARE_PRIVATE(QActionGroup) +/ 37 38 /+ Q_PROPERTY(QActionGroup::ExclusionPolicy exclusionPolicy READ exclusionPolicy WRITE setExclusionPolicy) 39 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) 40 Q_PROPERTY(bool visible READ isVisible WRITE setVisible) +/ 41 42 public: 43 enum /+ class +/ ExclusionPolicy { 44 None, 45 Exclusive, 46 ExclusiveOptional 47 } 48 /+ Q_ENUM(ExclusionPolicy) +/ 49 50 /+ explicit +/this(QObject parent); 51 ~this(); 52 53 final QAction addAction(QAction a); 54 final QAction addAction(ref const(QString) text); 55 final QAction addAction(ref const(QIcon) icon, ref const(QString) text); 56 final void removeAction(QAction a); 57 final QList!(QAction) actions() const; 58 59 final QAction checkedAction() const; 60 final bool isExclusive() const; 61 final bool isEnabled() const; 62 final bool isVisible() const; 63 final ExclusionPolicy exclusionPolicy() const; 64 65 66 public /+ Q_SLOTS +/: 67 @QSlot final void setEnabled(bool); 68 pragma(inline, true) @QSlot final void setDisabled(bool b) { setEnabled(!b); } 69 @QSlot final void setVisible(bool); 70 @QSlot final void setExclusive(bool); 71 @QSlot final void setExclusionPolicy(ExclusionPolicy policy); 72 73 /+ Q_SIGNALS +/public: 74 @QSignal final void triggered(QAction ); 75 @QSignal final void hovered(QAction ); 76 77 private: 78 /+ Q_DISABLE_COPY(QActionGroup) +/ 79 /+ Q_PRIVATE_SLOT(d_func(), void _q_actionTriggered()) 80 Q_PRIVATE_SLOT(d_func(), void _q_actionChanged()) 81 Q_PRIVATE_SLOT(d_func(), void _q_actionHovered()) +/ 82 } 83 84 } 85