X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetquotes.h;h=cbd2f5dcbfcdff84687a51709ca9e19eb23e4f85;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=60592c8f86ff2e564df9dcfbb0ca948cf685b4f8;hpb=9a5f7d1fe43ddbc1308f69bc609825ac9d618922;p=lyx.git diff --git a/src/insets/insetquotes.h b/src/insets/insetquotes.h index 60592c8f86..cbd2f5dcbf 100644 --- a/src/insets/insetquotes.h +++ b/src/insets/insetquotes.h @@ -1,34 +1,34 @@ // -*- C++ -*- -/* This file is part of* - * ====================================================== +/** + * \file insetquotes.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team + * \author Jean-Marc Lasgouttes * - * ====================================================== */ + * Full author contact details are available in file CREDITS. + */ #ifndef INSET_QUOTES_H #define INSET_QUOTES_H -#ifdef __GNUG__ -#pragma interface -#endif #include "inset.h" +#include "support/types.h" + + +namespace lyx { + class BufferParams; class Language; - -struct LaTeXFeatures; +class LaTeXFeatures; /** Quotes. - Used for the various quotes. German, English, French, all either - double or single **/ -class InsetQuotes : public Inset { + double or single **/ +class InsetQuotes : public InsetOld { public: /// enum quote_language { @@ -50,63 +50,61 @@ public: /// LeftQ, /// - RightQ + RightQ }; /// enum quote_times { /// SingleQ, /// - DoubleQ + DoubleQ }; - + /** The constructor works like this: \begin{itemize} - \item fls <- french single quote left - \item grd <- german double quote right + \item fls <- french single quote left + \item grd <- german double quote right \item etc. \end{itemize} */ explicit - InsetQuotes(string const & str = "eld"); + InsetQuotes(std::string const & str = "eld"); /// Create the right quote inset after character c - InsetQuotes(char c, BufferParams const & params); - - /// - int ascent(BufferView *, LyXFont const &) const; - /// - int descent(BufferView *, LyXFont const &) const; + InsetQuotes(char_type c, BufferParams const & params); + /// Direct access to inner/outer quotation marks + InsetQuotes(char_type c, quote_language l, quote_times t); /// - int width(BufferView *, LyXFont const &) const; + bool metrics(MetricsInfo &, Dimension &) const; /// - void draw(BufferView *, LyXFont const &, int, float &, bool) const; + void draw(PainterInfo & pi, int x, int y) const; #if 0 /// LyXFont const convertFont(LyXFont const & font) const; #endif /// - void write(Buffer const *, std::ostream &) const; + void write(Buffer const &, std::ostream &) const; /// - void read(Buffer const *, LyXLex & lex); + void read(Buffer const &, LyXLex & lex); /// - int latex(Buffer const *, std::ostream &, - bool fragile, bool free_spc) const; + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// - int ascii(Buffer const *, std::ostream &, int linelen) const; + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; /// - int linuxdoc(Buffer const *, std::ostream &) const; - /// - int docbook(Buffer const *, std::ostream &) const; + int docbook(Buffer const &, odocstream &, OutputParams const &) const; + + /// the string that is passed to the TOC + virtual void textString(Buffer const &, odocstream &) const; + /// void validate(LaTeXFeatures &) const; /// - virtual Inset * clone(Buffer const &, bool same_id = false) const; - /// - Inset::Code lyxCode() const; - // should this inset be handled like a normal charater + InsetBase::Code lyxCode() const; + // should this inset be handled like a normal character bool isChar() const { return true; } - + private: + virtual std::auto_ptr doClone() const; + /// quote_language language_; /// @@ -118,10 +116,14 @@ private: side and the multiplicity of the quote. */ InsetQuotes(quote_language l, quote_side s, quote_times t); + /// Decide whether we need left or right quotation marks + void getPosition(char_type c); /// - void parseString(string const &); + void parseString(std::string const &); /// - string const dispString(Language const *) const; + lyx::docstring const dispString(Language const *) const; }; -#endif +} // namespace lyx + +#endif