/* SPDX-FileCopyrightText: 2007 Barış Metin SPDX-FileCopyrightText: 2010 Matteo Agostinelli SPDX-FileCopyrightText: 2021 Alexander Lohnau SPDX-License-Identifier: LGPL-2.0-only */ #pragma once #include class QalculateEngine; #include #include /** * This class evaluates the basic expressions given in the interface. */ class CalculatorRunner : public KRunner::AbstractRunner { Q_OBJECT public: CalculatorRunner(QObject *parent, const KPluginMetaData &metaData); ~CalculatorRunner() override; void match(KRunner::RunnerContext &context) override; protected Q_SLOTS: void run(const KRunner::RunnerContext &context, const KRunner::QueryMatch &match) override; QMimeData *mimeDataForMatch(const KRunner::QueryMatch &match) override; private: QString calculate(const QString &term, bool *isApproximate, int base, const QString &customBase); void userFriendlyMultiplication(QString &cmd); void userFriendlySubstitutions(QString &cmd); std::unique_ptr m_engine; const KRunner::Actions m_actions; };