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 FORMS_H_LOCATION
16 #include <sigc++/signal_system.h>
22 #include "DialogBase.h"
30 /** This class is an XForms GUI base class.
31 It is meant to be used solely as the parent class to FormBaseBI
33 It has now been superceeded by the Controller/View split.
34 See FormBase.[Ch] for the way to go!
38 extern "C" int C_FormBaseDeprecatedWMHideCB(FL_FORM *, void *);
40 class FormBaseDeprecated : public DialogBase {
42 /// Callback functions
43 static int WMHideCB(FL_FORM *, void *);
45 static void ApplyCB(FL_OBJECT *, long);
47 static void OKCB(FL_OBJECT *, long);
49 static void CancelCB(FL_OBJECT *, long);
51 static void InputCB(FL_OBJECT *, long);
53 static void RestoreCB(FL_OBJECT *, long);
57 FormBaseDeprecated(LyXView *, Dialogs *, string const &);
59 virtual ~FormBaseDeprecated() {}
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 /** Which LyXFunc do we use?
108 We could modify Dialogs to have a visible LyXFunc* instead and
109 save a couple of bytes per dialog.
112 /// Used so we can get at the signals we have to connect to.
116 /// Redraw connection.
118 /// dialog title, displayed by WM.
121 /// Overcome a dumb xforms sizing bug
128 /** This class is an XForms GUI base class for Buffer Independent dialogs.
129 Such dialogs do not require an update Connection although they may use
130 an update() function which is also supported by restore().
132 class FormBaseBI : public FormBaseDeprecated {
135 FormBaseBI(LyXView *, Dialogs *, string const &);
138 virtual void connect();
142 /** This class is an XForms GUI base class for Buffer Dependent dialogs
144 class FormBaseBD : public FormBaseDeprecated {
147 FormBaseBD(LyXView *, Dialogs *, string const &);
150 virtual void connect();
151 /// Disconnect signals
152 virtual void disconnect();
153 /// bool indicates if a buffer switch took place
154 virtual void updateSlot(bool) { update(); }
156 /// Update connection.
161 #endif // FORMBASEDEPRECATED_H