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 /** This class is an XForms GUI base class
29 class FormBase : public DialogBase, public noncopyable {
32 FormBase(LyXView *, Dialogs *, string const &);
34 /// Callback functions
35 static int WMHideCB(FL_FORM *, void *);
37 static void ApplyCB(FL_OBJECT *, long);
39 static void CancelCB(FL_OBJECT *, long);
41 static void InputCB(FL_OBJECT *, long);
43 static void OKCB(FL_OBJECT *, long);
46 /// Create the dialog if necessary, update it and display it.
52 virtual void build() = 0;
53 /// Filter the inputs on callback from xforms
54 virtual void input( long ) {}
55 /// Update dialog before showing it
56 virtual void update() {}
57 /// Apply from dialog (modify or create inset)
58 virtual void apply() {}
59 /// delete derived class variables when hide()ing
60 virtual void clearStore() {}
61 /// Pointer to the actual instantiation of xform's form
62 virtual FL_FORM * const form() const = 0;
64 /** Which LyXFunc do we use?
65 We could modify Dialogs to have a visible LyXFunc* instead and
66 save a couple of bytes per dialog.
69 /** Which Dialogs do we belong to?
70 Used so we can get at the signals we have to connect to.
74 /// Update connection.
78 /// dialog title, displayed by WM.
82 /// block opening of form twice at the same time