2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
12 #ifndef FORMBASEDEPRECATED_H
13 #define FORMBASEDEPRECATED_H
15 #include "DialogBase.h"
17 #include FORMS_H_LOCATION
18 #include <sigc++/signal_system.h>
29 /** This class is an XForms GUI base class.
30 It is meant to be used solely as the parent class to FormBaseBI
32 It has now been superceeded by the Controller/View split.
33 See FormBase.[Ch] for the way to go!
37 class FormBaseDeprecated : public DialogBase {
39 /// Callback functions
40 static int WMHideCB(FL_FORM *, void *);
42 static void ApplyCB(FL_OBJECT *, long);
44 static void OKCB(FL_OBJECT *, long);
46 static void CancelCB(FL_OBJECT *, long);
48 static void InputCB(FL_OBJECT *, long);
50 static void RestoreCB(FL_OBJECT *, long);
54 FormBaseDeprecated(LyXView *, Dialogs *, string const &);
56 virtual ~FormBaseDeprecated() {}
58 /// Pointer to the actual instantiation of the ButtonController.
59 virtual xformsBC & bc() = 0;
61 /** Redraw the form (on receipt of a Signal indicating, for example,
62 that the xform colors have been re-mapped).
63 Must be virtual because dialogs with tabbed folders will need to
64 redraw the form for each tab.
66 virtual void redraw();
68 /// Create the dialog if necessary, update it and display it.
72 /// Update the dialog.
73 virtual void update() {}
74 /// Connect signals. Also perform any necessary initialisation.
75 virtual void connect();
76 /// Disconnect signals. Also perform any necessary housekeeping.
77 virtual void disconnect();
79 virtual void build() = 0;
80 /** Filter the inputs on callback from xforms
81 Return true if inputs are valid.
83 virtual bool input( FL_OBJECT *, long) {
86 /// Apply from dialog (modify or create inset)
87 virtual void apply() {}
93 /// Cancel from dialog
94 virtual void cancel() {
97 /// Restore from dialog
98 virtual void restore() {
101 /// Pointer to the actual instantiation of xform's form
102 virtual FL_FORM * form() const = 0;
104 /** Which LyXFunc do we use?
105 We could modify Dialogs to have a visible LyXFunc* instead and
106 save a couple of bytes per dialog.
109 /// Used so we can get at the signals we have to connect to.
113 /// Redraw connection.
115 /// dialog title, displayed by WM.
118 /// Overcome a dumb xforms sizing bug
125 /** This class is an XForms GUI base class for Buffer Independent dialogs.
126 Such dialogs do not require an update Connection although they may use
127 an update() function which is also supported by restore().
129 class FormBaseBI : public FormBaseDeprecated {
132 FormBaseBI(LyXView *, Dialogs *, string const &);
135 virtual void connect();
139 /** This class is an XForms GUI base class for Buffer Dependent dialogs
141 class FormBaseBD : public FormBaseDeprecated {
144 FormBaseBD(LyXView *, Dialogs *, string const &);
147 virtual void connect();
148 /// Disconnect signals
149 virtual void disconnect();
150 /// bool indicates if a buffer switch took place
151 virtual void updateSlot(bool) { update(); }
153 /// Update connection.
158 #endif // FORMBASEDEPRECATED_H