lyx_mirror/src/insets/insetspecialchar.h
Lars Gullik Bjønnes c6150425e5 several small patches and some fixes, read the ChangeLog
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@688 a592a061-630c-0410-9148-cb99ea01b6c8
2000-04-24 20:58:23 +00:00

86 lines
1.7 KiB
C++

// -*- C++ -*-
/* This file is part of*
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1997 Asger Alstrup
*
* ====================================================== */
#ifndef INSET_SPECIALCHAR_H
#define INSET_SPECIALCHAR_H
#ifdef __GNUG__
#pragma interface
#endif
#include "lyxinset.h"
#include "LString.h"
struct LaTeXFeatures;
/// Used to insert special chars
class InsetSpecialChar : public Inset {
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
MENU_SEPARATOR,
/// Protected Separator
PROTECTED_SEPARATOR
};
///
InsetSpecialChar() {}
///
explicit
InsetSpecialChar(Kind k);
///
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;
///
void Write(std::ostream &) const;
/// Will not be used when lyxf3
void Read(LyXLex & lex);
///
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Ascii(std::ostream &) const;
///
int Linuxdoc(std::ostream &) const;
///
int DocBook(std::ostream &) const;
///
Inset * Clone() const;
///
Inset::Code LyxCode() const
{
return Inset::SPECIALCHAR_CODE;
}
/// 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