diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kviewshell/units.h | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
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
Diffstat (limited to 'kviewshell/units.h')
-rw-r--r-- | kviewshell/units.h | 34 |
1 files changed, 34 insertions, 0 deletions
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 |