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"
|
|
|
|
|
|
|
|
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,
|
|
|
|
/// 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
|
|
|
///
|
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
|
|
|
///
|
|
|
|
int ascent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int descent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int width(Painter &, LyXFont const &) const;
|
|
|
|
///
|
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-06-12 11:27:15 +00:00
|
|
|
void Write(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Will not be used when lyxf3
|
2000-06-12 11:27:15 +00:00
|
|
|
void Read(Buffer const *, LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +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
|
|
|
///
|
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
|