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
|
2000-03-16 04:29:22 +00:00
|
|
|
* Copyright 1995-2000 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
|
|
|
|
|
|
|
|
#include "lyxinset.h"
|
|
|
|
|
|
|
|
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
|
|
|
///
|
2000-07-15 23:51:46 +00:00
|
|
|
LyXFont ConvertFont(LyXFont const & font);
|
|
|
|
//LyXFont ConvertFont(LyXFont font);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Write(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Read(Buffer const *, LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-07-15 23:51:46 +00:00
|
|
|
int Latex(Buffer const *, std::ostream &,
|
|
|
|
bool fragile, bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int Ascii(Buffer const *, std::ostream &) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int Linuxdoc(Buffer const *, std::ostream &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int DocBook(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Validate(LaTeXFeatures &) const;
|
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
Inset * Clone() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const;
|
|
|
|
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);
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void ParseString(string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string DispString() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|