3 * \file FormMathsPanel.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
9 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS
14 #ifndef FORM_MATHSPANEL_H
15 #define FORM_MATHSPANEL_H
17 #include "commandtags.h"
23 #include "FormBaseDeprecated.h"
25 #include <boost/shared_ptr.hpp>
28 class FormMathsBitmap;
30 struct FD_maths_panel;
33 * This class provides an XForms implementation of the maths panel.
35 class FormMathsPanel : public FormBaseBD {
38 FormMathsPanel(LyXView &, Dialogs &);
40 void dispatchFunc(kb_action action,
41 string const & arg = string()) const;
42 /// dispatch a symbol insert
43 void insertSymbol(string const & sym, bool bs = true) const;
46 /// Pointer to the actual instantiation of the ButtonController.
47 virtual xformsBC & bc();
52 virtual bool input(FL_OBJECT *, long);
54 /// Pointer to the actual instantiation of the xforms form
55 virtual FL_FORM * form() const;
57 // Real GUI implementation
58 boost::scoped_ptr<FD_maths_panel> dialog_;
60 /** Add a bitmap dialog to the store of all daughters_ and
61 * return a pointer to the dialog, so that bitmaps can be added to it.
63 FormMathsBitmap * addDaughter(FL_OBJECT * button, string const & title,
64 char const * const * data, int size);
67 void showDaughter(FL_OBJECT *);
70 typedef boost::shared_ptr<FormMathsSub> DaughterDialog;
71 typedef std::map<FL_OBJECT *, DaughterDialog> Store;
73 /** The store of all daughter dialogs.
74 * The map uses the button on the main panel to identify them.
78 /// A pointer to the currently active daughter dialog.
79 FormMathsSub * active_;
81 /// The ButtonController.
82 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
86 class FormMathsSub : public FormBaseBD {
89 FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &,
90 string const &, bool allowResize = true);
93 bool isVisible() const;
96 /// Pointer to the actual instantiation of the ButtonController.
97 virtual xformsBC & bc();
98 /// The parent Maths Panel
99 FormMathsPanel const & parent_;
101 /// The ButtonController
102 ButtonController<IgnorantPolicy, xformsBC> bc_;
107 xformsBC & FormMathsSub::bc()
113 xformsBC & FormMathsPanel::bc()
117 #endif // FORM_MATHSPANEL_H