KDECore
kglobal.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KGLOBAL_H
00019 #define _KGLOBAL_H
00020
00021 #include "kdelibs_export.h"
00022 #include <kinstance.h>
00023
00024 class KCharsets;
00025 class KConfig;
00026 class KSharedConfig;
00027 class KIconLoader;
00028 class KLocale;
00029 class KStandardDirs;
00030 class KStaticDeleterBase;
00031 class KStaticDeleterList;
00032 class KStringDict;
00033 class QString;
00034
00044 class KDECORE_EXPORT KGlobal
00045 {
00046 public:
00047
00054 static KInstance *instance();
00055
00060 static KStandardDirs *dirs();
00061
00066 static KConfig *config();
00067
00072 static KSharedConfig *sharedConfig();
00073
00078 static KIconLoader *iconLoader();
00079
00084 static KLocale *locale();
00085
00090 static KCharsets *charsets();
00091
00109 static const QString &staticQString(const char *str);
00110
00128 static const QString &staticQString(const QString &str);
00129
00136 static void registerStaticDeleter(KStaticDeleterBase *d);
00137
00144 static void unregisterStaticDeleter(KStaticDeleterBase *d);
00145
00152 static void deleteStaticDeleters();
00153
00154
00155 static KStringDict *_stringDict;
00156 static KInstance *_instance;
00157 static KLocale *_locale;
00158 static KCharsets *_charsets;
00159 static KStaticDeleterList *_staticDeleters;
00160
00167 static void setActiveInstance(KInstance *d);
00168 static KInstance *activeInstance() { return _activeInstance; }
00169
00170 static KInstance *_activeInstance;
00171 };
00172
00177 #define KMIN(a,b) kMin(a,b)
00178
00182 #define KMAX(a,b) kMax(a,b)
00183
00187 #define KABS(a) kAbs(a)
00188
00193 #define KCLAMP(x,low,high) kClamp(x,low,high)
00194
00195
00196 template<class T>
00197 inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; }
00198
00199 template<class T>
00200 inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; }
00201
00202 template<class T>
00203 inline T kAbs (const T& a) { return a < 0 ? -a : a; }
00204
00205 template<class T>
00206 inline const T& kClamp( const T& x, const T& low, const T& high )
00207 {
00208 if ( x < low ) return low;
00209 else if ( high < x ) return high;
00210 else return x;
00211 }
00212
00219 int KDECORE_EXPORT kasciistricmp( const char *str1, const char *str2 );
00220
00221
00236 #endif // _KGLOBAL_H
00237