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
|
|
|
|
*
|
|
|
|
* Copyright (C) 1997 Asger Alstrup
|
|
|
|
*
|
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
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
|
|
|
InsetSpecialChar();
|
|
|
|
///
|
|
|
|
InsetSpecialChar(Kind k);
|
|
|
|
///
|
|
|
|
~InsetSpecialChar();
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Ascent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Descent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Width(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void Write(FILE * file);
|
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
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Latex(FILE * file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Latex(string & file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Linuxdoc(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int DocBook(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Inset * Clone();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const
|
|
|
|
{
|
|
|
|
return Inset::NO_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
|