3 * \file ButtonController.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 BUTTONCONTROLLER_H
13 #define BUTTONCONTROLLER_H
16 #include "ButtonPolicies.h"
19 #include <boost/scoped_ptr.hpp>
22 /** Controls the activation of the OK, Apply and Cancel buttons.
24 * Actually supports 4 buttons in all and it's up to the user to decide on
25 * the activation policy and which buttons correspond to which output of the
27 * Author: Allan Rae <rae@lyx.org>.
28 * This class stripped of xforms-specific code by
29 * Angus Leeming <leeming@lyx.org>
33 class ButtonController : boost::noncopyable {
39 BCView & view() const;
44 ButtonPolicy & bp() const;
46 void bp(ButtonPolicy *);
49 void input(ButtonPolicy::SMInput);
64 void refreshReadOnly();
66 /// Passthrough function -- returns its input value
67 bool readOnly(bool = true);
72 void valid(bool = true);
78 boost::scoped_ptr<ButtonPolicy> bp_;
80 boost::scoped_ptr<BCView> view_;
83 #endif // BUTTONCONTROLLER_H