+
+ parseString(str);
+}
+
+
+InsetQuotes::InsetQuotes(Buffer * buf, char_type c, QuoteLevel level,
+ string const & side, string const & style)
+ : Inset(buf), level_(level)
+{
+ bool dynamic = false;
+ if (buf) {
+ global_style_ = buf->masterBuffer()->params().quotes_style;
+ dynamic = buf->masterBuffer()->params().dynamic_quotes;
+ fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
+ }
+ if (style.empty())
+ style_ = dynamic ? QuoteStyle::Dynamic : global_style_;
+ else
+ style_ = getStyle(style);
+
+ if (side == "left" || side == "opening")
+ side_ = QuoteSide::Opening;
+ else if (side == "right" || side == "closing")
+ side_ = QuoteSide::Closing;
+ else
+ setSide(c);
+}
+
+
+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_ = QuoteSide::Opening;// opening quote
+ else
+ side_ = QuoteSide::Closing;// 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_);
+}
+
+
+QuoteStyle InsetQuotes::getStyle(string const & s)
+{
+ QuoteStyle qs = QuoteStyle::English;
+
+ if (s == "english")
+ qs = QuoteStyle::English;
+ else if (s == "swedish")
+ qs = QuoteStyle::Swedish;
+ else if (s == "german")
+ qs = QuoteStyle::German;
+ else if (s == "polish")
+ qs = QuoteStyle::Polish;
+ else if (s == "swiss")
+ qs = QuoteStyle::Swiss;
+ else if (s == "danish")
+ qs = QuoteStyle::Danish;
+ else if (s == "plain")
+ qs = QuoteStyle::Plain;
+ else if (s == "british")
+ qs = QuoteStyle::British;
+ else if (s == "swedishg")
+ qs = QuoteStyle::SwedishG;
+ else if (s == "french")
+ qs = QuoteStyle::French;
+ else if (s == "frenchin")
+ qs = QuoteStyle::FrenchIN;
+ else if (s == "russian")
+ qs = QuoteStyle::Russian;
+ else if (s == "cjk")
+ qs = QuoteStyle::CJK;
+ else if (s == "cjkangle")
+ qs = QuoteStyle::CJKAngle;
+ else if (s == "hungarian")
+ qs = QuoteStyle::Hungarian;
+ else if (s == "dynamic")
+ qs = QuoteStyle::Dynamic;
+
+ return qs;