1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetspecialchar.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 Asger Alstrup Nielsen
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
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-11-04 01:40:20 +00:00
|
|
|
|
#ifndef INSET_SPECIALCHAR_H
|
|
|
|
|
#define INSET_SPECIALCHAR_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
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
|
|
struct LaTeXFeatures;
|
|
|
|
|
|
|
|
|
|
/// Used to insert special chars
|
1999-11-24 22:14:46 +00:00
|
|
|
|
class InsetSpecialChar : public Inset {
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/// The different kinds of special chars we support
|
|
|
|
|
enum Kind {
|
|
|
|
|
/// Optional hyphenation point (\-)
|
|
|
|
|
HYPHENATION,
|
2001-07-20 13:04:36 +00:00
|
|
|
|
/// Ligature break point (\textcompwordmark)
|
|
|
|
|
LIGATURE_BREAK,
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// ... (\ldots)
|
|
|
|
|
LDOTS,
|
|
|
|
|
/// End of sentence punctuation (\@)
|
|
|
|
|
END_OF_SENTENCE,
|
|
|
|
|
/// Menu separator
|
2000-02-29 02:19:17 +00:00
|
|
|
|
MENU_SEPARATOR,
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
|
InsetSpecialChar() {}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
|
explicit
|
1999-09-27 18:44:28 +00:00
|
|
|
|
InsetSpecialChar(Kind k);
|
2000-02-10 17:53:36 +00:00
|
|
|
|
///
|
2001-07-23 09:11:14 +00:00
|
|
|
|
Kind kind() const;
|
|
|
|
|
///
|
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;
|
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
|
|
|
|
/// Will not be used when lyxf3
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void read(Buffer const *, LyXLex & lex);
|
2002-03-21 17:09:55 +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
|
|
|
|
///
|
2003-05-26 09:13:55 +00:00
|
|
|
|
virtual Inset * clone(Buffer const &) const;
|
|
|
|
|
///
|
2003-03-11 15:01:29 +00:00
|
|
|
|
Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// We don't need \begin_inset and \end_inset
|
2003-03-11 15:01:29 +00:00
|
|
|
|
bool directWrite() const { return true; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void validate(LaTeXFeatures &) const;
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2002-01-08 14:24:49 +00:00
|
|
|
|
// should this inset be handled like a normal charater
|
|
|
|
|
bool isChar() const;
|
2001-11-13 14:47:35 +00:00
|
|
|
|
/// is this equivalent to a letter?
|
|
|
|
|
bool isLetter() const;
|
2002-02-13 10:37:28 +00:00
|
|
|
|
/// is this equivalent to a space (which is BTW different from
|
|
|
|
|
// a line separator)?
|
2001-11-13 14:47:35 +00:00
|
|
|
|
bool isSpace() const;
|
2002-02-13 10:37:28 +00:00
|
|
|
|
// should we break lines after this inset?
|
|
|
|
|
bool isLineSeparator() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
private:
|
|
|
|
|
/// And which kind is this?
|
2001-07-23 09:11:14 +00:00
|
|
|
|
Kind kind_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|