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;
30 struct FD_form_maths_panel;
32 /// values used by the xforms callbacks
33 enum MathsCallbackValues {
56 * This class provides an XForms implementation of the maths panel.
58 class FormMathsPanel : public FormBaseBD {
61 FormMathsPanel(LyXView *, Dialogs *);
63 void setActive(FormMathsSub *) const;
64 /// dispatch a symbol insert
65 void insertSymbol(string const & sym) const;
67 void dispatchFunc(string const & funcode) const;
69 /// Pointer to the actual instantiation of the ButtonController.
70 virtual xformsBC & bc();
75 virtual bool input(FL_OBJECT *, long);
77 /// Pointer to the actual instantiation of the xforms form
78 virtual FL_FORM * form() const;
81 FD_form_maths_panel * build_maths_panel();
83 /// send LFUN_MATH_DISPLAY
84 void mathDisplay() const;
86 // Real GUI implementation
87 boost::scoped_ptr<FD_form_maths_panel> dialog_;
90 boost::scoped_ptr<FormMathsDeco> deco_;
91 boost::scoped_ptr<FormMathsDelim> delim_;
92 boost::scoped_ptr<FormMathsMatrix> matrix_;
93 boost::scoped_ptr<FormMathsSpace> space_;
94 boost::scoped_ptr<FormMathsStyle> style_;
95 boost::scoped_ptr<FormMathsBitmap> arrow_;
96 boost::scoped_ptr<FormMathsBitmap> boperator_;
97 boost::scoped_ptr<FormMathsBitmap> brelats_;
98 boost::scoped_ptr<FormMathsBitmap> greek_;
99 boost::scoped_ptr<FormMathsBitmap> misc_;
100 boost::scoped_ptr<FormMathsBitmap> dots_;
101 boost::scoped_ptr<FormMathsBitmap> varsize_;
103 /// A pointer to the currently active subdialog
104 mutable FormMathsSub * active_;
106 /// The ButtonController
107 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
111 class FormMathsSub : public FormBaseBD {
112 friend class FormMathsPanel; // has subdialogs to manipulate
116 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
117 string const &, bool allowResize=true);
120 /// Pointer to the actual instantiation of the ButtonController.
121 virtual xformsBC & bc();
122 /// The parent Maths Panel
123 FormMathsPanel const & parent_;
126 virtual void connect();
128 virtual void disconnect();
129 /// The ButtonController
130 ButtonController<IgnorantPolicy, xformsBC> bc_;
135 xformsBC & FormMathsSub::bc()
141 xformsBC & FormMathsPanel::bc()
145 #endif // FORM_MATHSPANEL_H