00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _TDEGLOBAL_H
00019 #define _TDEGLOBAL_H
00020
00021 #include "tdelibs_export.h"
00022 #include <kinstance.h>
00023
00024 class KCharsets;
00025 class TDEConfig;
00026 class TDESharedConfig;
00027 class TDEIconLoader;
00028 class TDEHardwareDevices;
00029 class TDEGlobalNetworkManager;
00030 class TDELocale;
00031 class TDEStandardDirs;
00032 class KStaticDeleterBase;
00033 class KStaticDeleterList;
00034 class KStringDict;
00035 class TQString;
00036
00046 class TDECORE_EXPORT TDEGlobal
00047 {
00048 public:
00049
00056 static TDEInstance *instance();
00057
00062 static TDEStandardDirs *dirs();
00063
00068 static TDEConfig *config();
00069
00074 static TDESharedConfig *sharedConfig();
00075
00080 static TDEIconLoader *iconLoader();
00081
00086 static TDEHardwareDevices *hardwareDevices();
00087
00092 static TDEGlobalNetworkManager *networkManager();
00093
00098 static TDELocale *locale();
00099
00104 static KCharsets *charsets();
00105
00123 static const TQString &staticQString(const char *str);
00124
00142 static const TQString &staticQString(const TQString &str);
00143
00150 static void registerStaticDeleter(KStaticDeleterBase *d);
00151
00158 static void unregisterStaticDeleter(KStaticDeleterBase *d);
00159
00166 static void deleteStaticDeleters();
00167
00168
00169 static KStringDict *_stringDict;
00170 static TDEInstance *_instance;
00171 static TDELocale *_locale;
00172 static KCharsets *_charsets;
00173 static KStaticDeleterList *_staticDeleters;
00174
00181 static void setActiveInstance(TDEInstance *d);
00182 static TDEInstance *activeInstance() { return _activeInstance; }
00183
00184 static TDEInstance *_activeInstance;
00185 };
00186
00191 #define KMIN(a,b) kMin(a,b)
00192
00196 #define KMAX(a,b) kMax(a,b)
00197
00201 #define KABS(a) kAbs(a)
00202
00207 #define KCLAMP(x,low,high) kClamp(x,low,high)
00208
00209
00210 template<class T>
00211 inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; }
00212
00213 template<class T>
00214 inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; }
00215
00216 template<class T>
00217 inline T kAbs (const T& a) { return a < 0 ? -a : a; }
00218
00219 template<class T>
00220 inline const T& kClamp( const T& x, const T& low, const T& high )
00221 {
00222 if ( x < low ) return low;
00223 else if ( high < x ) return high;
00224 else return x;
00225 }
00226
00233 int TDECORE_EXPORT kasciistricmp( const char *str1, const char *str2 );
00234
00235
00250 #endif // _TDEGLOBAL_H
00251