summaryrefslogtreecommitdiffabout
path: root/microkde/kglobal.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (side-by-side diff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kglobal.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'microkde/kglobal.h') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kglobal.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/microkde/kglobal.h b/microkde/kglobal.h
new file mode 100644
index 0000000..1e03bea
--- a/dev/null
+++ b/microkde/kglobal.h
@@ -0,0 +1,68 @@
+#ifndef MINIKDE_KGLOBAL_H
+#define MINIKDE_KGLOBAL_H
+
+#include "klocale.h"
+#include "kconfig.h"
+#include "kiconloader.h"
+#include <kstandarddirs.h>
+#include <qevent.h>
+class KStandardDirs;
+class KGlobal {
+ public:
+ static KLocale *locale();
+ static KConfig *config();
+ static KIconLoader *iconLoader();
+ static KStandardDirs *dirs();
+ static int knumkeykonv( int );
+
+ static void setAppName( const QString & );
+ static QString formatMessage( QString mess, int maxlen ) ;
+
+//US begin: added the following methods for convenience
+ static QString getAppName();
+ static void setLocale(KLocale *);
+
+ enum Orientation { Portrait, Landscape };
+ enum Size { Small, Medium, Desktop };
+
+ static int getDesktopWidth();
+ static int getDesktopHeight();
+ static KGlobal::Size getDesktopSize();
+ static KGlobal::Orientation getOrientation();
+
+
+ private:
+ static KLocale *mLocale;
+ static KConfig *mConfig;
+ static KIconLoader *mIconLoader;
+ static KStandardDirs *mDirs;
+
+ static QString mAppName;
+};
+
+
+/** @ref KGlobal
+ * A typesafe function to find the minimum of the two arguments.
+ */
+#define KMIN(a,b) kMin(a,b)
+/** @ref KGlobal
+ * A typesafe function to find the maximum of the two arguments.
+ */
+#define KMAX(a,b) kMax(a,b)
+/** @ref KGlobal
+ * A typesafe function to determine the absolute value of the argument.
+ */
+#define KABS(a) kAbs(a)
+
+
+template<class T>
+inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; }
+
+template<class T>
+inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; }
+
+template<class T>
+inline T kAbs (const T& a) { return a < 0 ? -a : a; }
+
+
+#endif