X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetquotes.h;h=cbd2f5dcbfcdff84687a51709ca9e19eb23e4f85;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=91c105e3589ef927459a82d7244a0a33e0f89bfb;hpb=dfe1bc44b44903faf77ef454c98c4c3e56c1d5e3;p=lyx.git diff --git a/src/insets/insetquotes.h b/src/insets/insetquotes.h index 91c105e358..cbd2f5dcbf 100644 --- a/src/insets/insetquotes.h +++ b/src/insets/insetquotes.h @@ -1,33 +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-1999 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 "lyxinset.h" +#include "inset.h" -class BufferParams; +#include "support/types.h" -struct LaTeXFeatures; +namespace lyx { + +class BufferParams; +class Language; +class LaTeXFeatures; -/** Quotes. +/** 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 { @@ -49,72 +50,80 @@ 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} - */ - InsetQuotes(string const & str = "eld"); + */ + explicit + InsetQuotes(std::string const & str = "eld"); /// Create the right quote inset after character c - InsetQuotes(char c, BufferParams const & params); - /// - ~InsetQuotes() {}; //nothing to do - - /// - int Ascent(LyXFont const & font) 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 Descent(LyXFont const & font) const; + bool metrics(MetricsInfo &, Dimension &) const; /// - int Width(LyXFont const & font) const; + void draw(PainterInfo & pi, int x, int y) const; +#if 0 /// - void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x); - /// - LyXFont ConvertFont(LyXFont font); - /// - void Write(FILE * file); - /// - void Read(LyXLex & lex); + LyXFont const convertFont(LyXFont const & font) const; +#endif /// - int Latex(FILE * file, signed char fragile); + void write(Buffer const &, std::ostream &) const; /// - int Latex(string & file, signed char fragile); + void read(Buffer const &, LyXLex & lex); /// - int Linuxdoc(string & file); + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// - int DocBook(string & file); + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; /// - void Validate(LaTeXFeatures &) const; + int docbook(Buffer const &, odocstream &, OutputParams const &) const; + + /// the string that is passed to the TOC + virtual void textString(Buffer const &, odocstream &) const; + /// - Inset* Clone(); + void validate(LaTeXFeatures &) const; /// - Inset::Code LyxCode() const; + 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; + quote_language language_; /// - quote_side side; + quote_side side_; /// - quote_times times; + quote_times times_; /** The parameters of the constructor are the language, the 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 DispString() const; + lyx::docstring const dispString(Language const *) const; }; + +} // namespace lyx + #endif