1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
2002-03-21 17:09:55 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1997-2001 LyX Team
|
2002-03-21 17:09:55 +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_PARENT_H
|
|
|
|
#define INSET_PARENT_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|