kglobal.h
/* This file is part of the KDE libraries
Copyright (C) 1999 Sirtaj Singh Kanq <taj@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KGLOBAL_H
#define _KGLOBAL_H
#include "kdelibs_export.h"
#include <kinstance.h> // KDE4: class KInstance is enough here
class KCharsets;
class KConfig;
class KSharedConfig;
class KIconLoader;
class KLocale;
class KStandardDirs;
class KStaticDeleterBase;
class KStaticDeleterList;
class KStringDict;
class QString;
class KDECORE_EXPORT KGlobal
{
public:
static KInstance *instance();
static KStandardDirs *dirs();
static KConfig *config();
static KSharedConfig *sharedConfig();
static KIconLoader *iconLoader();
static KLocale *locale();
static KCharsets *charsets();
static const QString &staticQString(const char *str);
static const QString &staticQString(const QString &str);
static void registerStaticDeleter(KStaticDeleterBase *d);
static void unregisterStaticDeleter(KStaticDeleterBase *d);
static void deleteStaticDeleters();
//private:
static KStringDict *_stringDict;
static KInstance *_instance;
static KLocale *_locale;
static KCharsets *_charsets;
static KStaticDeleterList *_staticDeleters;
static void setActiveInstance(KInstance *d);
static KInstance *activeInstance() { return _activeInstance; }
static KInstance *_activeInstance;
};
#define KMIN(a,b) kMin(a,b)
#define KMAX(a,b) kMax(a,b)
#define KABS(a) kAbs(a)
#define KCLAMP(x,low,high) kClamp(x,low,high)
// XXX KDE4: Make kMin, kMax and kClamp return "T" instead of "const T &"!
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; }
template<class T>
inline const T& kClamp( const T& x, const T& low, const T& high )
{
if ( x < low ) return low;
else if ( high < x ) return high;
else return x;
}
int KDECORE_EXPORT kasciistricmp( const char *str1, const char *str2 );
#endif // _KGLOBAL_H
KSharedConfig
KConfig variant using shared memory.
Definition: kconfig.h:273
KCharsets
Charset font and encoder/decoder handling.
Definition: kcharsets.h:43
KStandardDirs
Site-independent access to standard KDE directories.
Definition: kstandarddirs.h:125
KInstance
Access to KDE global objects for use in shared libraries.
Definition: kinstance.h:43
KGlobal
Access to the KDE global objects.
Definition: kglobal.h:44
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KLocale
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:124
KStaticDeleterBase
Static deleters are used to manage static resources.
Definition: kstaticdeleter.h:39
KIconLoader
Iconloader for KDE.
Definition: kiconloader.h:77

KDE Home | KDE Accessibility Home | Description of Access Keys