3 * \file ControlButtons.h
4 * Read the file COPYING
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
10 * ControlButtons serves only to control the activation of the Ok, Apply, Cancel
11 * and Restore buttons on the View dialog.
13 * More generally, the class is part of a hierarchy of controller classes
14 * that together connect the GUI-dependent dialog to any appropriate
15 * signals and dispatches any changes to the kernel.
17 * These controllers have no knowledge of the actual instantiation of the
18 * GUI-dependent View and ButtonController, which should therefore
19 * be created elsewhere.
21 * Once created, the Controller will take care of their initialisation,
22 * management and, ultimately, destruction.
25 #ifndef CONTROLBUTTONS_H
26 #define CONTROLBUTTONS_H
32 #include <boost/utility.hpp>
35 class ButtonControllerBase;
37 /** Abstract base class for Controllers with a ButtonController.
39 class ControlButtons : boost::noncopyable
45 virtual ~ControlButtons() {}
47 /** These functions are called by the view when the appropriate buttons
59 /// Returns the user-specified iconification policy.
60 bool IconifyWithMain() const;
63 ButtonControllerBase & bc();
66 void setView(ViewBase &);
68 void setButtonController(ButtonControllerBase &);
74 /** When Applying it's useful to know whether the dialog is about
75 to close or not (no point refreshing the display for example). */
76 bool isClosing() const { return is_closing_; }
78 /// Get changed parameters and Dispatch them to the kernel.
79 virtual void apply() = 0;
80 /// Disconnect signals and hide View.
81 virtual void hide() = 0;
82 /// Update dialog before showing it.
83 virtual void update() = 0;
85 /** This flag can be set by one of the miriad the controller methods
86 to ensure that the dialog is shut down. */
92 /// We own neither of these pointers.
93 ButtonControllerBase * bc_ptr_;
98 #endif // CONTROLBUTTONS_H