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
34 class FormBase : public DialogBase, public noncopyable {
37 enum BufferDependency {
45 FormBase(LyXView *, Dialogs *, BufferDependency, string const &);
47 /// Callback functions
48 static int WMHideCB(FL_FORM *, void *);
50 static void ApplyCB(FL_OBJECT *, long);
52 static void ApplyHideCB(FL_OBJECT *, long);
54 static void HideCB(FL_OBJECT *, long);
56 static void InputCB(FL_OBJECT *, long);
59 /// Create the dialog if necessary, update it and display it.
64 virtual void connect();
65 /// Disconnect signals
66 virtual void disconnect();
68 virtual void build() = 0;
69 /// Filter the inputs on callback from xforms
70 virtual void input( long ) {}
71 /// Update dialog before showing it
72 virtual void update() {}
73 /// Apply from dialog (modify or create inset)
74 virtual void apply() {}
75 /// delete derived class variables when hide()ing
76 virtual void clearStore() {}
77 /// Pointer to the actual instantiation of xform's form
78 virtual FL_FORM * const form() const = 0;
80 /// block opening of form twice at the same time
82 /** Which LyXFunc do we use?
83 We could modify Dialogs to have a visible LyXFunc* instead and
84 save a couple of bytes per dialog.
90 Signal0<void> * hSignal_;
92 Signal0<void> * uSignal_;
93 /// Update connection.
97 /// dialog title, displayed by WM.