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"
21 #include "FormBaseDeprecated.h"
22 #include "MathsSymbols.h"
24 #include <boost/scoped_ptr.hpp>
26 class FormMathsBitmap;
29 class FormMathsMatrix;
33 struct FD_maths_panel;
36 * This class provides an XForms implementation of the maths panel.
38 class FormMathsPanel : public FormBaseBD {
40 friend void gui_ShowMathPanel(LyXView &, Dialogs &);
42 FormMathsPanel(LyXView *, Dialogs *);
44 void setActive(FormMathsSub *) const;
45 /// dispatch a symbol insert
46 void insertSymbol(string const & sym, bool bs = true) const;
48 void dispatchFunc(kb_action action) const;
50 /// Pointer to the actual instantiation of the ButtonController.
51 virtual xformsBC & bc();
56 virtual bool input(FL_OBJECT *, long);
58 /// Pointer to the actual instantiation of the xforms form
59 virtual FL_FORM * form() const;
61 // Real GUI implementation
62 boost::scoped_ptr<FD_maths_panel> dialog_;
64 /// send LFUN_MATH_DISPLAY
65 void mathDisplay() const;
68 boost::scoped_ptr<FormMathsDeco> deco_;
69 boost::scoped_ptr<FormMathsDelim> delim_;
70 boost::scoped_ptr<FormMathsMatrix> matrix_;
71 boost::scoped_ptr<FormMathsSpace> space_;
72 boost::scoped_ptr<FormMathsStyle> style_;
73 boost::scoped_ptr<FormMathsBitmap> arrow_;
74 boost::scoped_ptr<FormMathsBitmap> boperator_;
75 boost::scoped_ptr<FormMathsBitmap> brelats_;
76 boost::scoped_ptr<FormMathsBitmap> greek_;
77 boost::scoped_ptr<FormMathsBitmap> misc_;
78 boost::scoped_ptr<FormMathsBitmap> dots_;
79 boost::scoped_ptr<FormMathsBitmap> varsize_;
80 boost::scoped_ptr<FormMathsBitmap> ams_misc_;
81 boost::scoped_ptr<FormMathsBitmap> ams_arrows_;
82 boost::scoped_ptr<FormMathsBitmap> ams_rel_;
83 boost::scoped_ptr<FormMathsBitmap> ams_nrel_;
84 boost::scoped_ptr<FormMathsBitmap> ams_ops_;
86 /// A pointer to the currently active subdialog
87 mutable FormMathsSub * active_;
89 /// The ButtonController
90 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
94 class FormMathsSub : public FormBaseBD {
95 friend class FormMathsPanel; // has subdialogs to manipulate
99 FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
100 string const &, bool allowResize = true);
103 /// Pointer to the actual instantiation of the ButtonController.
104 virtual xformsBC & bc();
105 /// The parent Maths Panel
106 FormMathsPanel const & parent_;
109 virtual void connect();
111 virtual void disconnect();
112 /// The ButtonController
113 ButtonController<IgnorantPolicy, xformsBC> bc_;
118 xformsBC & FormMathsSub::bc()
124 xformsBC & FormMathsPanel::bc()
128 #endif // FORM_MATHSPANEL_H