]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
cd20bdfefb53941268b0f9566e0b97d3dc1d58d3
[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         ~InsetSpecialChar();
45         ///
46         int Ascent(LyXFont const &font) const;
47         ///
48         int Descent(LyXFont const &font) const;
49         ///
50         int Width(LyXFont const &font) const;
51         ///
52         void Draw(LyXFont, LyXScreen &scr, int baseline, float &x);
53         ///
54         void Write(FILE *file);
55         /// Will not be used when lyxf3
56         void Read(LyXLex &lex);
57         /// 
58         int Latex(FILE *file, signed char fragile);
59         ///
60         int Latex(string &file, signed char fragile);
61         ///
62         int Linuxdoc(string &file);
63         ///
64         int DocBook(string &file);
65         ///
66         Inset* Clone();
67         ///  
68         Inset::Code LyxCode() const
69         {
70                 return Inset::NO_CODE;
71         }
72         /// We don't need \begin_inset and \end_inset
73         bool DirectWrite() const 
74         {
75                 return true;
76         };
77         ///
78         void Validate(LaTeXFeatures &) const;
79 private:
80         /// And which kind is this?
81         Kind kind;
82 };
83
84 #endif