3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS
14 #include "insetlabel.h"
16 #include "BufferView.h"
17 #include "funcrequest.h"
21 #include "support/lstrings.h"
22 #include "support/LOstream.h"
23 #include "support/lstrings.h" //frontStrip, strip
30 InsetLabel::InsetLabel(InsetCommandParams const & p)
35 // InsetLabel::InsetLabel(InsetCommandParams const & p, bool)
36 // : InsetCommand(p, false)
40 InsetLabel::~InsetLabel()
42 InsetCommandMailer mailer("label", *this);
47 vector<string> const InsetLabel::getLabelList() const
49 return vector<string>(1, getContents());
53 dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
55 Inset::RESULT result = UNDISPATCHED;
60 InsetCommandMailer("label", *this).showDialog(cmd.view());
64 case LFUN_INSET_MODIFY: {
66 InsetCommandMailer::string2params(cmd.argument, p);
67 if (p.getCmdName().empty())
71 if (view() && p.getContents() != params().getContents()) {
72 clean = view()->ChangeRefsIfUnique(params().getContents(),
77 cmd.view()->updateInset(this);
83 result = InsetCommand::localDispatch(cmd);
90 int InsetLabel::latex(Buffer const *, ostream & os,
91 LatexRunParams const &) const
93 os << escape(getCommand());
98 int InsetLabel::ascii(Buffer const *, ostream & os, int) const
100 os << '<' << getContents() << '>';
105 int InsetLabel::linuxdoc(Buffer const *, ostream & os) const
107 os << "<label id=\"" << getContents() << "\" >";
112 int InsetLabel::docbook(Buffer const *, ostream & os, bool) const
114 os << "<anchor id=\"" << getContents() << "\">";