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,
68 std::string const & s = std::string(),
69 std::string const & l = std::string());
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 forOutliner(docstring &, size_t const maxlen, bool const) const;
95 /// Update the contextual information of this inset
96 void updateBuffer(ParIterator const &, UpdateType);
99 void validate(LaTeXFeatures &) const;
101 InsetCode lyxCode() const { return QUOTE_CODE; }
102 /// should this inset be handled like a normal character
103 bool isChar() const { return true; }
107 Inset * clone() const { return new InsetQuotes(*this); }
109 /// Decide whether we need left or right quotation marks
110 void setSide(char_type c);
112 void parseString(std::string const &);
114 docstring displayString() const;
116 docstring getQuoteEntity() const;
118 QuoteLanguage getLanguage(std::string const &);
121 QuoteLanguage language_;
127 std::string fontenc_;
128 /// Code of the contextual language
129 std::string context_lang_;
130 /// Is this in a pass-thru context?