4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS.
26 /** General purpose button controller for up to four buttons.
27 Controls the activation of the OK, Apply and Cancel buttons.
28 Actually supports 4 buttons in all and it's up to the user to decide on
29 the activation policy and which buttons correspond to which output of the
33 class Qt2BC : public BCView
37 Qt2BC(ButtonController const & parent);
40 /** Store pointers to these widgets.
42 void setOK(QPushButton * obj) { okay_ = obj; }
43 void setApply(QPushButton * obj) { apply_ = obj; }
44 void setCancel(QPushButton * obj) { cancel_ = obj; }
45 void setRestore(QPushButton * obj) { restore_ = obj; }
48 /** Add a pointer to the list of widgets whose activation
49 * state is dependent upon the read-only status of the
52 void addReadOnly(QWidget * obj) { read_only_.push_back(obj); }
54 /// Refresh the status of the Ok, Apply, Restore, Cancel buttons.
55 virtual void refresh() const;
56 /// Refresh the status of any widgets in the read_only list
57 virtual void refreshReadOnly() const;
60 /// Updates the widget sensitivity (enabled/disabled)
61 void setWidgetEnabled(QWidget *, bool enabled) const;
65 QPushButton * cancel_;
66 QPushButton * restore_;
68 typedef std::list<QWidget *> Widgets;
72 } // namespace frontend