]> git.lyx.org Git - lyx.git/blob - src/mathed/formulabase.h
change a lot of methods to begin with small char
[lyx.git] / src / mathed / formulabase.h
1 // -*- C++ -*-
2 /*
3  *  File:        formula.h
4  *  Purpose:     Declaration of formula inset
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1996
7  *  Description: Allows the edition of math paragraphs inside Lyx. 
8  *
9  *  Copyright: 1996, Alejandro Aguilar Sierra
10  *
11  *  Version: 0.4, Lyx project.
12  *
13  *   You are free to use and modify this code under the terms of
14  *   the GNU General Public Licence version 2 or later.
15  */
16
17 #ifndef INSET_FORMULABASE_H 
18 #define INSET_FORMULABASE_H
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include <iosfwd>
25 #include <boost/smart_ptr.hpp>
26
27 #include "insets/inset.h"
28
29 class Buffer;
30 class MathInset;
31
32 ///
33 class InsetFormulaBase : public UpdatableInset {
34 public:
35         /// 
36         InsetFormulaBase(InsetFormulaBase const & p);
37         ///
38         explicit InsetFormulaBase(MathInset *);
39         ///
40         virtual ~InsetFormulaBase();
41         ///
42         virtual int ascent(BufferView *, LyXFont const &) const = 0;
43         ///
44         virtual int descent(BufferView *, LyXFont const &) const = 0;
45         ///
46         virtual int width(BufferView *, LyXFont const &) const = 0;
47         ///
48         virtual void draw(BufferView *,LyXFont const &, int, float &, bool) const = 0;
49         ///
50         virtual void write(Buffer const *, std::ostream &) const = 0;
51         ///
52         virtual void read(Buffer const *, LyXLex & lex) = 0;
53         ///
54         virtual int latex(Buffer const *, std::ostream &,
55                   bool fragile, bool free_spc) const = 0;
56         ///
57         virtual int ascii(Buffer const *, std::ostream &, int linelen) const = 0;
58         ///
59         virtual int linuxdoc(Buffer const *, std::ostream &) const = 0;
60         ///
61         virtual int docBook(Buffer const *, std::ostream &) const = 0;
62         ///
63         virtual void validate(LaTeXFeatures &) const;
64         ///
65         virtual Inset * clone(Buffer const &) const = 0;
66         ///
67         virtual Inset::Code lyxCode() const;
68         ///
69         virtual LyXFont const convertFont(LyXFont const & f) const;
70         /// what appears in the minibuffer when opening
71         virtual string const editMessage() const;
72         ///
73         virtual void edit(BufferView *, int x, int y, unsigned int button);
74         ///
75         virtual void toggleInsetCursor(BufferView *);
76         ///
77         virtual void showInsetCursor(BufferView *, bool show = true);
78         ///
79         virtual void hideInsetCursor(BufferView *);
80         ///
81         virtual void getCursorPos(BufferView *, int &, int &) const;
82         ///
83         virtual void toggleInsetSelection(BufferView * bv);
84         ///
85         virtual void insetButtonPress(BufferView *, int x, int y, int button);
86         ///
87         virtual void insetButtonRelease(BufferView *, int x, int y, int button);
88         ///
89         virtual void insetKeyPress(XKeyEvent * ev);
90         ///
91         virtual void insetMotionNotify(BufferView *, int x, int y, int state);
92         ///
93         virtual void insetUnlock(BufferView *);
94    
95         ///  To allow transparent use of math editing functions
96         virtual RESULT localDispatch(BufferView *, kb_action, string const &);
97     
98         ///
99         virtual std::vector<string> const getLabelList() const;
100         ///
101         MathInset * par() const;
102 protected:
103         ///
104         virtual void updateLocal(BufferView * bv);
105
106         ///
107         MathInset * par_;
108 };
109
110 #endif