AbaKus – a complex calculator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dcopIface.h 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef ABAKUS_DCOP_IFACE
  2. #define ABAKUS_DCOP_IFACE
  3. /*
  4. * dcopIface.h - part of abakus
  5. * Copyright (C) 2004, 2005 Michael Pyne <michael.pyne@kdemail.net>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include <kdebug.h>
  22. #include <dcopobject.h>
  23. #include <tqstring.h>
  24. #include "mainwindow.h"
  25. #include "numerictypes.h"
  26. #include "function.h"
  27. class AbakusIface : virtual public DCOPObject
  28. {
  29. K_DCOP
  30. public:
  31. AbakusIface() : DCOPObject("Calculator")
  32. {
  33. }
  34. k_dcop:
  35. virtual double evaluate(const TQString &expr)
  36. {
  37. Abakus::number_t result = parseString(expr.latin1());
  38. return result.asDouble();
  39. }
  40. };
  41. #endif