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 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
83 void latex(otexstream &, OutputParams const &) const;
85 int plaintext(odocstringstream & ods, OutputParams const & op,
86 size_t max_length = INT_MAX) const;
88 int docbook(odocstream &, OutputParams const &) const;
90 docstring xhtml(XHTMLStream &, OutputParams const &) const;
93 void toString(odocstream &) const;
95 void forOutliner(docstring &, size_t const maxlen, bool const) const;
97 /// Update the contextual information of this inset
98 void updateBuffer(ParIterator const &, UpdateType);
101 void validate(LaTeXFeatures &) const;
103 std::string contextMenuName() const;
105 InsetCode lyxCode() const { return QUOTE_CODE; }
106 /// should this inset be handled like a normal character
107 bool isChar() const { return true; }
109 /// Returns the current quote type
110 std::string getType() const;
111 /// Returns a map of quotation marks
112 std::map<std::string, docstring> getTypes() const;
116 Inset * clone() const { return new InsetQuotes(*this); }
118 /// Decide whether we need left or right quotation marks
119 void setSide(char_type c);
121 void parseString(std::string const &,
122 bool const allow_wildcards = false);
124 docstring displayString() const;
126 docstring getQuoteEntity() const;
128 QuoteLanguage getLanguage(std::string const &);
131 QuoteLanguage language_;
137 std::string fontenc_;
138 /// Code of the contextual language
139 std::string context_lang_;
140 /// Is this in a pass-thru context?
144 /// \name Protected functions inherited from Inset class
147 void doDispatch(Cursor & cur, FuncRequest & cmd);