3 * \file FormBaseDeprecated.h
4 * Copyright 2000-2002 the LyX Team
5 * Read the file COPYING
7 * \author Angus Leeming, a.leeming@ic.ac.uk
10 /* A base class for those remaining xforms dialogs that haven't yet undergone
11 * the controller-view split.
12 * It is meant to be used solely as the parent class to FormBaseBI
16 #ifndef FORMBASEDEPRECATED_H
17 #define FORMBASEDEPRECATED_H
23 #include "DialogBase.h"
26 #include "FeedbackController.h"
28 #include FORMS_H_LOCATION
30 #include <boost/signals/trackable.hpp>
37 class FormBaseDeprecated : public DialogBase, public FeedbackController
41 FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
43 virtual ~FormBaseDeprecated();
45 /// Callback functions
54 void InputCB(FL_OBJECT *, long);
58 Tooltips & tooltips();
62 /// Pointer to the actual instantiation of the ButtonController.
63 virtual xformsBC & bc() = 0;
65 /** Redraw the form (on receipt of a Signal indicating, for example,
66 * that the xform colors have been re-mapped).
67 * Must be virtual because dialogs with tabbed folders will need to
68 * redraw the form for each tab.
70 virtual void redraw();
72 /// Create the dialog if necessary, update it and display it.
76 /// Update the dialog.
77 virtual void update() {}
78 /// Connect signals. Also perform any necessary initialisation.
79 virtual void connect();
80 /// Disconnect signals. Also perform any necessary housekeeping.
81 virtual void disconnect();
83 virtual void build() = 0;
84 /** Filter the inputs on callback from xforms
85 * Return true if inputs are valid.
87 virtual bool input( FL_OBJECT *, long) {
90 /// Apply from dialog (modify or create inset)
91 virtual void apply() {}
97 /// Cancel from dialog
98 virtual void cancel() {
101 /// Restore from dialog
102 virtual void restore() {
105 /// Pointer to the actual instantiation of xform's form
106 virtual FL_FORM * form() const = 0;
108 /** Prepare the way to:
109 * 1. display feedback as the mouse moves over ob. This feedback will
110 * typically be rather more verbose than just a tooltip.
111 * 2. activate the button controller after a paste with the middle
114 static void setPrehandler(FL_OBJECT * ob);
116 /** Which LyXFunc do we use?
117 * We could modify Dialogs to have a visible LyXFunc* instead and
118 * save a couple of bytes per dialog.
121 /// Used so we can get at the signals we have to connect to.
124 boost::signals::connection h_;
125 /// Redraw connection.
126 boost::signals::connection r_;
127 /// dialog title, displayed by WM.
131 /// The dialog's minimum allowable dimensions.
135 /// Can the dialog be resized after it has been created?
138 Tooltips * tooltips_;
142 /** This class is an XForms GUI base class for Buffer Independent dialogs.
143 * Such dialogs do not require an update Connection although they may use
144 * an update() function which is also supported by restore().
146 class FormBaseBI : public FormBaseDeprecated {
149 FormBaseBI(LyXView *, Dialogs *, string const &,
150 bool allowResize = true);
153 virtual void connect();
157 /** This class is an XForms GUI base class for Buffer Dependent dialogs
159 class FormBaseBD : public FormBaseDeprecated {
162 FormBaseBD(LyXView *, Dialogs *, string const &,
163 bool allowResize = true);
166 virtual void connect();
167 /// Disconnect signals
168 virtual void disconnect();
169 /// bool indicates if a buffer switch took place
170 virtual void updateSlot(bool) { update(); }
172 /// Update connection.
173 boost::signals::connection u_;
177 #endif // FORMBASEDEPRECATED_H