3 * \file InsetSpecialChar.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger Alstrup Nielsen
8 * \author Jean-Marc Lasgouttes
9 * \author Lars Gullik Bjønnes
11 * Full author contact details are available in file CREDITS.
14 #ifndef INSET_SPECIALCHAR_H
15 #define INSET_SPECIALCHAR_H
25 /// Used to insert special chars
26 class InsetSpecialChar : public Inset {
29 /// The different kinds of special chars we support
31 /// Optional hyphenation point (\-)
33 /// Optional line wrap point without hyphen (ZWSP)
35 /// Ligature break point (\textcompwordmark)
39 /// End of sentence punctuation (\@)
58 InsetSpecialChar() : Inset(0), kind_(HYPHENATION) {}
60 explicit InsetSpecialChar(Kind k);
64 docstring toolTip(BufferView const & bv, int x, int y) const;
66 void metrics(MetricsInfo &, Dimension &) const;
68 void draw(PainterInfo & pi, int x, int y) const;
70 void write(std::ostream &) const;
71 /// Will not be used when lyxf3
72 void read(Lexer & lex);
74 void latex(otexstream &, OutputParams const &) const;
76 int plaintext(odocstringstream & ods, OutputParams const & op,
77 size_t max_length = INT_MAX) const;
79 int docbook(odocstream &, OutputParams const &) const;
81 docstring xhtml(XHTMLStream &, OutputParams const &) const;
83 void toString(odocstream &) const;
85 bool isInToc() const { return true; }
87 void forOutliner(docstring &, size_t const, bool const) const;
89 InsetCode lyxCode() const { return SPECIALCHAR_CODE; }
90 /// We don't need \begin_inset and \end_inset
91 bool directWrite() const { return true; }
93 void validate(LaTeXFeatures &) const;
95 /// should this inset be handled like a normal character?
97 /// is this equivalent to a letter?
98 bool isLetter() const;
99 /// should we break lines after this inset?
100 bool isLineSeparator() const;
101 /// Is the content of this inset part of the immediate (visible) text sequence?
102 bool isPartOfTextSequence() const { return isChar(); }
104 Inset * clone() const { return new InsetSpecialChar(*this); }
106 /// And which kind is this?