1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
|
* \file InsetSpecialChar.h
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* 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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
|
*/
|
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
|
|
|
|
|
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
|
#include "Inset.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
|
class LaTeXFeatures;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/// Used to insert special chars
|
2007-04-29 13:39:47 +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;
|
|
|
|
|
///
|
2007-09-21 20:39:47 +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
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const &, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// Will not be used when lyxf3
|
2007-04-26 11:30:54 +00:00
|
|
|
|
void read(Buffer const &, Lexer & lex);
|
2002-03-21 17:09:55 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int latex(Buffer const &, odocstream &,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
OutputParams const &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int plaintext(Buffer const &, odocstream &,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
OutputParams const &) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int docbook(Buffer const &, odocstream &,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
OutputParams const &) const;
|
2005-11-25 14:40:34 +00:00
|
|
|
|
/// the string that is passed to the TOC
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual int textString(Buffer const &, odocstream &,
|
2005-11-25 14:40:34 +00:00
|
|
|
|
OutputParams const &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
|
InsetCode lyxCode() const { return 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
|
|
|
|
// should we break lines after this inset?
|
|
|
|
|
bool isLineSeparator() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
|
virtual Inset * clone() const;
|
2004-11-23 23:04:52 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// And which kind is this?
|
2001-07-23 09:11:14 +00:00
|
|
|
|
Kind kind_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|