1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
|
|
|
* \file insetquotes.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Jean-Marc Lasgouttes
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#ifndef INSET_QUOTES_H
|
|
|
|
#define INSET_QUOTES_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "inset.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
class BufferParams;
|
2001-07-20 09:38:19 +00:00
|
|
|
class Language;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
struct LaTeXFeatures;
|
|
|
|
|
|
|
|
|
|
|
|
/** Quotes.
|
|
|
|
Used for the various quotes. German, English, French, all either
|
2002-03-21 17:09:55 +00:00
|
|
|
double or single **/
|
2003-07-25 21:20:24 +00:00
|
|
|
class InsetQuotes : public InsetOld {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
enum quote_language {
|
|
|
|
///
|
|
|
|
EnglishQ,
|
|
|
|
///
|
|
|
|
SwedishQ,
|
|
|
|
///
|
|
|
|
GermanQ,
|
|
|
|
///
|
|
|
|
PolishQ,
|
|
|
|
///
|
|
|
|
FrenchQ,
|
|
|
|
///
|
|
|
|
DanishQ
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum quote_side {
|
|
|
|
///
|
|
|
|
LeftQ,
|
|
|
|
///
|
2002-03-21 17:09:55 +00:00
|
|
|
RightQ
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
///
|
|
|
|
enum quote_times {
|
|
|
|
///
|
|
|
|
SingleQ,
|
|
|
|
///
|
2002-03-21 17:09:55 +00:00
|
|
|
DoubleQ
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
2002-03-21 17:09:55 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/** The constructor works like this:
|
|
|
|
\begin{itemize}
|
2002-03-21 17:09:55 +00:00
|
|
|
\item fls <- french single quote left
|
|
|
|
\item grd <- german double quote right
|
1999-09-27 18:44:28 +00:00
|
|
|
\item etc.
|
|
|
|
\end{itemize}
|
2000-04-08 17:02:02 +00:00
|
|
|
*/
|
|
|
|
explicit
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetQuotes(string const & str = "eld");
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Create the right quote inset after character c
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetQuotes(char c, BufferParams const & params);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
virtual std::auto_ptr<InsetBase> clone() const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2003-06-02 10:03:27 +00:00
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2003-05-30 06:48:24 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2001-08-03 18:28:11 +00:00
|
|
|
#if 0
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
LyXFont const convertFont(LyXFont const & font) const;
|
2001-08-03 18:28:11 +00:00
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void write(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void read(Buffer const *, LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-05-23 08:59:47 +00:00
|
|
|
int latex(Buffer const *, std::ostream &,
|
|
|
|
LatexRunParams const &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int ascii(Buffer const *, std::ostream &, int linelen) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int linuxdoc(Buffer const *, std::ostream &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void validate(LaTeXFeatures &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
InsetOld::Code lyxCode() const;
|
2002-01-08 14:24:49 +00:00
|
|
|
// should this inset be handled like a normal charater
|
|
|
|
bool isChar() const { return true; }
|
2002-03-21 17:09:55 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
2001-07-20 09:38:19 +00:00
|
|
|
quote_language language_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-20 09:38:19 +00:00
|
|
|
quote_side side_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-20 09:38:19 +00:00
|
|
|
quote_times times_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** 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);
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void parseString(string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-20 09:38:19 +00:00
|
|
|
string const dispString(Language const *) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|