]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
pos=string::npos for regex not found, use handcoded transform in lstring.C, fix the...
[lyx.git] / src / insets / insetspecialchar.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1997 Asger Alstrup
8  *
9  * ====================================================== */
10
11 #ifndef INSET_SPECIALCHAR_H
12 #define INSET_SPECIALCHAR_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "lyxinset.h"
19 #include "LString.h"
20
21 struct LaTeXFeatures;
22
23 ///  Used to insert special chars
24 class InsetSpecialChar : public Inset {
25 public:
26
27         /// The different kinds of special chars we support
28         enum Kind {
29                 /// Optional hyphenation point (\-)
30                 HYPHENATION,
31                 /// ... (\ldots)
32                 LDOTS,
33                 /// End of sentence punctuation (\@)
34                 END_OF_SENTENCE,
35                 /// Menu separator
36                 MENU_SEPARATOR
37         };
38
39         ///
40         InsetSpecialChar() {}
41         ///
42         InsetSpecialChar(Kind k);
43         ///
44         int Ascent(LyXFont const & font) const;
45         ///
46         int Descent(LyXFont const & font) const;
47         ///
48         int Width(LyXFont const & font) const;
49         ///
50         void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
51         ///
52         void Write(ostream &);
53         /// Will not be used when lyxf3
54         void Read(LyXLex & lex);
55         /// 
56         int Latex(ostream &, signed char fragile);
57         ///
58         int Latex(string & file, signed char fragile);
59         ///
60         int Linuxdoc(string & file);
61         ///
62         int DocBook(string & file);
63         ///
64         Inset * Clone() const;
65         ///  
66         Inset::Code LyxCode() const
67         {
68                 return Inset::NO_CODE;
69         }
70         /// We don't need \begin_inset and \end_inset
71         bool DirectWrite() const 
72         {
73                 return true;
74         };
75         ///
76         void Validate(LaTeXFeatures &) const;
77 private:
78         /// And which kind is this?
79         Kind kind;
80 };
81
82 #endif