not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / runners / calculator / calculatorrunner.h
blobea51369366f56a7359fabdaa8af2e6fa2c1bf092
1 /*
2 * Copyright (C) 2007 Barış Metin <baris@pardus.org.tr>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef CALCULATORRUNNER_H
20 #define CALCULATORRUNNER_H
22 #include <KGenericFactory>
24 #include <Plasma/AbstractRunner>
26 class QWidget;
28 /**
29 * This class evaluates the basic expressions given in the interface.
31 class CalculatorRunner : public Plasma::AbstractRunner
33 Q_OBJECT
35 public:
36 CalculatorRunner(QObject* parent, const QVariantList &args);
37 ~CalculatorRunner();
39 void match(Plasma::RunnerContext &context);
41 private:
42 QString calculate(const QString& term);
43 void userFriendlySubstitutions(QString& cmd);
44 void powSubstitutions(QString& cmd);
45 void hexSubstitutions(QString& cmd);
48 K_EXPORT_PLASMA_RUNNER(calculatorrunner, CalculatorRunner)
50 #endif