]> git.lyx.org Git - lyx.git/blob - src/insets/InsetQuotes.h
Remove zombie noncopyable.hpp dependency
[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 #include "Inset.h"
16
17 #include "support/docstring.h"
18
19
20 namespace lyx {
21
22 /** Quotes.
23   Used for the various quotes. German, English, French, all either
24   double or single **/
25 class InsetQuotes : public Inset
26 {
27 public:
28         ///
29         enum QuoteLanguage {
30                 ///
31                 EnglishQuotes,
32                 ///
33                 SwedishQuotes,
34                 ///
35                 GermanQuotes,
36                 ///
37                 PolishQuotes,
38                 ///
39                 FrenchQuotes,
40                 ///
41                 DanishQuotes
42         };
43         ///
44         enum QuoteSide {
45                 ///
46                 LeftQuote,
47                 ///
48                 RightQuote
49         };
50         ///
51         enum QuoteTimes {
52                 ///
53                 SingleQuotes,
54                 ///
55                 DoubleQuotes
56         };
57
58         /** The constructor works like this:
59           \begin{itemize}
60             \item fls <- french single quote left
61             \item grd <- german double quote right
62             \item etc.
63           \end{itemize}
64           */
65         explicit InsetQuotes(Buffer * buf, std::string const & str = "eld");
66         /// Direct access to inner/outer quotation marks
67         InsetQuotes(Buffer * buf, char_type c, QuoteTimes t);
68         ///
69         docstring layoutName() const;
70         ///
71         void metrics(MetricsInfo &, Dimension &) const;
72         ///
73         void draw(PainterInfo & pi, int x, int y) const;
74         ///
75         void write(std::ostream &) const;
76         ///
77         void read(Lexer & lex);
78         ///
79         void latex(otexstream &, OutputParams const &) const;
80         ///
81         int plaintext(odocstringstream & ods, OutputParams const & op,
82                       size_t max_length = INT_MAX) const;
83         ///
84         int docbook(odocstream &, OutputParams const &) const;
85         ///
86         docstring xhtml(XHTMLStream &, OutputParams const &) const;
87
88         /// 
89         void toString(odocstream &) const;
90         ///
91         void forOutliner(docstring &, size_t const maxlen, bool const) const;
92
93         ///
94         void validate(LaTeXFeatures &) const;
95         ///
96         InsetCode lyxCode() const { return QUOTE_CODE; }
97         /// should this inset be handled like a normal character
98         bool isChar() const { return true; }
99
100 private:
101         ///
102         Inset * clone() const { return new InsetQuotes(*this); }
103
104         /// Decide whether we need left or right quotation marks
105         void setSide(char_type c);
106         ///
107         void parseString(std::string const &);
108         ///
109         docstring displayString() const;
110         ///
111         docstring getQuoteEntity() const;
112
113         ///
114         QuoteLanguage language_;
115         ///
116         QuoteSide side_;
117         ///
118         QuoteTimes times_;
119 };
120
121 } // namespace lyx
122
123 #endif