]> git.lyx.org Git - lyx.git/blob - src/insets/insetparent.C
reformatting and remove using delc
[lyx.git] / src / insets / insetparent.C
1 /* This file is part of*
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *       
6  *           Copyright 1997-2000 The LyX Team.
7  * 
8  * ====================================================== */
9
10
11 // Created by asierra 970813
12
13 #include <config.h>
14
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "insetparent.h"
21 #include "support/filetools.h"
22 #include "BufferView.h"
23 #include "LyXView.h"
24 #include "lyxfunc.h"
25 #include "commandtags.h"
26 #include "buffer.h"
27 #include "gettext.h"
28
29 using std::ostream;
30
31
32 InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf)
33         : InsetCommand(p)
34 {
35         string const fn = p.getContents();
36         setContents(MakeAbsPath(fn, OnlyPath(bf.fileName())));
37 }
38
39
40 string const InsetParent::getScreenLabel() const 
41 {
42         return string(_("Parent:")) + getContents();
43 }
44
45
46 void InsetParent::Edit(BufferView * bv, int, int, unsigned int)
47 {    
48         bv->owner()->getLyXFunc()->
49                 Dispatch(LFUN_CHILDOPEN, getContents());
50 }
51
52
53 // LaTeX must just ignore this command
54 int InsetParent::Latex(Buffer const * buf, ostream & os,
55                        bool fragile, bool free_spc) const
56 {
57         os << "%%#{lyx}";
58         InsetCommand::Latex(buf, os, fragile, free_spc);
59         return 0;
60 }