3 * \file ButtonControllerBase.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
12 #ifndef BUTTONCONTROLLERBASE_H
13 #define BUTTONCONTROLLERBASE_H
19 #include "ButtonPolicies.h"
22 /** Abstract base class for a ButtonController
24 * Controls the activation of the OK, Apply and Cancel buttons.
25 * Actually supports 4 buttons in all and it's up to the user to decide on
26 * the activation policy and which buttons correspond to which output of the
28 * Author: Allan Rae <rae@lyx.org>.
29 * This abstract base class stripped of xforms-specific code by
30 * Angus Leeming <leeming@lyx.org>
32 class ButtonControllerBase : boost::noncopyable
36 The cancel/close label entries are _not_ managed within the class
37 thereby allowing you to reassign at will and to use static labels.
38 It also means if you really don't want to have the Cancel button
39 label be different when there is nothing changed in the dialog then
40 you can just assign "Cancel" to both labels. Or even reuse this
41 class for something completely different.
43 ButtonControllerBase(string const & cancel, string const & close);
45 virtual ~ButtonControllerBase() {}
47 virtual ButtonPolicy & bp() = 0;
49 virtual void input(ButtonPolicy::SMInput);
61 virtual void refresh() = 0;
63 virtual void refreshReadOnly() = 0;
65 /// Passthrough function -- returns its input value
66 bool readOnly(bool = true);
70 void valid(bool = true);
81 #endif // BUTTONCONTROLLERBASE_H