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 {
57 * This class provides an XForms implementation of the maths panel.
59 class FormMathsPanel : public FormBaseBD {
62 FormMathsPanel(LyXView *, Dialogs *);
64 void setActive(FormMathsSub *) const;
65 /// dispatch a symbol insert
66 void insertSymbol(string const & sym) const;
68 void dispatchFunc(kb_action action) const;
70 /// Pointer to the actual instantiation of the ButtonController.
71 virtual xformsBC & bc();
76 virtual bool input(FL_OBJECT *, long);
78 /// Pointer to the actual instantiation of the xforms form
79 virtual FL_FORM * form() const;
82 FD_form_maths_panel * build_maths_panel();
84 /// send LFUN_MATH_DISPLAY
85 void mathDisplay() const;
87 // Real GUI implementation
88 boost::scoped_ptr<FD_form_maths_panel> dialog_;
91 boost::scoped_ptr<FormMathsDeco> deco_;
92 boost::scoped_ptr<FormMathsDelim> delim_;
93 boost::scoped_ptr<FormMathsMatrix> matrix_;
94 boost::scoped_ptr<FormMathsSpace> space_;
95 boost::scoped_ptr<FormMathsStyle> style_;
96 boost::scoped_ptr<FormMathsBitmap> arrow_;
97 boost::scoped_ptr<FormMathsBitmap> boperator_;
98 boost::scoped_ptr<FormMathsBitmap> brelats_;
99 boost::scoped_ptr<FormMathsBitmap> greek_;
100 boost::scoped_ptr<FormMathsBitmap> misc_;
101 boost::scoped_ptr<FormMathsBitmap> dots_;
102 boost::scoped_ptr<FormMathsBitmap> varsize_;
104 /// A pointer to the currently active subdialog
105 mutable FormMathsSub * active_;
107 /// The ButtonController
108 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
112 class FormMathsSub : public FormBaseBD {
113 friend class FormMathsPanel; // has subdialogs to manipulate
117 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
118 string const &, bool allowResize=true);
121 /// Pointer to the actual instantiation of the ButtonController.
122 virtual xformsBC & bc();
123 /// The parent Maths Panel
124 FormMathsPanel const & parent_;
127 virtual void connect();
129 virtual void disconnect();
130 /// The ButtonController
131 ButtonController<IgnorantPolicy, xformsBC> bc_;
136 xformsBC & FormMathsSub::bc()
142 xformsBC & FormMathsPanel::bc()
146 #endif // FORM_MATHSPANEL_H