]> git.lyx.org Git - lyx.git/blob - src/mathed/formulabase.h
Use dummy Buffer * parameters to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / formulabase.h
1 // -*- C++ -*-
2 /*
3  *  File:        formulabase.h
4  *  Purpose:     Common parts of the math LyX insets
5  *  Author:      André Pönitz
6  *  Created:     May 2001
7  *  Description: Allows the edition of math paragraphs inside Lyx. 
8  *
9  *  Copyright: 2001, The LyX Project
10  *
11  *   You are free to use and modify this code under the terms of
12  *   the GNU General Public Licence version 2 or later.
13  */
14
15 #ifndef INSET_FORMULABASE_H 
16 #define INSET_FORMULABASE_H
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include <iosfwd>
23 #include "insets/inset.h"
24
25 // only for getType():
26 #include "math_defs.h"
27
28 class Buffer;
29 class BufferView;
30 class MathInset;
31
32 ///
33 class InsetFormulaBase : public UpdatableInset {
34 public:
35         ///
36         InsetFormulaBase();
37         ///
38         virtual int ascent(BufferView *, LyXFont const &) const = 0;
39         ///
40         virtual int descent(BufferView *, LyXFont const &) const = 0;
41         ///
42         virtual int width(BufferView *, LyXFont const &) const = 0;
43         ///
44         virtual void draw(BufferView *,LyXFont const &, int, float &, bool) const = 0;
45         ///
46         virtual MathInsetTypes getType() const = 0;
47
48 public:
49         ///
50         virtual void validate(LaTeXFeatures &) const;
51         ///
52         virtual Inset * clone(Buffer const &, bool same_id = false) const = 0;
53         ///
54         virtual Inset::Code lyxCode() const;
55         /// what appears in the minibuffer when opening
56         virtual string const editMessage() const;
57         ///
58         virtual void edit(BufferView *, int x, int y, unsigned int button);
59         ///
60         virtual void edit(BufferView *, bool front = true);
61         ///
62         virtual void toggleInsetCursor(BufferView *);
63         ///
64         virtual void showInsetCursor(BufferView *, bool show = true);
65         ///
66         virtual void hideInsetCursor(BufferView *);
67         ///
68         virtual void getCursorPos(BufferView *, int &, int &) const;
69         ///
70         virtual void toggleInsetSelection(BufferView * bv);
71         ///
72         virtual void insetButtonPress(BufferView *, int x, int y, int button);
73         ///
74         virtual void insetButtonRelease(BufferView *, int x, int y, int button);
75         ///
76         virtual void insetKeyPress(XKeyEvent * ev);
77         ///
78         virtual void insetMotionNotify(BufferView *, int x, int y, int state);
79         ///
80         virtual void insetUnlock(BufferView *);
81    
82         /// To allow transparent use of math editing functions
83         virtual RESULT localDispatch(BufferView *, kb_action, string const &);
84     
85         ///
86         virtual std::vector<string> const getLabelList() const;
87         ///
88         virtual MathInset const * par() const = 0;
89         ///
90         virtual void metrics() const = 0;
91 protected:
92         ///
93         virtual void updateLocal(BufferView * bv, bool mark_dirty);
94 private:
95         /// unimplemented
96         void operator=(const InsetFormulaBase &);
97 };
98
99 // We don't really mess want around with mathed stuff outside mathed.
100 // So do it here.
101 //
102 void mathDispatchCreation(BufferView *, string const &, bool);
103 //
104 void mathDispatchMathDisplay(BufferView *, string const &);
105 //
106 void mathDispatchMathMode(BufferView *, string const &);
107 //
108 void mathDispatchMathMacro(BufferView *, string const &);
109 //
110 void mathDispatchMathDelim(BufferView *, string const &);
111 //
112 void mathDispatchInsertMath(BufferView *, string const &);
113 //
114 void mathDispatchInsertMatrix(BufferView *, string const &);
115 //
116 void mathDispatchGreek(BufferView *, string const &);
117 //
118 void mathDispatchMathImportSelection(BufferView *, string const &);
119
120 #endif