2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * This file Copyright 2000
12 * ======================================================
14 * Author: Allan Rae <rae@lyx.org>
15 * Non-xforms-specific code stripped-out and placed in a base class by
16 * Angus Leeming <a.leeming@ic.ac.uk>
30 #include "ButtonController.h"
32 /** General purpose button controller for up to four buttons.
33 Controls the activation of the OK, Apply and Cancel buttons.
34 Actually supports 4 buttons in all and it's up to the user to decide on
35 the activation policy and which buttons correspond to which output of the
38 class qt2BC : public ButtonControllerBase
42 qt2BC(string const &, string const &);
44 /* Initialise Button Functions */
45 /// Call refresh() when finished setting the buttons.
46 void setOK(QButton * obj) {
50 void setApply(QButton * obj) {
54 void setCancel(QButton * obj) {
58 void setUndoAll(QButton * obj) {
62 void addReadOnly(QButton * obj) {
63 read_only_.push_front(obj);
66 void eraseReadOnly() {
67 read_only_.erase(read_only_.begin(), read_only_.end());
70 /* Action Functions */
71 /// force a refresh of the buttons
72 virtual void refresh();
83 /// List of items to be deactivated when in one of the read-only states
84 std::list<QButton *> read_only_;