1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2000-2001 The LyX Team.
8 * ======================================================
10 * \file ButtonControllerBase.h
11 * \author Allan Rae, rae@lyx.org
14 #ifndef BUTTONCONTROLLERBASE_H
15 #define BUTTONCONTROLLERBASE_H
21 #include "ButtonPolicies.h"
24 /** Abstract base class for a ButtonController
26 * Controls the activation of the OK, Apply and Cancel buttons.
27 * Actually supports 4 buttons in all and it's up to the user to decide on
28 * the activation policy and which buttons correspond to which output of the
30 * Author: Allan Rae <rae@lyx.org>.
31 * This abstract base class stripped of xforms-specific code by
32 * Angus Leeming <a.leeming@ic.ac.uk>
34 class ButtonControllerBase : public boost::noncopyable
38 The cancel/close label entries are _not_ managed within the class
39 thereby allowing you to reassign at will and to use static labels.
40 It also means if you really don't want to have the Cancel button
41 label be different when there is nothing changed in the dialog then
42 you can just assign "Cancel" to both labels. Or even reuse this
43 class for something completely different.
45 ButtonControllerBase(string const & cancel, string const & close);
47 virtual ~ButtonControllerBase() {}
49 virtual ButtonPolicy & bp() = 0;
51 virtual void input(ButtonPolicy::SMInput);
63 virtual void refresh() = 0;
65 /// Passthrough function -- returns its input value
66 bool readOnly(bool = true);
70 void valid(bool = true);
81 #endif // BUTTONCONTROLLERBASE_H