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 override;
65 /// some special chars allow line breaking after them
66 RowFlags rowFlags() const override;
68 void metrics(MetricsInfo &, Dimension &) const override;
70 void draw(PainterInfo & pi, int x, int y) const override;
72 void write(std::ostream &) const override;
73 /// Will not be used when lyxf3
74 void read(Lexer & lex) override;
76 void latex(otexstream &, OutputParams const &) const override;
78 int plaintext(odocstringstream & ods, OutputParams const & op,
79 size_t max_length = INT_MAX) const override;
81 void docbook(XMLStream &, OutputParams const &) const override;
83 docstring xhtml(XMLStream &, OutputParams const &) const override;
85 void toString(odocstream &) const override;
87 bool isInToc() const override { return true; }
89 void forOutliner(docstring &, size_t const, bool const) const override;
91 InsetCode lyxCode() const override { return SPECIALCHAR_CODE; }
92 /// We don't need \begin_inset and \end_inset
93 bool directWrite() const override { return true; }
95 void validate(LaTeXFeatures &) const override;
97 /// should this inset be handled like a normal character?
98 bool isChar() const override;
99 /// is this equivalent to a letter?
100 bool isLetter() const override;
101 /// should we break lines after this inset?
102 bool isLineSeparator() const override;
103 /// Is the content of this inset part of the immediate (visible) text sequence?
104 bool isPartOfTextSequence() const override { return isChar(); }
106 Inset * clone() const override { return new InsetSpecialChar(*this); }
108 /// And which kind is this?