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 <leeming@lyx.org>
12 #ifndef FORM_MATHSPANEL_H
13 #define FORM_MATHSPANEL_H
15 #include "commandtags.h"
21 /// values used by the xforms callbacks
22 enum MathsCallbackValues {
49 #include "FormBaseDeprecated.h"
51 #include <boost/scoped_ptr.hpp>
53 class FormMathsBitmap;
56 class FormMathsMatrix;
60 struct FD_maths_panel;
63 * This class provides an XForms implementation of the maths panel.
65 class FormMathsPanel : public FormBaseBD {
68 FormMathsPanel(LyXView &, Dialogs &);
70 void setActive(FormMathsSub *) const;
71 /// dispatch a symbol insert
72 void insertSymbol(string const & sym, bool bs = true) const;
74 void dispatchFunc(kb_action action) const;
76 /// Pointer to the actual instantiation of the ButtonController.
77 virtual xformsBC & bc();
82 virtual bool input(FL_OBJECT *, long);
84 /// Pointer to the actual instantiation of the xforms form
85 virtual FL_FORM * form() const;
87 // Real GUI implementation
88 boost::scoped_ptr<FD_maths_panel> dialog_;
90 /// send LFUN_MATH_DISPLAY
91 void mathDisplay() const;
94 boost::scoped_ptr<FormMathsDeco> deco_;
95 boost::scoped_ptr<FormMathsDelim> delim_;
96 boost::scoped_ptr<FormMathsMatrix> matrix_;
97 boost::scoped_ptr<FormMathsSpace> space_;
98 boost::scoped_ptr<FormMathsStyle> style_;
99 boost::scoped_ptr<FormMathsBitmap> arrow_;
100 boost::scoped_ptr<FormMathsBitmap> boperator_;
101 boost::scoped_ptr<FormMathsBitmap> brelats_;
102 boost::scoped_ptr<FormMathsBitmap> greek_;
103 boost::scoped_ptr<FormMathsBitmap> misc_;
104 boost::scoped_ptr<FormMathsBitmap> dots_;
105 boost::scoped_ptr<FormMathsBitmap> varsize_;
106 boost::scoped_ptr<FormMathsBitmap> ams_misc_;
107 boost::scoped_ptr<FormMathsBitmap> ams_arrows_;
108 boost::scoped_ptr<FormMathsBitmap> ams_rel_;
109 boost::scoped_ptr<FormMathsBitmap> ams_nrel_;
110 boost::scoped_ptr<FormMathsBitmap> ams_ops_;
112 /// A pointer to the currently active subdialog
113 mutable FormMathsSub * active_;
115 /// The ButtonController
116 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
120 class FormMathsSub : public FormBaseBD {
121 friend class FormMathsPanel; // has subdialogs to manipulate
125 FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &,
126 string const &, bool allowResize = true);
129 /// Pointer to the actual instantiation of the ButtonController.
130 virtual xformsBC & bc();
131 /// The parent Maths Panel
132 FormMathsPanel const & parent_;
135 virtual void connect();
137 virtual void disconnect();
138 /// The ButtonController
139 ButtonController<IgnorantPolicy, xformsBC> bc_;
144 xformsBC & FormMathsSub::bc()
150 xformsBC & FormMathsPanel::bc()
154 #endif // FORM_MATHSPANEL_H