]> git.lyx.org Git - lyx.git/blob - src/insets/insetparent.C
STRCONV() all over the place
[lyx.git] / src / insets / insetparent.C
1 /**
2  * \file insetparent.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alejandro Aguilar Sierra
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11
12 // Created by asierra 970813
13
14 #include <config.h>
15
16
17
18 #include "insetparent.h"
19 #include "support/filetools.h"
20 #include "BufferView.h"
21 #include "frontends/LyXView.h"
22 #include "support/LOstream.h"
23 #include "funcrequest.h"
24 #include "buffer.h"
25 #include "gettext.h"
26
27 #include "support/BoostFormat.h"
28
29 using std::ostream;
30
31
32 InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
33         : InsetCommand(p)
34 {
35         string const fn = p.getContents();
36         setContents(MakeAbsPath(fn, bf.filePath()));
37 }
38
39
40 string const InsetParent::getScreenLabel(Buffer const *) const
41 {
42 #if USE_BOOST_FORMAT
43         return STRCONV(boost::io::str(boost::format(_("Parent: %s"))
44                 % STRCONV(getContents())));
45 #else
46         return _("Parent: ") + getContents();
47 #endif
48 }
49
50
51 void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
52 {
53         bv->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
54 }
55
56
57 void InsetParent::edit(BufferView * bv, bool)
58 {
59         edit(bv, 0, 0, mouse_button::none);
60 }
61
62
63 // LaTeX must just ignore this command
64 int InsetParent::latex(Buffer const * buf, ostream & os,
65                        bool fragile, bool free_spc) const
66 {
67         os << "%%#{lyx}";
68         InsetCommand::latex(buf, os, fragile, free_spc);
69         return 0;
70 }