2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
15 #include "DialogBase.h"
17 #include "support/utility.hpp"
18 #include FORMS_H_LOCATION
27 #ifdef SIGC_CXX_NAMESPACES
31 /** This class is an XForms GUI base class
33 class FormBase : public DialogBase, public noncopyable {
36 enum BufferDependency {
44 FormBase(LyXView *, Dialogs *, BufferDependency, string const &);
46 /// Callback functions
47 static int WMHideCB(FL_FORM *, void *);
49 static void ApplyCB(FL_OBJECT *, long);
51 static void ApplyHideCB(FL_OBJECT *, long);
53 static void HideCB(FL_OBJECT *, long);
55 static void InputCB(FL_OBJECT *, long);
58 /// Create the dialog if necessary, update it and display it.
63 virtual void build() = 0;
64 /// Filter the inputs on callback from xforms
65 virtual void input( long ) {}
66 /// Update dialog before showing it
67 virtual void update() {}
68 /// Apply from dialog (modify or create inset)
69 virtual void apply() {}
70 /// delete derived class variables when hide()ing
71 virtual void clearStore() {}
72 /// Pointer to the actual instantiation of xform's form
73 virtual FL_FORM * const form() const = 0;
75 /// block opening of form twice at the same time
77 /** Which LyXFunc do we use?
78 We could modify Dialogs to have a visible LyXFunc* instead and
79 save a couple of bytes per dialog.
85 Signal0<void> * hSignal_;
87 Signal0<void> * uSignal_;
88 /// Update connection.
92 /// dialog title, displayed by WM.