]> git.lyx.org Git - lyx.git/blob - src/insets/insetquotes.h
eb4fb347476b4216a2828c9c44e728f40c39e83e
[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-1999 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         InsetQuotes(string const & str = "eld");
70         /// Create the right quote inset after character c
71         InsetQuotes(char c, BufferParams const & params);
72         ///
73         ~InsetQuotes() {}; //nothing to do
74
75         ///
76         int Ascent(LyXFont const & font) const;
77         ///
78         int Descent(LyXFont const & font) const;
79         ///
80         int Width(LyXFont const & font) const;
81         ///
82         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
83         ///
84         LyXFont ConvertFont(LyXFont font);
85         ///
86         void Write(FILE * file);
87         ///
88         void Read(LyXLex & lex);
89         ///
90         int Latex(FILE * file, signed char fragile);
91         ///
92         int Latex(string & file, signed char fragile);
93         ///
94         int Linuxdoc(string & file);
95         ///
96         int DocBook(string & file);
97         ///
98         void Validate(LaTeXFeatures &) const;
99         ///
100         Inset* Clone();
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 str);
117         ///
118         string DispString() const;
119 };
120
121 #endif