2001-07-20 09:57:23 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetNote.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Angus Leeming
|
2001-07-20 09:57:23 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-07-20 09:57:23 +00:00
|
|
|
*/
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
#ifndef INSET_NOTE_H
|
|
|
|
#define INSET_NOTE_H
|
2001-07-20 09:57:23 +00:00
|
|
|
|
2017-10-16 08:12:21 +00:00
|
|
|
#include "InsetCollapsible.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2001-07-20 09:57:23 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
2003-07-25 17:11:25 +00:00
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
class InsetNoteParams
|
|
|
|
{
|
2005-01-19 15:03:31 +00:00
|
|
|
public:
|
2003-12-10 17:28:14 +00:00
|
|
|
enum Type {
|
|
|
|
Note,
|
|
|
|
Comment,
|
2007-12-04 09:25:50 +00:00
|
|
|
Greyedout
|
2003-12-10 17:28:14 +00:00
|
|
|
};
|
|
|
|
/// \c type defaults to Note
|
|
|
|
InsetNoteParams();
|
2003-07-25 17:11:25 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
2007-04-26 11:30:54 +00:00
|
|
|
void read(Lexer & lex);
|
2003-07-25 17:11:25 +00:00
|
|
|
///
|
2003-12-10 17:28:14 +00:00
|
|
|
Type type;
|
2003-07-08 14:19:25 +00:00
|
|
|
};
|
2003-07-25 17:11:25 +00:00
|
|
|
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// InsetNote
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2002-03-21 17:09:55 +00:00
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
/// The PostIt note inset, and other annotations
|
2017-10-16 08:12:21 +00:00
|
|
|
class InsetNote : public InsetCollapsible
|
2008-03-27 22:26:24 +00:00
|
|
|
{
|
2001-07-20 09:57:23 +00:00
|
|
|
public:
|
2002-03-21 17:09:55 +00:00
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetNote(Buffer *, std::string const &);
|
2001-07-27 12:03:36 +00:00
|
|
|
///
|
2003-07-08 14:19:25 +00:00
|
|
|
~InsetNote();
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2008-03-27 22:26:24 +00:00
|
|
|
static std::string params2string(InsetNoteParams const &);
|
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetNoteParams &);
|
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
InsetNoteParams const & params() const { return params_; }
|
|
|
|
private:
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return NOTE_CODE; }
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring layoutName() 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
|
|
|
/** returns false if, when outputting LaTeX, font changes should
|
2011-02-22 19:41:04 +00:00
|
|
|
be closed before generating this inset. This is needed for
|
|
|
|
insets that may contain several paragraphs */
|
2020-10-01 07:42:11 +00:00
|
|
|
bool inheritFont() const override { return params_.type == InsetNoteParams::Note; }
|
2010-12-20 22:33:12 +00:00
|
|
|
/// Is the content of this inset part of the output document?
|
2020-10-01 07:42:11 +00:00
|
|
|
bool producesOutput() const override
|
2010-12-20 22:33:12 +00:00
|
|
|
{ return params_.type == InsetNoteParams::Greyedout; }
|
2008-03-09 17:43:16 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool allowSpellCheck() const override;
|
2010-02-13 16:22:39 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
FontInfo getFont() const override;
|
2012-12-02 09:41:49 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void write(std::ostream &) const override;
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void read(Lexer & lex) override;
|
2003-07-15 23:52:05 +00:00
|
|
|
/// show the note dialog
|
2020-10-01 07:42:11 +00:00
|
|
|
bool showInsetDialog(BufferView * bv) const override;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool isMacroScope() const override;
|
2007-12-21 20:42:46 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const override;
|
2001-08-18 15:01:09 +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;
|
2007-02-15 22:59:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void docbook(XMLStream &, OutputParams const &) const override;
|
2002-04-16 16:43:19 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring xhtml(XMLStream &, OutputParams const &) const override;
|
2009-06-05 19:58:23 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void validate(LaTeXFeatures &) const override;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
|
2008-02-11 13:06:01 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
|
2008-02-27 20:43:16 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override { return new InsetNote(*this); }
|
2001-07-23 09:11:14 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
std::string contextMenuName() const override;
|
2008-03-24 13:33:48 +00:00
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
friend class InsetNoteParams;
|
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
InsetNoteParams params_;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
#endif // INSET_NOTE_H
|