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.
28 void addCheckedLineEdit(BCView & bcview,
29 QLineEdit * input, QWidget * label = 0);
34 CheckedLineEdit(QLineEdit * input, QWidget * label = 0);
43 /** General purpose button controller for up to four buttons.
44 Controls the activation of the OK, Apply and Cancel buttons.
45 Actually supports 4 buttons in all and it's up to the user to decide on
46 the activation policy and which buttons correspond to which output of the
50 class Qt2BC : public BCView
54 Qt2BC(ButtonController & parent);
57 /** Store pointers to these widgets.
59 void setOK(QPushButton * obj) { okay_ = obj; }
60 void setApply(QPushButton * obj) { apply_ = obj; }
61 void setCancel(QPushButton * obj) { cancel_ = obj; }
62 void setRestore(QPushButton * obj) { restore_ = obj; }
65 /** Add a pointer to the list of widgets whose activation
66 * state is dependent upon the read-only status of the
69 void addReadOnly(QWidget * obj) { read_only_.push_back(obj); }
71 /// Refresh the status of the Ok, Apply, Restore, Cancel buttons.
72 virtual void refresh() const;
73 /// Refresh the status of any widgets in the read_only list
74 virtual void refreshReadOnly() const;
76 /** Add a widget to the list of all widgets whose validity should
77 * be checked explicitly when the buttons are refreshed.
79 void addCheckedLineEdit(QLineEdit * input, QWidget * label = 0);
82 /// \return true if all CheckedWidgets are in a valid state.
83 bool checkWidgets() const;
86 typedef std::list<CheckedLineEdit> CheckedWidgetList;
87 CheckedWidgetList checked_widgets;
90 /// Updates the widget sensitivity (enabled/disabled)
91 void setWidgetEnabled(QWidget *, bool enabled) const;
95 QPushButton * cancel_;
96 QPushButton * restore_;
98 typedef std::list<QWidget *> Widgets;
102 } // namespace frontend