]> git.lyx.org Git - lyx.git/blob - src/insets/insetquotes.h
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 class BufferParams;
22
23 struct LaTeXFeatures;
24
25
26 /** Quotes.
27
28   Used for the various quotes. German, English, French, all either
29   double or single **/ 
30 class InsetQuotes : public Inset {
31 public:
32         ///
33         enum quote_language {
34                 ///
35                 EnglishQ,
36                 ///
37                 SwedishQ,
38                 ///
39                 GermanQ,
40                 ///
41                 PolishQ,
42                 ///
43                 FrenchQ,
44                 ///
45                 DanishQ
46         };
47         ///
48         enum quote_side {
49                 ///
50                 LeftQ,
51                 ///
52                 RightQ 
53         };
54         ///
55         enum quote_times {
56                 ///
57                 SingleQ,
58                 ///
59                 DoubleQ 
60         };
61         
62         /** The constructor works like this:
63           \begin{itemize}
64             \item fls <- french single quote left 
65             \item grd <- german double quote right 
66             \item etc.
67           \end{itemize}
68           */
69         explicit
70         InsetQuotes(string const & str = "eld");
71         /// Create the right quote inset after character c
72         InsetQuotes(char c, BufferParams const & params);
73
74         ///
75         int ascent(BufferView *, LyXFont const &) const;
76         ///
77         int descent(BufferView *, LyXFont const &) const;
78         ///
79         int width(BufferView *, LyXFont const &) const;
80         ///
81         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
82         ///
83         LyXFont ConvertFont(LyXFont const & font);
84         //LyXFont ConvertFont(LyXFont font);
85         ///
86         void Write(Buffer const *, std::ostream &) const;
87         ///
88         void Read(Buffer const *, LyXLex & lex);
89         ///
90         int Latex(Buffer const *, std::ostream &,
91                   bool fragile, bool free_spc) const;
92         ///
93         int Ascii(Buffer const *, std::ostream &) const;
94         ///
95         int Linuxdoc(Buffer const *, std::ostream &) const;
96         ///
97         int DocBook(Buffer const *, std::ostream &) const;
98         ///
99         void Validate(LaTeXFeatures &) const;
100         ///
101         Inset * Clone() const;
102         ///
103         Inset::Code LyxCode() const;
104 private:
105         ///
106         quote_language language;
107         ///
108         quote_side side;
109         ///
110         quote_times times;
111
112         /** The parameters of the constructor are the language, the
113             side and the multiplicity of the quote.
114          */
115         InsetQuotes(quote_language l, quote_side s, quote_times t);
116         ///
117         void ParseString(string const &);
118         ///
119         string DispString() const;
120 };
121 #endif