1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
1999-10-02 16:21:10 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "inset.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
class BufferParams;
|
|
|
|
|
|
|
|
struct LaTeXFeatures;
|
|
|
|
|
|
|
|
|
|
|
|
/** Quotes.
|
|
|
|
|
|
|
|
Used for the various quotes. German, English, French, all either
|
|
|
|
double or single **/
|
2000-07-15 23:51:46 +00:00
|
|
|
class InsetQuotes : public Inset {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
enum quote_language {
|
|
|
|
///
|
|
|
|
EnglishQ,
|
|
|
|
///
|
|
|
|
SwedishQ,
|
|
|
|
///
|
|
|
|
GermanQ,
|
|
|
|
///
|
|
|
|
PolishQ,
|
|
|
|
///
|
|
|
|
FrenchQ,
|
|
|
|
///
|
|
|
|
DanishQ
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum quote_side {
|
|
|
|
///
|
|
|
|
LeftQ,
|
|
|
|
///
|
|
|
|
RightQ
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum quote_times {
|
|
|
|
///
|
|
|
|
SingleQ,
|
|
|
|
///
|
|
|
|
DoubleQ
|
|
|
|
};
|
|
|
|
|
|
|
|
/** The constructor works like this:
|
|
|
|
\begin{itemize}
|
|
|
|
\item fls <- french single quote left
|
|
|
|
\item grd <- german double quote right
|
|
|
|
\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);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int width(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-06-23 15:02:46 +00:00
|
|
|
void draw(BufferView *, LyXFont const &, int, float &, bool) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
LyXFont const convertFont(LyXFont const & font) const;
|
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
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int latex(Buffer const *, std::ostream &,
|
2000-07-15 23:51:46 +00:00
|
|
|
bool fragile, bool free_spc) 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
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int docBook(Buffer const *, std::ostream &) 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
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
virtual Inset * clone(Buffer const &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code lyxCode() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
quote_language language;
|
|
|
|
///
|
|
|
|
quote_side side;
|
|
|
|
///
|
|
|
|
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);
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void parseString(string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
string const dispString() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|
2000-07-17 18:27:53 +00:00
|
|
|
|