1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 the LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_INFO_H
|
|
|
|
#define INSET_INFO_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "lyxinset.h"
|
|
|
|
#include FORMS_H_LOCATION
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
/** Info. Handles the note insets.
|
|
|
|
|
|
|
|
This class handles the note insets. The edit operation bringes up
|
|
|
|
a dialog, where the user can type a note about life or something
|
|
|
|
else of interest. When collapsed, the inset is displayed as "Note"
|
|
|
|
in a yellow box. Currently, the Read-function is a terrible hack.
|
|
|
|
Some day in the distant future, this will hopefully be obsoleted by
|
|
|
|
a true comment-environment. */
|
1999-11-24 22:14:46 +00:00
|
|
|
class InsetInfo : public Inset {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetInfo();
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
explicit
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetInfo(string const & string);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
~InsetInfo();
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int width(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-06-23 15:02:46 +00:00
|
|
|
void draw(BufferView *, LyXFont const &, int, float &, bool) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Write(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Read(Buffer const *, LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-07-15 23:51:46 +00:00
|
|
|
int Latex(Buffer const *, std::ostream &,
|
|
|
|
bool fragile, bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-09-26 15:25:14 +00:00
|
|
|
int Ascii(Buffer const *, std::ostream &, int linelen) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int Linuxdoc(Buffer const *, std::ostream &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int DocBook(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// what appears in the minibuffer when opening
|
2000-09-14 17:53:12 +00:00
|
|
|
string const EditMessage() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
void Edit(BufferView *, int, int, unsigned int);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-08 13:52:57 +00:00
|
|
|
EDITABLE Editable() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const;
|
|
|
|
///
|
2000-10-10 11:50:43 +00:00
|
|
|
Inset * Clone(Buffer const &) const;
|
1999-10-19 15:06:30 +00:00
|
|
|
///
|
|
|
|
static void CloseInfoCB(FL_OBJECT *, long data);
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string contents;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
FL_FORM * form;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
FL_OBJECT * strobj;
|
2000-07-17 18:27:53 +00:00
|
|
|
///
|
|
|
|
LyXFont labelfont;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|