3 * \file InsetIPAMacro.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jürgen Spitzmüller
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_IPAMACRO_H
13 #define INSET_IPAMACRO_H
17 #include "InsetCollapsable.h"
24 class InsetIPADecoParams
34 void write(std::ostream & os) const;
36 void read(Lexer & lex);
41 /////////////////////////////////////////////////////////////////////////
45 /////////////////////////////////////////////////////////////////////////
47 /// Used to insert IPA decorations
48 class InsetIPADeco : public InsetCollapsable
52 InsetIPADeco(Buffer *, std::string const &);
56 static std::string params2string(InsetIPADecoParams const &);
58 static void string2params(std::string const &, InsetIPADecoParams &);
60 InsetIPADecoParams const & params() const { return params_; }
63 InsetCode lyxCode() const { return IPADECO_CODE; }
65 docstring layoutName() const;
67 void metrics(MetricsInfo &, Dimension &) const;
69 void draw(PainterInfo & pi, int x, int y) const;
71 void write(std::ostream &) const;
73 void read(Lexer & lex);
75 bool neverIndent() const { return true; }
77 void latex(otexstream &, OutputParams const &) const;
79 int plaintext(odocstream &, OutputParams const &) const;
81 int docbook(odocstream &, OutputParams const &) const;
83 docstring xhtml(XHTMLStream &, OutputParams const &) const;
85 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
87 void doDispatch(Cursor & cur, FuncRequest & cmd);
89 void validate(LaTeXFeatures & features) const;
91 bool allowSpellCheck() const { return false; }
93 bool insetAllowed(InsetCode code) const;
95 docstring toolTip(BufferView const & bv, int x, int y) const;
97 Inset * clone() const { return new InsetIPADeco(*this); }
98 /// used by the constructors
101 friend class InsetIPADecoParams;
104 InsetIPADecoParams params_;
108 /////////////////////////////////////////////////////////////////////////
112 /////////////////////////////////////////////////////////////////////////
114 /// Used to insert special IPA chars that are not available in unicode
115 class InsetIPAChar : public Inset {
118 /// The different kinds of special chars we support
120 /// falling tone mark
124 /// high-rising tone mark
126 /// low-rising tone mark
128 /// high rising-falling tone mark
129 TONE_HIGH_RISING_FALLING
133 InsetIPAChar() : Inset(0) {}
135 explicit InsetIPAChar(Kind k);
139 void metrics(MetricsInfo &, Dimension &) const;
141 void draw(PainterInfo & pi, int x, int y) const;
143 void write(std::ostream &) const;
144 /// Will not be used when lyxf3
145 void read(Lexer & lex);
147 void latex(otexstream &, OutputParams const &) const;
149 int plaintext(odocstream &, OutputParams const &) const;
151 int docbook(odocstream &, OutputParams const &) const;
153 docstring xhtml(XHTMLStream &, OutputParams const &) const;
155 void toString(odocstream &) const;
157 void forToc(docstring &, size_t) const;
159 InsetCode lyxCode() const { return IPACHAR_CODE; }
160 /// We don't need \begin_inset and \end_inset
161 bool directWrite() const { return true; }
163 void validate(LaTeXFeatures &) const;
165 /// should this inset be handled like a normal character?
166 bool isChar() const { return true; }
167 /// is this equivalent to a letter?
168 bool isLetter() const;
169 /// should we break lines after this inset?
170 bool isLineSeparator() const;
172 Inset * clone() const { return new InsetIPAChar(*this); };
174 /// And which kind is this?