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
|
|
|
|
* Copyright 1995-1999 The LyX Team
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-10-02 16:21:10 +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 **/
|
|
|
|
class InsetQuotes: public Inset {
|
|
|
|
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}
|
|
|
|
*/
|
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
|
|
|
///
|
|
|
|
~InsetQuotes() {}; //nothing to do
|
|
|
|
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Ascent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Descent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Width(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
LyXFont ConvertFont(LyXFont font);
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
void Write(FILE * file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
void Read(LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Latex(FILE * file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Latex(string & file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Linuxdoc(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int DocBook(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Validate(LaTeXFeatures &) const;
|
|
|
|
///
|
|
|
|
Inset* Clone();
|
|
|
|
///
|
|
|
|
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-10-02 16:21:10 +00:00
|
|
|
void ParseString(string str);
|
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
|