2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
14 * The Controller connects the GUI-dependent popup to any appropriate
15 * signals and dispatches any changes to the kernel.
16 * It has no knowledge of the actual instantiation of the
17 * GUI-dependent View and ButtonController, which should therefore
18 * be created elsewhere.
19 * Once created, the Controller will take care of their initialisation,
20 * management and, ultimately, destruction.
30 #include "DialogBase.h" // This can go eventually
32 class ButtonControllerBase;
37 /** Abstract base class for Controllers with a ButtonController.
39 class ControlBase : public DialogBase
43 ControlBase(LyXView & lv) : lv_(lv) {}
45 virtual ~ControlBase() {};
47 /// These functions are called when the controlling buttons are pressed.
57 /// The View may need to know if the buffer is read-only.
58 bool isReadonly() const;
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;
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;
73 /** Allow the Controller to access the View. This method must be
74 instantiated in a daughter class that creates the actual instance
76 virtual ViewBase & view() = 0;
78 /// Get at the kernel Dispatch methods we need to apply() parameters.
83 #endif // CONTROLBASE_H