43
43
Value func_xor(valVector args, ValueCalc *calc, FuncExtra *);
46
#ifndef KSPREAD_UNIT_TEST // Do not create/export the plugin in unit tests.
47
K_PLUGIN_FACTORY(LogicModulePluginFactory,
48
registerPlugin<LogicModule>();
50
K_EXPORT_PLUGIN(LogicModulePluginFactory("LogicModule"))
46
KSPREAD_EXPORT_FUNCTION_MODULE("logic", LogicModule)
54
49
LogicModule::LogicModule(QObject* parent, const QVariantList&)
55
: FunctionModule(parent, "logic", i18n("Logic Functions"))
59
QString LogicModule::descriptionFileName() const
61
return QString("logic.xml");
64
void LogicModule::registerFunctions()
66
FunctionRepository* repo = FunctionRepository::self();
50
: FunctionModule(parent)
69
54
f = new Function("FALSE", func_false);
70
55
f->setParamCount(0);
72
57
f = new Function("TRUE", func_true);
73
58
f->setParamCount(0);
75
60
f = new Function("NOT", func_not);
76
61
f->setParamCount(1);
78
63
f = new Function("AND", func_and);
79
64
f->setParamCount(1, -1);
80
65
f->setAcceptArray();
82
67
f = new Function("NAND", func_nand);
83
68
f->setParamCount(1, -1);
84
69
f->setAcceptArray();
86
71
f = new Function("NOR", func_nor);
87
72
f->setParamCount(1, -1);
88
73
f->setAcceptArray();
90
75
f = new Function("OR", func_or);
91
76
f->setParamCount(1, -1);
92
77
f->setAcceptArray();
94
79
f = new Function("XOR", func_xor);
95
80
f->setParamCount(1, -1);
96
81
f->setAcceptArray();
98
83
f = new Function("IF", func_if);
99
84
f->setParamCount(2, 3);
103
void LogicModule::removeFunctions()
88
QString LogicModule::descriptionFileName() const
105
// NOTE: The group name has to match the one in the xml description.
106
FunctionRepository::self()->remove("Logical");
90
return QString("logic.xml");