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 /// Direct access to inner/outer quotation marks
67 InsetQuotes(Buffer * buf, char_type c, QuoteTimes t);
69 docstring layoutName() const;
71 void metrics(MetricsInfo &, Dimension &) const;
73 void draw(PainterInfo & pi, int x, int y) const;
75 void write(std::ostream &) const;
77 void read(Lexer & lex);
79 void latex(otexstream &, OutputParams const &) const;
81 int plaintext(odocstringstream & ods, OutputParams const & op,
82 size_t max_length = INT_MAX) const;
84 int docbook(odocstream &, OutputParams const &) const;
86 docstring xhtml(XHTMLStream &, OutputParams const &) const;
89 void toString(odocstream &) const;
91 void forOutliner(docstring &, size_t const maxlen, bool const) const;
93 /// Update the contextual information of this inset
94 void updateBuffer(ParIterator const &, UpdateType);
97 void validate(LaTeXFeatures &) const;
99 InsetCode lyxCode() const { return QUOTE_CODE; }
100 /// should this inset be handled like a normal character
101 bool isChar() const { return true; }
105 Inset * clone() const { return new InsetQuotes(*this); }
107 /// Decide whether we need left or right quotation marks
108 void setSide(char_type c);
110 void parseString(std::string const &);
112 docstring displayString() const;
114 docstring getQuoteEntity() const;
117 QuoteLanguage language_;
123 std::string fontenc_;
124 /// Code of the contextual language
125 std::string context_lang_;
126 /// Is this in a pass-thru context?