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 /// \name Methods inherited from Inset class
42 Inset * clone() const { return new InsetIPA(*this); }
44 bool neverIndent() const { return true; }
46 InsetCode lyxCode() const { return IPA_CODE; }
48 docstring layoutName() const { return from_ascii("IPA"); }
50 bool descendable(BufferView const & /*bv*/) const { return true; }
52 void metrics(MetricsInfo & mi, Dimension & dim) const;
54 Inset * editXY(Cursor & cur, int x, int y);
56 void draw(PainterInfo & pi, int x, int y) const;
59 void doDispatch(Cursor & cur, FuncRequest & cmd);
61 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
63 void addPreview(DocIterator const & inset_pos,
64 graphics::PreviewLoader & ploader) const;
66 bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
68 void write(std::ostream & os) const;
70 void edit(Cursor & cur, bool front, EntryDirection entry_from);
73 void latex(otexstream &, OutputParams const &) const;
75 void validate(LaTeXFeatures & features) const;
77 bool allowSpellCheck() const { return false; }
79 bool insetAllowed(InsetCode code) const;
83 /// Retrieves the preview state. Returns true if preview
84 /// is enabled and the preview image is availabled.
85 bool previewState(BufferView * bv) const;
86 /// Recreates the preview if preview is enabled.
87 void reloadPreview(DocIterator const & pos) const;
88 /// Prepare the preview if preview is enabled.
89 void preparePreview(DocIterator const & pos) const;
92 boost::scoped_ptr<RenderPreview> preview_;
94 mutable bool use_preview_;
98 mutable Dimension dim_;