1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright (C) 1997-1999 LyX Team
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-04 01:40:20 +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"
|
|
|
|
#include "gettext.h"
|
|
|
|
// Created by asierra 970813
|
|
|
|
|
|
|
|
/** Reference to the parent document.
|
|
|
|
|
|
|
|
Useful to load a parent document from a child document and to
|
|
|
|
share parent's properties between preambleless children.
|
|
|
|
*/
|
|
|
|
class InsetParent: public InsetCommand {
|
|
|
|
public:
|
|
|
|
/// Non-standard LyX macro
|
|
|
|
InsetParent(): InsetCommand("lyxparent") { }
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetParent(string fn, Buffer * owner=0);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
~InsetParent() {}
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Latex(FILE * file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int Latex(string & file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Inset * Clone() { return new InsetParent(getContents()); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string getScreenLabel() const { return string(_("Parent:"))+getContents(); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Edit(int, int);
|
|
|
|
///
|
|
|
|
unsigned char Editable() const {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const { return Inset::PARENT_CODE; }
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
void setParent(string fn) { setContents(fn); }
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|