]> git.lyx.org Git - lyx.git/blob - src/insets/insetquotes.h
some using changes small changes in lyxfont and some other things, read the Changelog
[lyx.git] / src / insets / insetquotes.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1995-2000 The LyX Team
9  *
10  * ====================================================== */
11
12 #ifndef INSET_QUOTES_H
13 #define INSET_QUOTES_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "lyxinset.h"
20
21 using std::ostream;
22
23 class BufferParams;
24
25 struct LaTeXFeatures;
26
27
28 /** Quotes.
29
30   Used for the various quotes. German, English, French, all either
31   double or single **/ 
32 class InsetQuotes: public Inset {
33 public:
34         ///
35         enum quote_language {
36                 ///
37                 EnglishQ,
38                 ///
39                 SwedishQ,
40                 ///
41                 GermanQ,
42                 ///
43                 PolishQ,
44                 ///
45                 FrenchQ,
46                 ///
47                 DanishQ
48         };
49         ///
50         enum quote_side {
51                 ///
52                 LeftQ,
53                 ///
54                 RightQ 
55         };
56         ///
57         enum quote_times {
58                 ///
59                 SingleQ,
60                 ///
61                 DoubleQ 
62         };
63         
64         /** The constructor works like this:
65           \begin{itemize}
66             \item fls <- french single quote left 
67             \item grd <- german double quote right 
68             \item etc.
69           \end{itemize}
70           */ 
71         InsetQuotes(string const & str = "eld");
72         /// Create the right quote inset after character c
73         InsetQuotes(char c, BufferParams const & params);
74
75         ///
76         int ascent(Painter &, LyXFont const &) const;
77         ///
78         int descent(Painter &, LyXFont const &) const;
79         ///
80         int width(Painter &, LyXFont const &) const;
81         ///
82         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
83         ///
84         LyXFont ConvertFont(LyXFont font);
85         ///
86         void Write(ostream &) const;
87         ///
88         void Read(LyXLex & lex);
89         ///
90         int Latex(ostream &, signed char fragile, bool free_spc) const;
91         ///
92         int Linuxdoc(ostream &) const;
93         ///
94         int DocBook(ostream &) const;
95         ///
96         void Validate(LaTeXFeatures &) const;
97         ///
98         Inset * Clone() const;
99         ///
100         Inset::Code LyxCode() const;
101 private:
102         ///
103         quote_language language;
104         ///
105         quote_side side;
106         ///
107         quote_times times;
108
109         /** The parameters of the constructor are the language, the
110             side and the multiplicity of the quote.
111          */
112         InsetQuotes(quote_language l, quote_side s, quote_times t);
113         ///
114         void ParseString(string const &);
115         ///
116         string DispString() const;
117 };
118 #endif