1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
|
|
|
* \file insetparent.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_PARENT_H
|
|
|
|
#define INSET_PARENT_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
|
|
class Buffer;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** Reference to the parent document.
|
|
|
|
|
|
|
|
Useful to load a parent document from a child document and to
|
2002-03-21 17:09:55 +00:00
|
|
|
share parent's properties between preambleless children.
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
1999-11-24 22:14:46 +00:00
|
|
|
class InsetParent : public InsetCommand {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetParent(InsetCommandParams const &, Buffer const &, bool same_id = false);
|
2000-08-04 13:12:30 +00:00
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
virtual Inset * clone(Buffer const & buffer, bool same_id = false) const {
|
|
|
|
return new InsetParent(params(), buffer, same_id);
|
2000-10-10 11:50:43 +00:00
|
|
|
}
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
2001-07-28 12:24:16 +00:00
|
|
|
string const getScreenLabel(Buffer const *) const;
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
|
|
|
Inset::Code lyxCode() const { return Inset::PARENT_CODE; }
|
|
|
|
///
|
2002-05-26 17:33:14 +00:00
|
|
|
void edit(BufferView *, int, int, mouse_button::state);
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
|
|
|
void edit(BufferView * bv, bool front = true);
|
2002-03-21 17:09:55 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int latex(Buffer const *, std::ostream &,
|
2002-03-21 17:09:55 +00:00
|
|
|
bool fragile, bool free_spc) const;
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
|
|
|
void setParent(string fn) { setContents(fn); }
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|