1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1997 Asger Alstrup
|
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-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_SPECIALCHAR_H
|
|
|
|
#define INSET_SPECIALCHAR_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "lyxinset.h"
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-03-28 02:18:55 +00:00
|
|
|
using std::ostream;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
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,
|
|
|
|
/// ... (\ldots)
|
|
|
|
LDOTS,
|
|
|
|
/// End of sentence punctuation (\@)
|
|
|
|
END_OF_SENTENCE,
|
|
|
|
/// Menu separator
|
2000-02-29 02:19:17 +00:00
|
|
|
MENU_SEPARATOR,
|
|
|
|
#if 0
|
|
|
|
/// Newline
|
|
|
|
NEWLINE,
|
|
|
|
#endif
|
|
|
|
/// Protected Separator
|
|
|
|
PROTECTED_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
|
|
|
///
|
|
|
|
InsetSpecialChar(Kind k);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
|
|
|
int ascent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int descent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int width(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
void draw(Painter &, LyXFont const &, int baseline, float & x) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
void Write(ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Will not be used when lyxf3
|
1999-11-04 01:40:20 +00:00
|
|
|
void Read(LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-09 03:36:48 +00:00
|
|
|
int Latex(ostream &, signed char fragile, bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
|
|
|
int Linuxdoc(ostream &) const;
|
|
|
|
///
|
|
|
|
int DocBook(ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
Inset * Clone() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const
|
|
|
|
{
|
2000-02-29 02:19:17 +00:00
|
|
|
return Inset::SPECIALCHAR_CODE;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
/// We don't need \begin_inset and \end_inset
|
|
|
|
bool DirectWrite() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
///
|
|
|
|
void Validate(LaTeXFeatures &) const;
|
|
|
|
private:
|
|
|
|
/// And which kind is this?
|
|
|
|
Kind kind;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|