4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_QUOTES_H
13 #define INSET_QUOTES_H
17 #include "support/docstring.h"
23 Used for the various quotes. German, English, French, all either
25 class InsetQuotes : public Inset
58 /** The constructor works like this:
60 \item fls <- french single quote left
61 \item grd <- german double quote right
65 explicit InsetQuotes(Buffer * buf, std::string const & str = "eld");
66 /// Create the right quote inset after character c
67 InsetQuotes(Buffer * buffer, char_type c);
68 /// Direct access to inner/outer quotation marks
69 InsetQuotes(Buffer * buf, char_type c, QuoteTimes t);
71 docstring layoutName() const;
73 void metrics(MetricsInfo &, Dimension &) const;
75 void draw(PainterInfo & pi, int x, int y) const;
77 void write(std::ostream &) const;
79 void read(Lexer & lex);
81 void latex(otexstream &, OutputParams const &) const;
83 int plaintext(odocstringstream & ods, OutputParams const & op,
84 size_t max_length = INT_MAX) const;
86 int docbook(odocstream &, OutputParams const &) const;
88 docstring xhtml(XHTMLStream &, OutputParams const &) const;
91 void toString(odocstream &) const;
93 void forToc(docstring &, size_t maxlen) const;
96 void validate(LaTeXFeatures &) const;
98 InsetCode lyxCode() const { return QUOTE_CODE; }
99 /// should this inset be handled like a normal character
100 bool isChar() const { return true; }
104 Inset * clone() const { return new InsetQuotes(*this); }
106 /// Decide whether we need left or right quotation marks
107 void setSide(char_type c);
109 void parseString(std::string const &);
111 docstring displayString() const;
114 QuoteLanguage language_;