KOffice – TDE office suite
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.

62 lines
1.7KB

  1. /* This file is part of the KDE project
  2. Copyright 2004 Tomas Mecir <mecirt@gmail.com>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. * Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef KSPREAD_VALUECONVERTER
  17. #define KSPREAD_VALUECONVERTER
  18. class TDELocale;
  19. #include "kspread_value.h"
  20. namespace KSpread {
  21. class ValueParser;
  22. /**
  23. The ValueConverter class can convert Value between various different
  24. formats.
  25. */
  26. class ValueConverter {
  27. public:
  28. /** constructor */
  29. ValueConverter (ValueParser *parser);
  30. Value asBoolean (const Value &value) const;
  31. Value asInteger (const Value &value) const;
  32. Value asFloat (const Value &value) const;
  33. /** convert to a numeric value - not necessarily float */
  34. Value asNumeric (const Value &value) const;
  35. Value asString (const Value &value) const;
  36. Value asDateTime (const Value &value) const;
  37. Value asDate (const Value &value) const;
  38. Value asTime (const Value &value) const;
  39. TDELocale* locale();
  40. private:
  41. ValueParser *parser;
  42. };
  43. } //KSpread namespace
  44. #endif //KSPREAD_VALUECONVERTER