2 * \file FormMathsPanel.h
3 * Copyright 2001 The LyX Team.
4 * See the file COPYING.
6 * \author Alejandro Aguilar Sierra
7 * \author John Levon, moz@compsoc.man.ac.uk
8 * \author Angus Leeming, a.leeming@ic.ac.uk
11 #ifndef FORM_MATHSPANEL_H
12 #define FORM_MATHSPANEL_H
14 #include <boost/smart_ptr.hpp>
20 #include "FormBaseDeprecated.h"
22 class FormMathsBitmap;
25 class FormMathsMatrix;
28 struct FD_form_maths_panel;
30 /// values used by the xforms callbacks
31 enum MathsCallbackValues {
50 * This class provides an XForms implementation of the maths panel.
52 class FormMathsPanel : public FormBaseBD {
55 FormMathsPanel(LyXView *, Dialogs *);
57 void setActive(FormMathsSub *) const;
58 /// dispatch a symbol insert
59 void insertSymbol(string const & sym) const;
62 /// Pointer to the actual instantiation of the ButtonController.
63 virtual xformsBC & bc();
68 virtual bool input(FL_OBJECT *, long);
70 /// Pointer to the actual instantiation of the xforms form
71 virtual FL_FORM * form() const;
74 FD_form_maths_panel * build_maths_panel();
76 /// send LFUN_MATH_DISPLAY
77 void mathDisplay() const;
79 // Real GUI implementation
80 boost::scoped_ptr<FD_form_maths_panel> dialog_;
83 boost::scoped_ptr<FormMathsDeco> deco_;
84 boost::scoped_ptr<FormMathsDelim> delim_;
85 boost::scoped_ptr<FormMathsMatrix> matrix_;
86 boost::scoped_ptr<FormMathsSpace> space_;
87 boost::scoped_ptr<FormMathsBitmap> arrow_;
88 boost::scoped_ptr<FormMathsBitmap> boperator_;
89 boost::scoped_ptr<FormMathsBitmap> brelats_;
90 boost::scoped_ptr<FormMathsBitmap> greek_;
91 boost::scoped_ptr<FormMathsBitmap> misc_;
92 boost::scoped_ptr<FormMathsBitmap> varsize_;
94 /// A pointer to the currently active subdialog
95 mutable FormMathsSub * active_;
97 /// The ButtonController
98 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
102 class FormMathsSub : public FormBaseBD {
103 friend class FormMathsPanel; // has subdialogs to manipulate
107 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
111 /// Pointer to the actual instantiation of the ButtonController.
112 virtual xformsBC & bc();
113 /// The parent Maths Panel
114 FormMathsPanel const & parent_;
117 virtual void connect();
119 virtual void disconnect();
120 /// The ButtonController
121 ButtonController<OkApplyCancelReadOnlyPolicy, xformsBC> bc_;
126 xformsBC & FormMathsSub::bc()
132 xformsBC & FormMathsPanel::bc()
136 #endif // FORM_MATHSPANEL_H