]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsPanel.h
change some __GNUG_ to __GNUG__
[lyx.git] / src / frontends / xforms / FormMathsPanel.h
1 // -*- C++ -*-
2 /**
3  * \file FormMathsPanel.h
4  * Copyright 2001 The LyX Team.
5  * See the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author John Levon, moz@compsoc.man.ac.uk
9  * \author Angus Leeming, a.leeming@ic.ac.uk
10  */
11
12 #ifndef FORM_MATHSPANEL_H
13 #define FORM_MATHSPANEL_H
14
15 #include "commandtags.h"
16 #include <boost/smart_ptr.hpp>
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include "FormBaseDeprecated.h"
23 #include "MathsSymbols.h"
24
25 class FormMathsBitmap;
26 class FormMathsDeco;
27 class FormMathsDelim;
28 class FormMathsMatrix;
29 class FormMathsSpace;
30 class FormMathsStyle;
31 class FormMathsSub;
32 struct FD_form_maths_panel;
33
34 /**
35  * This class provides an XForms implementation of the maths panel.
36  */
37 class FormMathsPanel : public FormBaseBD {
38 public:
39         ///
40         FormMathsPanel(LyXView *, Dialogs *);
41         ///
42         void setActive(FormMathsSub *) const;
43         /// dispatch a symbol insert
44         void insertSymbol(string const & sym, bool bs = true) const;
45         /// dispatch an LFUN:
46         void dispatchFunc(kb_action action) const;
47 private:
48         /// Pointer to the actual instantiation of the ButtonController.
49         virtual xformsBC & bc();
50
51         /// Build the dialog
52         virtual void build();
53         /// input handler
54         virtual bool input(FL_OBJECT *, long);
55
56         /// Pointer to the actual instantiation of the xforms form
57         virtual FL_FORM * form() const;
58
59         // build the panels
60         FD_form_maths_panel * build_maths_panel();
61
62         /// send LFUN_MATH_DISPLAY
63         void mathDisplay() const;
64
65         // Real GUI implementation
66         boost::scoped_ptr<FD_form_maths_panel> dialog_;
67
68         /// Subdialogs
69         boost::scoped_ptr<FormMathsDeco>   deco_;
70         boost::scoped_ptr<FormMathsDelim>  delim_;
71         boost::scoped_ptr<FormMathsMatrix> matrix_;
72         boost::scoped_ptr<FormMathsSpace>  space_;
73         boost::scoped_ptr<FormMathsStyle>  style_;
74         boost::scoped_ptr<FormMathsBitmap> arrow_;
75         boost::scoped_ptr<FormMathsBitmap> boperator_;
76         boost::scoped_ptr<FormMathsBitmap> brelats_;
77         boost::scoped_ptr<FormMathsBitmap> greek_;
78         boost::scoped_ptr<FormMathsBitmap> misc_;
79         boost::scoped_ptr<FormMathsBitmap> dots_;
80         boost::scoped_ptr<FormMathsBitmap> varsize_;
81         boost::scoped_ptr<FormMathsBitmap> ams_misc_;
82         boost::scoped_ptr<FormMathsBitmap> ams_arrows_;
83         boost::scoped_ptr<FormMathsBitmap> ams_rel_;
84         boost::scoped_ptr<FormMathsBitmap> ams_nrel_;
85         boost::scoped_ptr<FormMathsBitmap> ams_ops_;
86
87         /// A pointer to the currently active subdialog
88         mutable FormMathsSub * active_;
89
90         /// The ButtonController
91         ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
92 };
93
94
95 class FormMathsSub : public FormBaseBD {
96         friend class FormMathsPanel; // has subdialogs to manipulate
97
98 public:
99         ///
100         FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
101                      string const &, bool allowResize=true);
102
103 protected:
104         /// Pointer to the actual instantiation of the ButtonController.
105         virtual xformsBC & bc();
106         /// The parent Maths Panel
107         FormMathsPanel const & parent_;
108 private:
109         ///
110         virtual void connect();
111         ///
112         virtual void disconnect();
113         /// The ButtonController
114         ButtonController<IgnorantPolicy, xformsBC> bc_;
115 };
116
117
118 inline
119 xformsBC & FormMathsSub::bc()
120 {
121         return bc_;
122 }
123
124 inline
125 xformsBC & FormMathsPanel::bc()
126 {
127         return bc_;
128 }
129 #endif //  FORM_MATHSPANEL_H