*/
#include <config.h>
+#include <algorithm>
#include "InsetCommandParams.h"
#include "InsetBibtex.h"
#include "InsetCitation.h"
#include "InsetFloatList.h"
-#include "InsetHFill.h"
#include "InsetHyperlink.h"
#include "InsetInclude.h"
#include "InsetIndex.h"
using namespace std;
using namespace lyx::support;
+
namespace lyx {
-ParamInfo::ParamData::ParamData(std::string const & s, ParamType t) :
- name_(s), type_(t)
+/////////////////////////////////////////////////////////////////////
+//
+// ParamInfo::ParamData
+//
+/////////////////////////////////////////////////////////////////////
+
+ParamInfo::ParamData::ParamData(std::string const & s, ParamType t)
+ : name_(s), type_(t)
{}
}
+/////////////////////////////////////////////////////////////////////
+//
+// InsetCommandParams
+//
+/////////////////////////////////////////////////////////////////////
+
+
InsetCommandParams::InsetCommandParams(InsetCode code)
: insetCode_(code), preview_(false)
{
return InsetCitation::findInfo(cmdName);
case FLOAT_LIST_CODE:
return InsetFloatList::findInfo(cmdName);
- case HFILL_CODE:
- return InsetHFill::findInfo(cmdName);
case HYPERLINK_CODE:
return InsetHyperlink::findInfo(cmdName);
case INCLUDE_CODE:
}
+std::string InsetCommandParams::insetType() const
+{
+ return insetName(insetCode_);
+}
+
+
string InsetCommandParams::getDefaultCmd(InsetCode code) {
switch (code) {
case BIBITEM_CODE:
return InsetCitation::defaultCommand();
case FLOAT_LIST_CODE:
return InsetFloatList::defaultCommand();
- case HFILL_CODE:
- return InsetHFill::defaultCommand();
case HYPERLINK_CODE:
return InsetHyperlink::defaultCommand();
case INCLUDE_CODE:
return InsetCitation::isCompatibleCommand(s);
case FLOAT_LIST_CODE:
return InsetFloatList::isCompatibleCommand(s);
- case HFILL_CODE:
- return InsetHFill::isCompatibleCommand(s);
case HYPERLINK_CODE:
return InsetHyperlink::isCompatibleCommand(s);
case INCLUDE_CODE:
string const test = lex.getString();
if (test != "LatexCommand") {
lex.printError("InsetCommandParams: No LatexCommand line found.");
- throw ExceptionMessage(WarningException, _("InsetCommandParams error:"),
+ throw ExceptionMessage(WarningException, _("InsetCommandParams error: "),
_("Can't find LatexCommand line."));
}
}