3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
8 * Full author contact details are available in file CREDITS
12 // Created by asierra 970813
18 #pragma implementation
21 #include "insetparent.h"
22 #include "support/filetools.h"
23 #include "BufferView.h"
24 #include "frontends/LyXView.h"
25 #include "support/LOstream.h"
26 #include "funcrequest.h"
30 #include "BoostFormat.h"
35 InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
38 string const fn = p.getContents();
39 setContents(MakeAbsPath(fn, bf.filePath()));
43 string const InsetParent::getScreenLabel(Buffer const *) const
46 return boost::io::str(boost::format(_("Parent: %s")) % getContents());
48 return _("Parent: ") + getContents();
53 void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
55 bv->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
59 void InsetParent::edit(BufferView * bv, bool)
61 edit(bv, 0, 0, mouse_button::none);
65 // LaTeX must just ignore this command
66 int InsetParent::latex(Buffer const * buf, ostream & os,
67 bool fragile, bool free_spc) const
70 InsetCommand::latex(buf, os, fragile, free_spc);