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"
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 class FormBaseDeprecated : public DialogBase {
40 /// Callback functions
41 static int WMHideCB(FL_FORM *, void *);
43 static void ApplyCB(FL_OBJECT *, long);
45 static void OKCB(FL_OBJECT *, long);
47 static void CancelCB(FL_OBJECT *, long);
49 static void InputCB(FL_OBJECT *, long);
51 static void RestoreCB(FL_OBJECT *, long);
55 FormBaseDeprecated(LyXView *, Dialogs *, string const &);
57 virtual ~FormBaseDeprecated() {}
59 /// Pointer to the actual instantiation of the ButtonController.
60 virtual xformsBC & bc() = 0;
62 /** Redraw the form (on receipt of a Signal indicating, for example,
63 that the xform colors have been re-mapped).
64 Must be virtual because dialogs with tabbed folders will need to
65 redraw the form for each tab.
67 virtual void redraw();
69 /// Create the dialog if necessary, update it and display it.
73 /// Update the dialog.
74 virtual void update() {}
75 /// Connect signals. Also perform any necessary initialisation.
76 virtual void connect();
77 /// Disconnect signals. Also perform any necessary housekeeping.
78 virtual void disconnect();
80 virtual void build() = 0;
81 /** Filter the inputs on callback from xforms
82 Return true if inputs are valid.
84 virtual bool input( FL_OBJECT *, long) {
87 /// Apply from dialog (modify or create inset)
88 virtual void apply() {}
94 /// Cancel from dialog
95 virtual void cancel() {
98 /// Restore from dialog
99 virtual void restore() {
102 /// Pointer to the actual instantiation of xform's form
103 virtual FL_FORM * form() const = 0;
105 /** Which LyXFunc do we use?
106 We could modify Dialogs to have a visible LyXFunc* instead and
107 save a couple of bytes per dialog.
110 /// Used so we can get at the signals we have to connect to.
114 /// Redraw connection.
116 /// dialog title, displayed by WM.
119 /// Overcome a dumb xforms sizing bug
126 /** This class is an XForms GUI base class for Buffer Independent dialogs.
127 Such dialogs do not require an update Connection although they may use
128 an update() function which is also supported by restore().
130 class FormBaseBI : public FormBaseDeprecated {
133 FormBaseBI(LyXView *, Dialogs *, string const &);
136 virtual void connect();
140 /** This class is an XForms GUI base class for Buffer Dependent dialogs
142 class FormBaseBD : public FormBaseDeprecated {
145 FormBaseBD(LyXView *, Dialogs *, string const &);
148 virtual void connect();
149 /// Disconnect signals
150 virtual void disconnect();
151 /// bool indicates if a buffer switch took place
152 virtual void updateSlot(bool) { update(); }
154 /// Update connection.
159 #endif // FORMBASEDEPRECATED_H