]> git.lyx.org Git - lyx.git/blob - src/insets/insetparent.C
clear()->erase() ; lots of using directives for cxx
[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
28 using std::ostream;
29
30 InsetParent::InsetParent(string const & fn, Buffer * owner)
31         : InsetCommand("lyxparent")
32 {
33         if (owner)
34                 setContents(MakeAbsPath(fn, OnlyPath(owner->fileName())));
35         else
36                 setContents(fn);
37 }
38
39
40 string 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().c_str());
50 }
51
52
53 // LaTeX must just ignore this command
54 int InsetParent::Latex(ostream & os,
55                        bool fragile, bool free_spc) const
56 {
57         os << "%%#{lyx}";
58         InsetCommand::Latex(os, fragile, free_spc);
59         return 0;
60 }