#include "support/LOstream.h"
#include "support/lstrings.h" //frontStrip, strip
+using namespace lyx::support;
+
using std::ostream;
using std::vector;
using std::pair;
-InsetLabel::InsetLabel(InsetCommandParams const & p, bool)
+InsetLabel::InsetLabel(InsetCommandParams const & p)
: InsetCommand(p)
{}
-InsetLabel::~InsetLabel()
-{
- InsetCommandMailer mailer("label", *this);
- mailer.hideDialog();
-}
+// InsetLabel::InsetLabel(InsetCommandParams const & p, bool)
+// : InsetCommand(p, false)
+// {}
-vector<string> const InsetLabel::getLabelList() const
+InsetLabel::~InsetLabel()
{
- return vector<string>(1, getContents());
+ InsetCommandMailer("label", *this).hideDialog();
}
-void InsetLabel::edit(BufferView * bv, int, int, mouse_button::state)
+void InsetLabel::getLabelList(std::vector<string> & list) const
{
- InsetCommandMailer mailer("label", *this);
- mailer.showDialog(bv);
+ list.push_back(getContents());
}
dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
{
- Inset::RESULT result = UNDISPATCHED;
+ InsetOld::RESULT result = UNDISPATCHED;
switch (cmd.action) {
+
+ case LFUN_INSET_EDIT:
+ InsetCommandMailer("label", *this).showDialog(cmd.view());
+ result = DISPATCHED;
+ break;
+
case LFUN_INSET_MODIFY: {
InsetCommandParams p;
InsetCommandMailer::string2params(cmd.argument, p);
}
setParams(p);
- cmd.view()->updateInset(this, !clean);
+ cmd.view()->updateInset(this);
result = DISPATCHED;
}
break;
}
-void InsetLabel::edit(BufferView * bv, bool)
-{
- edit(bv, 0, 0, mouse_button::none);
-}
-
-
int InsetLabel::latex(Buffer const *, ostream & os,
- bool /*fragile*/, bool /*fs*/) const
+ LatexRunParams const &) const
{
os << escape(getCommand());
return 0;
}
+
int InsetLabel::ascii(Buffer const *, ostream & os, int) const
{
os << '<' << getContents() << '>';