mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 14:32:04 +00:00
2a31934f38
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8766 a592a061-630c-0410-9148-cb99ea01b6c8
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/**
|
|
* \file ControlCommand.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "ControlCommand.h"
|
|
|
|
#include "funcrequest.h"
|
|
#include "insets/insetcommand.h"
|
|
|
|
|
|
using std::string;
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
|
|
: Dialog::Controller(dialog),
|
|
lfun_name_(lfun_name)
|
|
{}
|
|
|
|
|
|
bool ControlCommand::initialiseParams(string const & data)
|
|
{
|
|
// The name passed with LFUN_INSET_APPLY is also the name
|
|
// used to identify the mailer.
|
|
InsetCommandMailer::string2params(lfun_name_, data, params_);
|
|
return true;
|
|
}
|
|
|
|
|
|
void ControlCommand::clearParams()
|
|
{
|
|
params_ = InsetCommandParams();
|
|
}
|
|
|
|
|
|
void ControlCommand::dispatchParams()
|
|
{
|
|
if (lfun_name_.empty())
|
|
return;
|
|
|
|
string const lfun = InsetCommandMailer::params2string(lfun_name_,
|
|
params_);
|
|
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
|
|
}
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|