2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000-2001 The LyX Team.
9 * ======================================================
12 #ifndef FORMBASEDEPRECATED_H
13 #define FORMBASEDEPRECATED_H
15 #include FORMS_H_LOCATION
16 #include <sigc++/signal_system.h>
22 #include "DialogBase.h"
25 #include "FeedbackController.h"
32 /** This class is an XForms GUI base class.
33 It is meant to be used solely as the parent class to FormBaseBI
35 It has now been superceeded by the Controller/View split.
36 See FormBase.[Ch] for the way to go!
40 class FormBaseDeprecated : public DialogBase, public FeedbackController
44 FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
46 virtual ~FormBaseDeprecated();
48 /// Callback functions
57 void InputCB(FL_OBJECT *, long);
61 Tooltips & tooltips();
65 /// Pointer to the actual instantiation of the ButtonController.
66 virtual xformsBC & bc() = 0;
68 /** Redraw the form (on receipt of a Signal indicating, for example,
69 that the xform colors have been re-mapped).
70 Must be virtual because dialogs with tabbed folders will need to
71 redraw the form for each tab.
73 virtual void redraw();
75 /// Create the dialog if necessary, update it and display it.
79 /// Update the dialog.
80 virtual void update() {}
81 /// Connect signals. Also perform any necessary initialisation.
82 virtual void connect();
83 /// Disconnect signals. Also perform any necessary housekeeping.
84 virtual void disconnect();
86 virtual void build() = 0;
87 /** Filter the inputs on callback from xforms
88 Return true if inputs are valid.
90 virtual bool input( FL_OBJECT *, long) {
93 /// Apply from dialog (modify or create inset)
94 virtual void apply() {}
100 /// Cancel from dialog
101 virtual void cancel() {
104 /// Restore from dialog
105 virtual void restore() {
108 /// Pointer to the actual instantiation of xform's form
109 virtual FL_FORM * form() const = 0;
111 /** Prepare the way to:
112 1. display feedback as the mouse moves over ob. This feedback will
113 typically be rather more verbose than just a tooltip.
114 2. activate the button controller after a paste with the middle
117 static void setPrehandler(FL_OBJECT * ob);
119 /** Which LyXFunc do we use?
120 We could modify Dialogs to have a visible LyXFunc* instead and
121 save a couple of bytes per dialog.
124 /// Used so we can get at the signals we have to connect to.
128 /// Redraw connection.
130 /// dialog title, displayed by WM.
134 /// The dialog's minimum allowable dimensions.
138 /// Can the dialog be resized after it has been created?
141 Tooltips * tooltips_;
145 /** This class is an XForms GUI base class for Buffer Independent dialogs.
146 Such dialogs do not require an update Connection although they may use
147 an update() function which is also supported by restore().
149 class FormBaseBI : public FormBaseDeprecated {
152 FormBaseBI(LyXView *, Dialogs *, string const &, 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 &, bool allowResize=true);
167 virtual void connect();
168 /// Disconnect signals
169 virtual void disconnect();
170 /// bool indicates if a buffer switch took place
171 virtual void updateSlot(bool) { update(); }
173 /// Update connection.
178 #endif // FORMBASEDEPRECATED_H