2009-01-30 00:56:37 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsetPhantom.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2009-02-03 10:38:13 +00:00
|
|
|
* \author Uwe Stöhr
|
2009-01-30 00:56:37 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_PHANTOM_H
|
|
|
|
#define INSET_PHANTOM_H
|
|
|
|
|
2017-10-16 08:12:21 +00:00
|
|
|
#include "InsetCollapsible.h"
|
2009-01-30 00:56:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
class InsetPhantomParams
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum Type {
|
|
|
|
Phantom,
|
|
|
|
HPhantom,
|
|
|
|
VPhantom
|
|
|
|
};
|
|
|
|
/// \c type defaults to Phantom
|
|
|
|
InsetPhantomParams();
|
|
|
|
///
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void read(Lexer & lex);
|
|
|
|
///
|
|
|
|
Type type;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// InsetPhantom
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-02-03 10:38:13 +00:00
|
|
|
/// The phantom inset
|
2017-10-16 08:12:21 +00:00
|
|
|
class InsetPhantom : public InsetCollapsible
|
2009-01-30 00:56:37 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetPhantom(Buffer *, std::string const &);
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
|
|
|
~InsetPhantom();
|
|
|
|
///
|
|
|
|
static std::string params2string(InsetPhantomParams const &);
|
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetPhantomParams &);
|
|
|
|
///
|
|
|
|
InsetPhantomParams const & params() const { return params_; }
|
|
|
|
private:
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return PHANTOM_CODE; }
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring layoutName() const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void write(std::ostream &) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void read(Lexer & lex) override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void setButtonLabel() override;
|
2009-01-30 00:56:37 +00:00
|
|
|
/// show the phantom dialog
|
2020-10-01 07:42:11 +00:00
|
|
|
bool showInsetDialog(BufferView * bv) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool neverIndent() const override { return true; }
|
2009-02-03 10:38:13 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2013-03-08 19:52:18 +00:00
|
|
|
int plaintext(odocstringstream & ods, OutputParams const & op,
|
2020-10-01 07:42:11 +00:00
|
|
|
size_t max_length = INT_MAX) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void docbook(XMLStream &, OutputParams const &) const override;
|
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
|
|
|
/// Makes no sense for XHTML.
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring xhtml(XMLStream &, OutputParams const &) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const override;
|
2009-02-04 17:52:28 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override { return new InsetPhantom(*this); }
|
2009-01-30 00:56:37 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
std::string contextMenuName() const override;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
|
|
|
friend class InsetPhantomParams;
|
|
|
|
|
|
|
|
///
|
|
|
|
InsetPhantomParams params_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // INSET_PHANTOM_H
|