kglobal.h
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 "kdemacros.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
00045 class KGlobal
00046 {
00047
public:
00048
00055
static KInstance *
instance();
00056
00061
static KStandardDirs *
dirs();
00062
00067
static KConfig *
config();
00068
00073
static KSharedConfig *
sharedConfig();
00074
00079
static KIconLoader *
iconLoader();
00080
00085
static KLocale *
locale();
00086
00091
static KCharsets *
charsets();
00092
00110
static const QString &
staticQString(
const char *str);
00111
00129
static const QString &
staticQString(
const QString &str);
00130
00137
static void registerStaticDeleter(
KStaticDeleterBase *d);
00138
00145
static void unregisterStaticDeleter(
KStaticDeleterBase *d);
00146
00153
static void deleteStaticDeleters();
00154
00155
00156
static KStringDict *_stringDict;
00157
static KInstance *_instance;
00158
static KLocale *_locale;
00159
static KCharsets *_charsets;
00160
static KStaticDeleterList *_staticDeleters;
00161
00168
static void setActiveInstance(
KInstance *d);
00169
static KInstance *activeInstance() {
return _activeInstance; }
00170
00171
static KInstance *_activeInstance;
00172 };
00173
00178 #define KMIN(a,b) kMin(a,b)
00179
00183 #define KMAX(a,b) kMax(a,b)
00184
00188 #define KABS(a) kAbs(a)
00189
00194 #define KCLAMP(x,low,high) kClamp(x,low,high)
00195
00196
00197
template<
class T>
00198
inline const T& kMin (
const T& a,
const T& b) {
return a < b ? a : b; }
00199
00200
template<
class T>
00201
inline const T& kMax (
const T& a,
const T& b) {
return b < a ? a : b; }
00202
00203
template<
class T>
00204
inline T kAbs (
const T& a) {
return a < 0 ? -a : a; }
00205
00206
template<
class T>
00207
inline const T& kClamp(
const T& x,
const T& low,
const T& high )
00208 {
00209
if ( x < low )
return low;
00210
else if ( high < x )
return high;
00211
else return x;
00212 }
00213
00228
#endif // _KGLOBAL_H
00229
This file is part of the documentation for kdecore Library Version 3.3.1.