]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlButtons.h
Remove some xforms cruft from BufferView.h BufferView_pimpl.h.
[lyx.git] / src / frontends / controllers / ControlButtons.h
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlButtonss.h
11  * \author Angus Leeming <a.leeming@ic.ac.uk>
12  *
13  * ControlButtons serves only to control the activation of the Ok, Apply, Cancel
14  * and Restore buttons on the View dialog.
15  *
16  * More generally, the class is part of a hierarchy of controller classes
17  * that together connect the GUI-dependent dialog to any appropriate
18  * signals and dispatches any changes to the kernel.
19  *
20  * These controllers have no knowledge of the actual instantiation of the
21  * GUI-dependent View and ButtonController, which should therefore
22  * be created elsewhere.
23  *
24  * Once created, the Controller will take care of their initialisation,
25  * management and, ultimately, destruction.
26  */
27
28 #ifndef CONTROLBUTTONS_H
29 #define CONTROLBUTTONS_H
30
31 #ifdef __GNUG__
32 #pragma interface
33 #endif
34
35 #include "DialogBase.h" // This can go eventually
36 #include "ButtonControllerBase.h"
37
38 class ViewBase;
39
40 /** Abstract base class for Controllers with a ButtonController.
41  */
42 class ControlButtons : public DialogBase
43 {
44 public: // methods
45         ///
46         ControlButtons() {}
47         ///
48         virtual ~ControlButtons() {};
49
50         /// These functions are called when the controlling buttons are pressed.
51         ///
52         void ApplyButton();
53         ///
54         void OKButton();
55         ///
56         void CancelButton();
57         ///
58         void RestoreButton();
59
60         /** Allow the view to access the ButtonController. This method must be
61             instantiated in a daughter class that creates the actual instance
62             of the ButtonController. */
63         virtual ButtonControllerBase & bc() = 0;
64
65 protected:
66         /// Get changed parameters and Dispatch them to the kernel.
67         virtual void apply() = 0;
68         /// Disconnect signals and hide View.
69         virtual void hide() = 0;
70         /// Update dialog before showing it.
71         virtual void update() = 0;
72
73         /** Allow the Controller to access the View. This method must be
74             instantiated in a daughter class that creates the actual instance
75             of the View. */
76         virtual ViewBase & view() = 0;
77 };
78
79 #include "ViewBase.h"
80
81 #endif // CONTROLBUTTONS_H