2012-03-06 07:54:22 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsetIPA.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Jürgen Spitzmüller
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSETIPA_H
|
|
|
|
#define INSETIPA_H
|
|
|
|
|
|
|
|
#include "InsetText.h"
|
|
|
|
|
|
|
|
#include "Dimension.h"
|
|
|
|
|
2016-06-02 22:49:36 +00:00
|
|
|
#include "support/unique_ptr.h"
|
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
class RenderPreview;
|
|
|
|
|
|
|
|
namespace graphics {
|
|
|
|
class PreviewLoader;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// An IPA inset with instant preview
|
|
|
|
class InsetIPA : public InsetText {
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
public:
|
|
|
|
///
|
2019-09-17 21:06:18 +00:00
|
|
|
explicit InsetIPA(Buffer *);
|
2012-03-06 07:54:22 +00:00
|
|
|
///
|
|
|
|
~InsetIPA();
|
|
|
|
///
|
|
|
|
InsetIPA(InsetIPA const & other);
|
2015-10-11 09:16:09 +00:00
|
|
|
///
|
|
|
|
InsetIPA & operator=(InsetIPA const & other);
|
2012-03-06 07:54:22 +00:00
|
|
|
|
|
|
|
/// \name Methods inherited from Inset class
|
|
|
|
//@{
|
|
|
|
Inset * clone() const { return new InsetIPA(*this); }
|
|
|
|
|
|
|
|
bool neverIndent() const { return true; }
|
2016-09-29 16:35:26 +00:00
|
|
|
|
|
|
|
bool forceLocalFontSwitch() const { return true; }
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
InsetCode lyxCode() const { return IPA_CODE; }
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
docstring layoutName() const { return from_ascii("IPA"); }
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
bool descendable(BufferView const & /*bv*/) const { return true; }
|
|
|
|
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
|
|
|
|
Inset * editXY(Cursor & cur, int x, int y);
|
|
|
|
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
|
2012-03-09 11:14:39 +00:00
|
|
|
///
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2012-03-06 09:14:24 +00:00
|
|
|
///
|
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
void addPreview(DocIterator const & inset_pos,
|
|
|
|
graphics::PreviewLoader & ploader) const;
|
|
|
|
|
|
|
|
bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
|
|
|
|
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
|
|
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
///
|
|
|
|
void latex(otexstream &, OutputParams const &) const;
|
|
|
|
///
|
2020-06-08 21:27:49 +00:00
|
|
|
void docbook(XMLStream &, OutputParams const &) const;
|
|
|
|
///
|
2019-05-09 23:35:40 +00:00
|
|
|
docstring xhtml(XMLStream & xs, OutputParams const &) const;
|
2015-02-15 19:17:21 +00:00
|
|
|
///
|
2012-03-06 07:54:22 +00:00
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
|
|
|
bool allowSpellCheck() const { return false; }
|
|
|
|
///
|
|
|
|
bool insetAllowed(InsetCode code) const;
|
|
|
|
//@}
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2012-03-06 07:54:22 +00:00
|
|
|
protected:
|
|
|
|
/// Retrieves the preview state. Returns true if preview
|
Run codespell on src/insets
Command was
codespell -w -i 3 -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru src/insets/
2020-06-25 21:46:16 +00:00
|
|
|
/// is enabled and the preview image is available.
|
2012-03-06 07:54:22 +00:00
|
|
|
bool previewState(BufferView * bv) const;
|
|
|
|
/// Recreates the preview if preview is enabled.
|
|
|
|
void reloadPreview(DocIterator const & pos) const;
|
|
|
|
/// Prepare the preview if preview is enabled.
|
|
|
|
void preparePreview(DocIterator const & pos) const;
|
|
|
|
|
|
|
|
///
|
2016-06-02 22:49:36 +00:00
|
|
|
unique_ptr<RenderPreview> preview_;
|
2012-03-06 07:54:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|