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.
30 void addCheckedLineEdit(BCView & bcview,
31 QLineEdit * input, QWidget * label = 0);
36 CheckedLineEdit(QLineEdit * input, QWidget * label = 0);
45 /** General purpose button controller for up to four buttons.
46 Controls the activation of the OK, Apply and Cancel buttons.
47 Actually supports 4 buttons in all and it's up to the user to decide on
48 the activation policy and which buttons correspond to which output of the
52 class Qt2BC : public BCView
56 Qt2BC(ButtonController & parent);
59 /** Store pointers to these widgets.
61 void setOK(QPushButton * obj) { okay_ = obj; }
62 void setApply(QPushButton * obj) { apply_ = obj; }
63 void setCancel(QPushButton * obj) { cancel_ = obj; }
64 void setRestore(QPushButton * obj) { restore_ = obj; }
67 /** Add a pointer to the list of widgets whose activation
68 * state is dependent upon the read-only status of the
71 void addReadOnly(QWidget * obj) { read_only_.push_back(obj); }
73 /// Refresh the status of the Ok, Apply, Restore, Cancel buttons.
74 virtual void refresh() const;
75 /// Refresh the status of any widgets in the read_only list
76 virtual void refreshReadOnly() const;
78 /** Add a widget to the list of all widgets whose validity should
79 * be checked explicitly when the buttons are refreshed.
81 void addCheckedLineEdit(QLineEdit * input, QWidget * label = 0);
84 /// \return true if all CheckedWidgets are in a valid state.
85 bool checkWidgets() const;
88 typedef std::list<CheckedLineEdit> CheckedWidgetList;
89 CheckedWidgetList checked_widgets;
92 /// Updates the widget sensitivity (enabled/disabled)
93 void setWidgetEnabled(QWidget *, bool enabled) const;
97 QPushButton * cancel_;
98 QPushButton * restore_;
100 typedef std::list<QWidget *> Widgets;
104 } // namespace frontend