X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetquotes.h;h=c88dfeb8bfb0ed703617de97e493ca94e88a8106;hb=10ba1b8918e7da14334bb5573ce2a707671c8b51;hp=7856ecb319939a60e7216e30603de929c018c442;hpb=65b49997597efd5a5ba920c739ba6cd8384e1eeb;p=lyx.git diff --git a/src/insets/insetquotes.h b/src/insets/insetquotes.h index 7856ecb319..c88dfeb8bf 100644 --- a/src/insets/insetquotes.h +++ b/src/insets/insetquotes.h @@ -1,33 +1,30 @@ // -*- 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; +class Language; struct 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 { @@ -49,70 +46,79 @@ 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); - - /// - int Ascent(LyXFont const & font) const; + /// Direct access to inner/outer quotation marks + InsetQuotes(char c, quote_language l, quote_times t); /// - int Descent(LyXFont const & font) const; + void 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); + LyXFont const convertFont(LyXFont const & font) const; +#endif /// - void Read(LyXLex & lex); + void write(Buffer const &, std::ostream &) const; /// - int Latex(FILE * file, signed char fragile); + void read(Buffer const &, LyXLex & lex); /// - int Latex(string & file, signed char fragile); + int latex(Buffer const &, std::ostream &, + OutputParams const &) const; /// - int Linuxdoc(string & file); + int plaintext(Buffer const &, std::ostream &, + OutputParams const &) const; /// - int DocBook(string & file); + int linuxdoc(Buffer const &, std::ostream &, + OutputParams const &) const; /// - void Validate(LaTeXFeatures &) const; + int docbook(Buffer const &, std::ostream &, + OutputParams const &) const; /// - Inset * Clone() const; + void validate(LaTeXFeatures &) const; /// - Inset::Code LyxCode() const; + InsetOld::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 c); /// - void ParseString(string const &); + void parseString(std::string const &); /// - string DispString() const; + std::string const dispString(Language const *) const; }; #endif