From 47d455dd55be855e4cc691c32f687f723d9247ee Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kviewshell/units.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 kviewshell/units.h (limited to 'kviewshell/units.h') diff --git a/kviewshell/units.h b/kviewshell/units.h new file mode 100644 index 00000000..48708c01 --- /dev/null +++ b/kviewshell/units.h @@ -0,0 +1,34 @@ +// units.h +// +// Part of KVIEWSHELL - A framework for multipage text/gfx viewers +// +// (C) 2003 Stefan Kebekus +// Distributed under the GPL + +// Add header files alphabetically + +#ifndef UNITS_H +#define UNITS_H + +class QString; + +class distance { + public: + // This method converts a string that gives a distance in one of the + // commonly used units, such as "12.3mm", "12 inch" or "15 didot" to + // millimeters. For a complete list of supported units, see the + // static lists that are hardcoded in "units.cpp". + // + // If the conversion is not possible *ok is set to "false" and an + // undefined value is returned. If the unit could not be recognized, + // an error message is printed via kdError(). Otherwise, *ok is set + // to true. + // + // It is possible in rare circumstances that ok is set to true + // although the string is malformed. + // + // It is fine to set ok to 0. + static float convertToMM(const QString &distance, bool *ok=0); +}; + +#endif -- cgit v1.2.1