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_fwd.h"
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();
60 friend void gui_ShowDocument(LyXView &, Dialogs &);
64 /// Pointer to the actual instantiation of the ButtonController.
65 virtual xformsBC & bc() = 0;
67 /** Redraw the form (on receipt of a Signal indicating, for example,
68 * that the xform colors have been re-mapped).
69 * Must be virtual because dialogs with tabbed folders will need to
70 * redraw the form for each tab.
72 virtual void redraw();
74 /// Create the dialog if necessary, update it and display it.
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