]> git.lyx.org Git - lyx.git/blob - src/insets/insetquotes.h
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetquotes.h
1 // -*- C++ -*-
2 /**
3  * \file insetquotes.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef INSET_QUOTES_H
13 #define INSET_QUOTES_H
14
15
16 #include "inset.h"
17
18 class BufferParams;
19 class Language;
20
21 struct LaTeXFeatures;
22
23
24 /** Quotes.
25   Used for the various quotes. German, English, French, all either
26   double or single **/
27 class InsetQuotes : public Inset {
28 public:
29         ///
30         enum quote_language {
31                 ///
32                 EnglishQ,
33                 ///
34                 SwedishQ,
35                 ///
36                 GermanQ,
37                 ///
38                 PolishQ,
39                 ///
40                 FrenchQ,
41                 ///
42                 DanishQ
43         };
44         ///
45         enum quote_side {
46                 ///
47                 LeftQ,
48                 ///
49                 RightQ
50         };
51         ///
52         enum quote_times {
53                 ///
54                 SingleQ,
55                 ///
56                 DoubleQ
57         };
58
59         /** The constructor works like this:
60           \begin{itemize}
61             \item fls <- french single quote left
62             \item grd <- german double quote right
63             \item etc.
64           \end{itemize}
65           */
66         explicit
67         InsetQuotes(string const & str = "eld");
68         /// Create the right quote inset after character c
69         InsetQuotes(char c, BufferParams const & params);
70         ///
71         Inset * clone(Buffer const &, bool same_id = false) const;
72
73         ///
74         void dimension(BufferView *, LyXFont const &, Dimension &) const;
75         ///
76         void draw(BufferView *, LyXFont const &, int, float &) const;
77 #if 0
78         ///
79         LyXFont const convertFont(LyXFont const & font) const;
80 #endif
81         ///
82         void write(Buffer const *, std::ostream &) const;
83         ///
84         void read(Buffer const *, LyXLex & lex);
85         ///
86         int latex(Buffer const *, std::ostream &,
87                   LatexRunParams const &) const;
88         ///
89         int ascii(Buffer const *, std::ostream &, int linelen) const;
90         ///
91         int linuxdoc(Buffer const *, std::ostream &) const;
92         ///
93         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
94         ///
95         void validate(LaTeXFeatures &) const;
96         ///
97         Inset::Code lyxCode() const;
98         // should this inset be handled like a normal charater
99         bool isChar() const { return true; }
100
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 const dispString(Language const *) const;
117 };
118 #endif