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
|
|
|
|
|
|
|
|
#include "InsetCollapsable.h"
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2009-01-30 00:56:37 +00:00
|
|
|
class InsetPhantom : public InsetCollapsable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetPhantom(Buffer const &, std::string const &);
|
|
|
|
///
|
|
|
|
~InsetPhantom();
|
|
|
|
///
|
|
|
|
static std::string params2string(InsetPhantomParams const &);
|
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetPhantomParams &);
|
|
|
|
///
|
|
|
|
InsetPhantomParams const & params() const { return params_; }
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
docstring editMessage() const;
|
|
|
|
///
|
2009-02-04 16:18:43 +00:00
|
|
|
InsetCode lyxCode() const { return PHANTOM_CODE; }
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
2009-02-04 16:18:43 +00:00
|
|
|
docstring name() const;
|
2009-01-30 00:56:37 +00:00
|
|
|
///
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
|
|
|
///
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
|
|
|
void write(std::ostream &) const;
|
|
|
|
///
|
|
|
|
void read(Lexer & lex);
|
|
|
|
///
|
|
|
|
void setButtonLabel();
|
|
|
|
/// show the phantom dialog
|
|
|
|
bool showInsetDialog(BufferView * bv) const;
|
|
|
|
///
|
2009-02-03 10:38:13 +00:00
|
|
|
bool neverIndent() const { return true; }
|
|
|
|
///
|
2009-01-30 00:56:37 +00:00
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
|
|
|
///
|
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
|
|
|
///
|
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
|
|
|
///
|
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
///
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
|
|
|
///
|
2009-02-01 20:18:52 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const;
|
2009-02-04 17:52:28 +00:00
|
|
|
///
|
|
|
|
Inset * clone() const { return new InsetPhantom(*this); }
|
2009-01-30 00:56:37 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
|
|
|
///
|
|
|
|
docstring contextMenu(BufferView const & bv, int x, int y) const;
|
|
|
|
///
|
|
|
|
friend class InsetPhantomParams;
|
|
|
|
|
|
|
|
///
|
|
|
|
InsetPhantomParams params_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // INSET_PHANTOM_H
|