kdecore Library API Documentation

kglobal.h

00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Sirtaj Singh Kanq <taj@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 #ifndef _KGLOBAL_H 00019 #define _KGLOBAL_H 00020 00021 #include "kdemacros.h" 00022 #include <kinstance.h> // KDE4: class KInstance is enough here 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 //private: 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 00190 template<class T> 00191 inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; } 00192 00193 template<class T> 00194 inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; } 00195 00196 template<class T> 00197 inline T kAbs (const T& a) { return a < 0 ? -a : a; } 00198 00213 #endif // _KGLOBAL_H 00214
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:07:58 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003