2001-07-20 09:57:23 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
|
|
|
* \file insetnote.h
|
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSETNOTE_H
|
|
|
|
#define INSETNOTE_H
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class InsetNoteParams {
|
|
|
|
public:
|
2003-12-10 17:28:14 +00:00
|
|
|
enum Type {
|
|
|
|
Note,
|
|
|
|
Comment,
|
2006-06-03 16:46:27 +00:00
|
|
|
Greyedout,
|
|
|
|
Framed,
|
|
|
|
Shaded
|
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;
|
|
|
|
///
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
///
|
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
|
|
|
|
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
/** The PostIt note inset, and other annotations
|
2002-03-21 17:09:55 +00:00
|
|
|
|
2001-07-20 09:57:23 +00:00
|
|
|
*/
|
|
|
|
class InsetNote : public InsetCollapsable {
|
|
|
|
public:
|
2002-03-21 17:09:55 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
InsetNote(BufferParams const &, std::string const &);
|
2001-07-27 12:03:36 +00:00
|
|
|
///
|
2003-07-08 14:19:25 +00:00
|
|
|
~InsetNote();
|
|
|
|
///
|
2006-09-09 18:52:00 +00:00
|
|
|
virtual lyx::docstring const editMessage() const;
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::NOTE_CODE; }
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void write(Buffer const &, std::ostream &) const;
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
void setButtonLabel();
|
2003-07-15 23:52:05 +00:00
|
|
|
/// show the note dialog
|
|
|
|
bool showInsetDialog(BufferView * bv) const;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2006-10-19 16:51:30 +00:00
|
|
|
int latex(Buffer const &, lyx::odocstream &,
|
2003-12-03 18:17:20 +00:00
|
|
|
OutputParams const &) const;
|
2001-08-18 15:01:09 +00:00
|
|
|
///
|
2006-10-19 21:00:33 +00:00
|
|
|
int docbook(Buffer const &, lyx::odocstream &,
|
2003-12-03 18:17:20 +00:00
|
|
|
OutputParams const &) const;
|
2002-03-05 13:38:40 +00:00
|
|
|
///
|
2006-10-11 19:40:50 +00:00
|
|
|
int plaintext(Buffer const &, lyx::odocstream &,
|
2003-12-03 18:17:20 +00:00
|
|
|
OutputParams const &) const;
|
2002-04-16 16:43:19 +00:00
|
|
|
///
|
2003-07-08 14:19:25 +00:00
|
|
|
void validate(LaTeXFeatures &) const;
|
|
|
|
///
|
|
|
|
InsetNoteParams const & params() const { return params_; }
|
2005-04-22 08:57:22 +00:00
|
|
|
///
|
|
|
|
bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
|
2003-10-17 18:01:15 +00:00
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
InsetNote(InsetNote const &);
|
2003-10-17 18:01:15 +00:00
|
|
|
///
|
2004-11-24 21:58:42 +00:00
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2001-07-23 09:11:14 +00:00
|
|
|
private:
|
2003-07-08 14:19:25 +00:00
|
|
|
friend class InsetNoteParams;
|
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
|
|
|
2001-07-23 09:11:14 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
InsetNoteParams params_;
|
|
|
|
};
|
|
|
|
|
2003-10-17 18:01:15 +00:00
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
#include "mailinset.h"
|
2001-07-23 09:11:14 +00:00
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
class InsetNoteMailer : public MailInset {
|
|
|
|
public:
|
|
|
|
///
|
2003-12-10 14:49:51 +00:00
|
|
|
InsetNoteMailer(InsetNote & inset);
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const & name() const { return name_; }
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const inset2string(Buffer const &) const;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2003-12-10 14:49:51 +00:00
|
|
|
static std::string const params2string(InsetNoteParams const &);
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
static void string2params(std::string const &, InsetNoteParams &);
|
2003-07-08 14:19:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
2003-12-10 14:49:51 +00:00
|
|
|
static std::string const name_;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
InsetNote & inset_;
|
2001-07-20 09:57:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|