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 "commandtags.h"
16 #include <boost/smart_ptr.hpp>
22 #include "FormBaseDeprecated.h"
24 class FormMathsBitmap;
27 class FormMathsMatrix;
31 struct FD_form_maths_panel;
33 /// values used by the xforms callbacks
34 enum MathsCallbackValues {
62 * This class provides an XForms implementation of the maths panel.
64 class FormMathsPanel : public FormBaseBD {
67 FormMathsPanel(LyXView *, Dialogs *);
69 void setActive(FormMathsSub *) const;
70 /// dispatch a symbol insert
71 void insertSymbol(string const & sym, bool bs = true) const;
73 void dispatchFunc(kb_action action) const;
75 /// Pointer to the actual instantiation of the ButtonController.
76 virtual xformsBC & bc();
81 virtual bool input(FL_OBJECT *, long);
83 /// Pointer to the actual instantiation of the xforms form
84 virtual FL_FORM * form() const;
87 FD_form_maths_panel * build_maths_panel();
89 /// send LFUN_MATH_DISPLAY
90 void mathDisplay() const;
92 // Real GUI implementation
93 boost::scoped_ptr<FD_form_maths_panel> dialog_;
96 boost::scoped_ptr<FormMathsDeco> deco_;
97 boost::scoped_ptr<FormMathsDelim> delim_;
98 boost::scoped_ptr<FormMathsMatrix> matrix_;
99 boost::scoped_ptr<FormMathsSpace> space_;
100 boost::scoped_ptr<FormMathsStyle> style_;
101 boost::scoped_ptr<FormMathsBitmap> arrow_;
102 boost::scoped_ptr<FormMathsBitmap> boperator_;
103 boost::scoped_ptr<FormMathsBitmap> brelats_;
104 boost::scoped_ptr<FormMathsBitmap> greek_;
105 boost::scoped_ptr<FormMathsBitmap> misc_;
106 boost::scoped_ptr<FormMathsBitmap> dots_;
107 boost::scoped_ptr<FormMathsBitmap> varsize_;
108 boost::scoped_ptr<FormMathsBitmap> ams_misc_;
109 boost::scoped_ptr<FormMathsBitmap> ams_arrows_;
110 boost::scoped_ptr<FormMathsBitmap> ams_rel_;
111 boost::scoped_ptr<FormMathsBitmap> ams_nrel_;
112 boost::scoped_ptr<FormMathsBitmap> ams_ops_;
114 /// A pointer to the currently active subdialog
115 mutable FormMathsSub * active_;
117 /// The ButtonController
118 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
122 class FormMathsSub : public FormBaseBD {
123 friend class FormMathsPanel; // has subdialogs to manipulate
127 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
128 string const &, bool allowResize=true);
131 /// Pointer to the actual instantiation of the ButtonController.
132 virtual xformsBC & bc();
133 /// The parent Maths Panel
134 FormMathsPanel const & parent_;
137 virtual void connect();
139 virtual void disconnect();
140 /// The ButtonController
141 ButtonController<IgnorantPolicy, xformsBC> bc_;
146 xformsBC & FormMathsSub::bc()
152 xformsBC & FormMathsPanel::bc()
156 #endif // FORM_MATHSPANEL_H