]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/APushParser.hh
Added the special deletion. Pressing backspace, the user has a normal deletion
[helm.git] / helm / DEVEL / mathml_editor / src / APushParser.hh
1 // Copyright (C) 2002-2003, Luca Padovani <luca.padovani@cs.unibo.it>.
2 //
3 // This file is part of EdiTeX, an editor of mathematical
4 // expressions based on TeX syntax
5 // 
6 // EdiTeX is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
10 //
11 // EdiTeX is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with EdiTeX; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 // 
20 // For details, see the EdiTeX World-Wide-Web page,
21 // http://helm.cs.unibo.it/editex, or send a mail to
22 // <luca.padovani@cs.unibo.it>
23
24 #ifndef __APushParser_hh__
25 #define __APushParser_hh__
26
27 #include <string>
28
29 class APushParser
30 {
31 public:
32   APushParser(class ALogger& l) : logger(l), factory(0), freeze_level(0) { };
33   APushParser(class ALogger& l, class AMathMLFactory& f) : logger(l), factory(&f), freeze_level(0) { };
34   virtual ~APushParser() { };
35
36   virtual void reset(void) = 0;
37   virtual void push(const class TToken&) = 0;
38   virtual std::string drop(bool) = 0;
39   virtual void setCursorHint(const std::string&) = 0;
40   virtual bool hideCursor(void) = 0;
41   virtual bool showCursor(void) = 0;
42
43   virtual bool freeze(void);
44   virtual bool thaw(void);
45   bool frozen(void) const { return freeze_level > 0; };
46
47 protected:
48   class ALogger& logger;
49   class AMathMLFactory* factory;
50
51 private:
52   unsigned freeze_level;
53 };
54
55 #endif // __APushParser_hh__