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
19 #include FORMS_H_LOCATION
20 #include <sigc++/signal_system.h>
26 #include "DialogBase.h"
29 #include "FeedbackController.h"
36 class FormBaseDeprecated : public DialogBase, public FeedbackController
40 FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
42 virtual ~FormBaseDeprecated();
44 /// Callback functions
53 void InputCB(FL_OBJECT *, long);
57 Tooltips & tooltips();
61 /// Pointer to the actual instantiation of the ButtonController.
62 virtual xformsBC & bc() = 0;
64 /** Redraw the form (on receipt of a Signal indicating, for example,
65 that the xform colors have been re-mapped).
66 Must be virtual because dialogs with tabbed folders will need to
67 redraw the form for each tab.
69 virtual void redraw();
71 /// Create the dialog if necessary, update it and display it.
75 /// Update the dialog.
76 virtual void update() {}
77 /// Connect signals. Also perform any necessary initialisation.
78 virtual void connect();
79 /// Disconnect signals. Also perform any necessary housekeeping.
80 virtual void disconnect();
82 virtual void build() = 0;
83 /** Filter the inputs on callback from xforms
84 Return true if inputs are valid.
86 virtual bool input( FL_OBJECT *, long) {
89 /// Apply from dialog (modify or create inset)
90 virtual void apply() {}
96 /// Cancel from dialog
97 virtual void cancel() {
100 /// Restore from dialog
101 virtual void restore() {
104 /// Pointer to the actual instantiation of xform's form
105 virtual FL_FORM * form() const = 0;
107 /** Prepare the way to:
108 1. display feedback as the mouse moves over ob. This feedback will
109 typically be rather more verbose than just a tooltip.
110 2. activate the button controller after a paste with the middle
113 static void setPrehandler(FL_OBJECT * ob);
115 /** Which LyXFunc do we use?
116 We could modify Dialogs to have a visible LyXFunc* instead and
117 save a couple of bytes per dialog.
120 /// Used so we can get at the signals we have to connect to.
124 /// Redraw connection.
126 /// dialog title, displayed by WM.
130 /// The dialog's minimum allowable dimensions.
134 /// Can the dialog be resized after it has been created?
137 Tooltips * tooltips_;
141 /** This class is an XForms GUI base class for Buffer Independent dialogs.
142 Such dialogs do not require an update Connection although they may use
143 an update() function which is also supported by restore().
145 class FormBaseBI : public FormBaseDeprecated {
148 FormBaseBI(LyXView *, Dialogs *, string const &, bool allowResize=true);
151 virtual void connect();
155 /** This class is an XForms GUI base class for Buffer Dependent dialogs
157 class FormBaseBD : public FormBaseDeprecated {
160 FormBaseBD(LyXView *, Dialogs *, string const &, bool allowResize=true);
163 virtual void connect();
164 /// Disconnect signals
165 virtual void disconnect();
166 /// bool indicates if a buffer switch took place
167 virtual void updateSlot(bool) { update(); }
169 /// Update connection.
174 #endif // FORMBASEDEPRECATED_H