+docstring InsetQuotes::layoutName() const
+{
+ return from_ascii("Quotes");
+}
+
+
+void InsetQuotes::setSide(char_type c)
+{
+ // Decide whether opening or closing quote
+ if (lyx::isSpace(c) || isOpenPunctuation(c))
+ side_ = InsetQuotesParams::OpeningQuote;// opening quote
+ else
+ side_ = InsetQuotesParams::ClosingQuote;// closing quote
+}
+
+
+void InsetQuotes::parseString(string const & s, bool const allow_wildcards)
+{
+ style_ = quoteparams.getQuoteStyle(s, allow_wildcards, style_);
+ side_ = quoteparams.getQuoteSide(s, allow_wildcards, side_);
+ level_ = quoteparams.getQuoteLevel(s, allow_wildcards, level_);
+}
+
+
+InsetQuotesParams::QuoteStyle InsetQuotes::getStyle(string const & s)
+{
+ InsetQuotesParams::QuoteStyle qs = InsetQuotesParams::EnglishQuotes;
+
+ if (s == "english")
+ qs = InsetQuotesParams::EnglishQuotes;
+ else if (s == "swedish")
+ qs = InsetQuotesParams::SwedishQuotes;
+ else if (s == "german")
+ qs = InsetQuotesParams::GermanQuotes;
+ else if (s == "polish")
+ qs = InsetQuotesParams::PolishQuotes;
+ else if (s == "swiss")
+ qs = InsetQuotesParams::SwissQuotes;
+ else if (s == "danish")
+ qs = InsetQuotesParams::DanishQuotes;
+ else if (s == "plain")
+ qs = InsetQuotesParams::PlainQuotes;
+ else if (s == "british")
+ qs = InsetQuotesParams::BritishQuotes;
+ else if (s == "swedishg")
+ qs = InsetQuotesParams::SwedishGQuotes;
+ else if (s == "french")
+ qs = InsetQuotesParams::FrenchQuotes;
+ else if (s == "frenchin")
+ qs = InsetQuotesParams::FrenchINQuotes;
+ else if (s == "russian")
+ qs = InsetQuotesParams::RussianQuotes;
+ else if (s == "cjk")
+ qs = InsetQuotesParams::CJKQuotes;
+ else if (s == "cjkangle")
+ qs = InsetQuotesParams::CJKAngleQuotes;
+ else if (s == "dynamic")
+ qs = InsetQuotesParams::DynamicQuotes;
+
+ return qs;
+}
+
+
+docstring InsetQuotes::displayString() const
+{
+ // In PassThru, we use straight quotes
+ if (pass_thru_)
+ return (level_ == InsetQuotesParams::PrimaryQuotes) ?
+ from_ascii("\"") : from_ascii("'");
+
+ InsetQuotesParams::QuoteStyle style =
+ (style_ == InsetQuotesParams::DynamicQuotes) ? global_style_ : style_;
+
+ docstring retdisp = docstring(1, quoteparams.getQuoteChar(style, level_, side_, rtl_));
+
+ // in French, thin spaces are added inside double guillemets
+ if (prefixIs(context_lang_, "fr")
+ && level_ == InsetQuotesParams::PrimaryQuotes
+ && (style == InsetQuotesParams::SwissQuotes
+ || style == InsetQuotesParams::FrenchQuotes
+ || style == InsetQuotesParams::FrenchINQuotes)) {
+ // THIN SPACE (U+2009)
+ char_type const thin_space = 0x2009;
+ if (side_ == InsetQuotesParams::OpeningQuote)
+ retdisp += thin_space;