3 * \file FormBaseDeprecated.h
4 * Read the file COPYING
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
11 /* A base class for those remaining xforms dialogs that haven't yet undergone
12 * the controller-view split.
13 * It is meant to be used solely as the parent class to FormBaseBI
17 #ifndef FORMBASEDEPRECATED_H
18 #define FORMBASEDEPRECATED_H
26 #include "FeedbackController.h"
28 #include "forms_fwd.h"
30 #include <boost/utility.hpp>
31 #include <boost/signals/connection.hpp>
38 class FormBaseDeprecated : boost::noncopyable, public FeedbackController
42 FormBaseDeprecated(LyXView &, Dialogs &, string const &, bool);
44 virtual ~FormBaseDeprecated();
46 /// Callback functions
55 void InputCB(FL_OBJECT *, long);
59 Tooltips & tooltips();
61 /// Create the dialog if necessary, update it and display it.
66 /// Pointer to the actual instantiation of the ButtonController.
67 virtual xformsBC & bc() = 0;
69 /** Redraw the form (on receipt of a Signal indicating, for example,
70 * that the xform colors have been re-mapped).
71 * Must be virtual because dialogs with tabbed folders will need to
72 * redraw the form for each tab.
74 virtual void redraw();
78 /// Update the dialog.
79 virtual void update() {}
80 /// Connect signals. Also perform any necessary initialisation.
81 virtual void connect();
82 /// Disconnect signals. Also perform any necessary housekeeping.
83 virtual void disconnect();
85 virtual void build() = 0;
86 /** Filter the inputs on callback from xforms
87 * Return true if inputs are valid.
89 virtual bool input(FL_OBJECT *, long) {
92 /// Apply from dialog (modify or create inset)
93 virtual void apply() {}
99 /// Cancel from dialog
100 virtual void cancel() {
103 /// Restore from dialog
104 virtual void restore() {
107 /// Pointer to the actual instantiation of xform's form
108 virtual FL_FORM * form() const = 0;
110 /** Prepare the way to:
111 * 1. display feedback as the mouse moves over ob. This feedback will
112 * typically be rather more verbose than just a tooltip.
113 * 2. activate the button controller after a paste with the middle
116 static void setPrehandler(FL_OBJECT * ob);
118 /** Which LyXFunc do we use?
119 * We could modify Dialogs to have a visible LyXFunc* instead and
120 * save a couple of bytes per dialog.
123 /// Used so we can get at the signals we have to connect to.
126 boost::signals::connection h_;
127 /// Redraw connection.
128 boost::signals::connection r_;
129 /// dialog title, displayed by WM.
133 /// The dialog's minimum allowable dimensions.
137 /// Can the dialog be resized after it has been created?
140 Tooltips * tooltips_;
144 /** This class is an XForms GUI base class for Buffer Independent dialogs.
145 * Such dialogs do not require an update Connection although they may use
146 * an update() function which is also supported by restore().
148 class FormBaseBI : public FormBaseDeprecated {
151 FormBaseBI(LyXView &, Dialogs &, string const &,
152 bool allowResize = true);
155 virtual void connect();
159 /** This class is an XForms GUI base class for Buffer Dependent dialogs
161 class FormBaseBD : public FormBaseDeprecated {
164 FormBaseBD(LyXView &, Dialogs &, string const &,
165 bool allowResize = true);
168 virtual void connect();
169 /// Disconnect signals
170 virtual void disconnect();
171 /// bool indicates if a buffer switch took place
172 virtual void updateSlot(bool) { update(); }
174 /// Update connection.
175 boost::signals::connection u_;
179 #endif // FORMBASEDEPRECATED_H