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
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
struct InsetNoteParams {
|
2003-07-25 17:11:25 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string 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-07-08 14:19:25 +00:00
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
InsetNote(BufferParams const &, std::string const &);
|
2003-07-08 14:19:25 +00:00
|
|
|
/// Copy constructor
|
2003-05-26 09:13:55 +00:00
|
|
|
InsetNote(InsetNote const &);
|
2001-07-27 12:03:36 +00:00
|
|
|
///
|
2003-07-08 14:19:25 +00:00
|
|
|
~InsetNote();
|
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
virtual std::auto_ptr<InsetBase> clone() const;
|
2003-05-26 09:13:55 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const editMessage() const;
|
2001-07-20 09:57:23 +00:00
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
InsetOld::Code lyxCode() const { return InsetOld::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-10-08 11:31:51 +00:00
|
|
|
dispatch_result localDispatch(FuncRequest const &);
|
2003-08-26 10:33:59 +00:00
|
|
|
///
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
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
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int latex(Buffer const &, std::ostream &,
|
2003-07-08 14:19:25 +00:00
|
|
|
LatexRunParams const &) const;
|
2001-08-18 15:01:09 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int linuxdoc(Buffer const &, std::ostream &) const;
|
2002-03-05 13:38:40 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int docbook(Buffer const &, std::ostream &, bool) const;
|
2002-03-05 13:38:40 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int ascii(Buffer const &, std::ostream &, int) 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_; }
|
|
|
|
|
2001-07-23 09:11:14 +00:00
|
|
|
private:
|
2003-07-08 14:19:25 +00:00
|
|
|
friend class InsetNoteParams;
|
|
|
|
|
2001-07-23 09:11:14 +00:00
|
|
|
/// used by the constructors
|
|
|
|
void init();
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
InsetNoteParams params_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#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-10-06 15:43:21 +00:00
|
|
|
InsetNoteMailer(std::string const & name, 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-10-06 15:43:21 +00:00
|
|
|
static std::string const params2string(std::string const &, 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-10-06 15:43:21 +00:00
|
|
|
std::string const name_;
|
2003-07-08 14:19:25 +00:00
|
|
|
///
|
|
|
|
InsetNote & inset_;
|
2001-07-20 09:57:23 +00:00
|
|
|
};
|
|
|
|
|
2003-07-08 14:19:25 +00:00
|
|
|
|
|
|
|
|
2001-07-20 09:57:23 +00:00
|
|
|
#endif
|