]> git.lyx.org Git - lyx.git/blob - src/insets/insetquotes.h
reformatting and remove using delc
[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 const ConvertFont(LyXFont const & font) const;
84         ///
85         void Write(Buffer const *, std::ostream &) const;
86         ///
87         void Read(Buffer const *, LyXLex & lex);
88         ///
89         int Latex(Buffer const *, std::ostream &,
90                   bool fragile, bool free_spc) const;
91         ///
92         int Ascii(Buffer const *, std::ostream &, int linelen) const;
93         ///
94         int Linuxdoc(Buffer const *, std::ostream &) const;
95         ///
96         int DocBook(Buffer const *, std::ostream &) const;
97         ///
98         void Validate(LaTeXFeatures &) const;
99         ///
100         Inset * Clone(Buffer const &) const;
101         ///
102         Inset::Code LyxCode() const;
103 private:
104         ///
105         quote_language language;
106         ///
107         quote_side side;
108         ///
109         quote_times times;
110
111         /** The parameters of the constructor are the language, the
112             side and the multiplicity of the quote.
113          */
114         InsetQuotes(quote_language l, quote_side s, quote_times t);
115         ///
116         void ParseString(string const &);
117         ///
118         string const DispString() const;
119 };
120 #endif
121