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.
15 #include "InsetText.h"
17 #include "Dimension.h"
19 #include <boost/scoped_ptr.hpp>
29 /// An IPA inset with instant preview
30 class InsetIPA : public InsetText {
38 InsetIPA(InsetIPA const & other);
40 InsetIPA & operator=(InsetIPA const & other);
42 /// \name Methods inherited from Inset class
44 Inset * clone() const { return new InsetIPA(*this); }
46 bool neverIndent() const { return true; }
48 InsetCode lyxCode() const { return IPA_CODE; }
50 docstring layoutName() const { return from_ascii("IPA"); }
52 bool descendable(BufferView const & /*bv*/) const { return true; }
54 void metrics(MetricsInfo & mi, Dimension & dim) const;
56 Inset * editXY(Cursor & cur, int x, int y);
58 void draw(PainterInfo & pi, int x, int y) const;
61 void doDispatch(Cursor & cur, FuncRequest & cmd);
63 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
65 void addPreview(DocIterator const & inset_pos,
66 graphics::PreviewLoader & ploader) const;
68 bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
70 void write(std::ostream & os) const;
72 void edit(Cursor & cur, bool front, EntryDirection entry_from);
75 void latex(otexstream &, OutputParams const &) const;
77 docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
79 void validate(LaTeXFeatures & features) const;
81 bool allowSpellCheck() const { return false; }
83 bool insetAllowed(InsetCode code) const;
87 /// Retrieves the preview state. Returns true if preview
88 /// is enabled and the preview image is availabled.
89 bool previewState(BufferView * bv) const;
90 /// Recreates the preview if preview is enabled.
91 void reloadPreview(DocIterator const & pos) const;
92 /// Prepare the preview if preview is enabled.
93 void preparePreview(DocIterator const & pos) const;
96 boost::scoped_ptr<RenderPreview> preview_;
98 mutable bool use_preview_;
102 mutable Dimension dim_;