3 * \file FormMathsPanel.h
4 * Copyright 2001 The LyX Team.
5 * See the file COPYING.
7 * \author Alejandro Aguilar Sierra
8 * \author John Levon, moz@compsoc.man.ac.uk
9 * \author Angus Leeming, a.leeming@ic.ac.uk
12 #ifndef FORM_MATHSPANEL_H
13 #define FORM_MATHSPANEL_H
15 #include <boost/smart_ptr.hpp>
21 #include "FormBaseDeprecated.h"
23 class FormMathsBitmap;
26 class FormMathsMatrix;
29 struct FD_form_maths_panel;
31 /// values used by the xforms callbacks
32 enum MathsCallbackValues {
51 * This class provides an XForms implementation of the maths panel.
53 class FormMathsPanel : public FormBaseBD {
56 FormMathsPanel(LyXView *, Dialogs *);
58 void setActive(FormMathsSub *) const;
59 /// dispatch a symbol insert
60 void insertSymbol(string const & sym) const;
63 /// Pointer to the actual instantiation of the ButtonController.
64 virtual xformsBC & bc();
69 virtual bool input(FL_OBJECT *, long);
71 /// Pointer to the actual instantiation of the xforms form
72 virtual FL_FORM * form() const;
75 FD_form_maths_panel * build_maths_panel();
77 /// send LFUN_MATH_DISPLAY
78 void mathDisplay() const;
80 // Real GUI implementation
81 boost::scoped_ptr<FD_form_maths_panel> dialog_;
84 boost::scoped_ptr<FormMathsDeco> deco_;
85 boost::scoped_ptr<FormMathsDelim> delim_;
86 boost::scoped_ptr<FormMathsMatrix> matrix_;
87 boost::scoped_ptr<FormMathsSpace> space_;
88 boost::scoped_ptr<FormMathsBitmap> arrow_;
89 boost::scoped_ptr<FormMathsBitmap> boperator_;
90 boost::scoped_ptr<FormMathsBitmap> brelats_;
91 boost::scoped_ptr<FormMathsBitmap> greek_;
92 boost::scoped_ptr<FormMathsBitmap> misc_;
93 boost::scoped_ptr<FormMathsBitmap> varsize_;
95 /// A pointer to the currently active subdialog
96 mutable FormMathsSub * active_;
98 /// The ButtonController
99 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
103 class FormMathsSub : public FormBaseBD {
104 friend class FormMathsPanel; // has subdialogs to manipulate
108 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
112 /// Pointer to the actual instantiation of the ButtonController.
113 virtual xformsBC & bc();
114 /// The parent Maths Panel
115 FormMathsPanel const & parent_;
118 virtual void connect();
120 virtual void disconnect();
121 /// The ButtonController
122 ButtonController<OkApplyCancelReadOnlyPolicy, xformsBC> bc_;
127 xformsBC & FormMathsSub::bc()
133 xformsBC & FormMathsPanel::bc()
137 #endif // FORM_MATHSPANEL_H