2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2001 The LyX Team.
9 * ======================================================
11 * \file ControlButtons.h
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
14 * ControlButtons serves only to control the activation of the Ok, Apply, Cancel
15 * and Restore buttons on the View dialog.
17 * More generally, the class is part of a hierarchy of controller classes
18 * that together connect the GUI-dependent dialog to any appropriate
19 * signals and dispatches any changes to the kernel.
21 * These controllers have no knowledge of the actual instantiation of the
22 * GUI-dependent View and ButtonController, which should therefore
23 * be created elsewhere.
25 * Once created, the Controller will take care of their initialisation,
26 * management and, ultimately, destruction.
29 #ifndef CONTROLBUTTONS_H
30 #define CONTROLBUTTONS_H
36 #include "DialogBase.h" // This can go eventually
39 class ButtonControllerBase;
41 /** Abstract base class for Controllers with a ButtonController.
43 class ControlButtons : public DialogBase
49 virtual ~ControlButtons() {}
51 /// These functions are called when the controlling buttons are pressed.
61 bool IconifyWithMain() const;
63 /** Allow the view to access the ButtonController. This method must be
64 instantiated in a daughter class that creates the actual instance
65 of the ButtonController. */
66 virtual ButtonControllerBase & bc() = 0;
69 /** When Applying it's useful to know whether the dialog is about
70 to close or not (no point refreshing the display for example). */
71 bool isClosing() const { return is_closing_; }
73 /// Get changed parameters and Dispatch them to the kernel.
74 virtual void apply() = 0;
75 /// Disconnect signals and hide View.
76 virtual void hide() = 0;
77 /// Update dialog before showing it.
78 virtual void update() = 0;
80 /** Allow the Controller to access the View. This method must be
81 instantiated in a daughter class that creates the actual instance
83 virtual ViewBase & view() = 0;
85 /** This flag can be set by one of the miriad the controller methods
86 to ensure that the dialog is shut down. */
95 #endif // CONTROLBUTTONS_H