2000-02-25 12:06:15 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-02-25 13:35:38 +00:00
|
|
|
* Copyright 1998 The LyX Team.
|
2000-02-25 12:06:15 +00:00
|
|
|
*
|
|
|
|
*======================================================
|
|
|
|
*/
|
|
|
|
// The pristine updatable inset: Text
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef INSETERT_H
|
|
|
|
#define INSETERT_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
#include "insetcollapsable.h"
|
2000-02-25 12:06:15 +00:00
|
|
|
|
2001-07-24 22:08:49 +00:00
|
|
|
/** A collapsable text inset for LaTeX insertions.
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
|
|
To write full ert (including styles and other insets) in a given
|
|
|
|
space.
|
|
|
|
*/
|
2000-03-08 13:52:57 +00:00
|
|
|
class InsetERT : public InsetCollapsable {
|
2000-02-25 12:06:15 +00:00
|
|
|
public:
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
|
|
|
InsetERT();
|
|
|
|
///
|
2001-07-27 12:03:36 +00:00
|
|
|
InsetERT(InsetERT const &, bool same_id = false);
|
|
|
|
///
|
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
|
|
|
///
|
2001-07-23 09:11:14 +00:00
|
|
|
InsetERT(string const & contents, bool collapsed);
|
2001-07-08 12:52:16 +00:00
|
|
|
///
|
2001-07-27 12:03:36 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::ERT_CODE; }
|
|
|
|
///
|
2001-07-24 22:08:49 +00:00
|
|
|
void read(Buffer const * buf, LyXLex & lex);
|
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
void write(Buffer const * buf, std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
string const editMessage() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
bool insertInset(BufferView *, Inset *);
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
bool insetAllowed(Inset::Code) const { return false; }
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
void setFont(BufferView *, LyXFont const &,
|
2001-07-20 14:18:48 +00:00
|
|
|
bool toggleall = false, bool selectall = false);
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
void edit(BufferView *, int, int, unsigned int);
|
2001-06-27 14:10:35 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
void edit(BufferView * bv, bool front = true);
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
2001-07-24 22:08:49 +00:00
|
|
|
void insetButtonRelease(BufferView * bv, int x, int y, int button);
|
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
int latex(Buffer const *, std::ostream &, bool fragile,
|
2001-07-24 22:08:49 +00:00
|
|
|
bool free_spc) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
int ascii(Buffer const *,
|
2001-07-20 14:18:48 +00:00
|
|
|
std::ostream &, int linelen = 0) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
int linuxdoc(Buffer const *, std::ostream &) const;
|
|
|
|
///
|
|
|
|
int docBook(Buffer const *, std::ostream &) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
UpdatableInset::RESULT localDispatch(BufferView *, kb_action,
|
|
|
|
string const &);
|
2001-07-27 12:03:36 +00:00
|
|
|
///
|
|
|
|
bool checkInsertChar(LyXFont &);
|
|
|
|
|
2001-07-24 10:13:19 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
void init();
|
2001-07-24 22:08:49 +00:00
|
|
|
///
|
|
|
|
string const get_new_label() const;
|
2001-07-25 19:45:21 +00:00
|
|
|
///
|
|
|
|
void setButtonLabel();
|
2000-02-25 12:06:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|