lyx_mirror/src/frontends/controllers/ControlCommand.C
Angus Leeming 0de182f257 * Give Dialog::Controller::initialiseParams a bool return type.
* Constify many ButtonController/View methods.
* Try and document the code ;-)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6495 a592a061-630c-0410-9148-cb99ea01b6c8
2003-03-14 00:20:42 +00:00

50 lines
988 B
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 "Kernel.h"
#include "funcrequest.h"
#include "insets/insetcommand.h"
ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
: Dialog::Controller(dialog),
lfun_name_(lfun_name)
{}
bool ControlCommand::initialiseParams(string const & data)
{
InsetCommandMailer::string2params(data, params_);
return true;
}
void ControlCommand::clearParams()
{
params_.setCmdName(string());
params_.setOptions(string());
params_.setContents(string());
}
void ControlCommand::dispatchParams()
{
if (lfun_name_.empty())
return;
string const lfun = InsetCommandMailer::params2string(lfun_name_,
params_);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}