.TH "KGlobal" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KGlobal \- Access to the \fBKDE\fP global objects.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kglobal.h>\fP
.PP
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKInstance\fP * \fBinstance\fP ()"
.br
.ti -1c
.RI "static \fBKStandardDirs\fP * \fBdirs\fP ()"
.br
.ti -1c
.RI "static \fBKConfig\fP * \fBconfig\fP ()"
.br
.ti -1c
.RI "static \fBKSharedConfig\fP * \fBsharedConfig\fP ()"
.br
.ti -1c
.RI "static \fBKIconLoader\fP * \fBiconLoader\fP ()"
.br
.ti -1c
.RI "static \fBKLocale\fP * \fBlocale\fP ()"
.br
.ti -1c
.RI "static \fBKCharsets\fP * \fBcharsets\fP ()"
.br
.ti -1c
.RI "static const \fBQString\fP & \fBstaticQString\fP (const char *str)"
.br
.ti -1c
.RI "static const \fBQString\fP & \fBstaticQString\fP (const \fBQString\fP &str)"
.br
.ti -1c
.RI "static void \fBregisterStaticDeleter\fP (\fBKStaticDeleterBase\fP *d)"
.br
.ti -1c
.RI "static void \fBunregisterStaticDeleter\fP (\fBKStaticDeleterBase\fP *d)"
.br
.ti -1c
.RI "static void \fBdeleteStaticDeleters\fP ()"
.br
.ti -1c
.RI "static void \fBsetActiveInstance\fP (\fBKInstance\fP *d)"
.br
.ti -1c
.RI "static \fBKInstance\fP * \fBactiveInstance\fP ()"
.br
.in -1c
.SS "Static Public Attributes"

.in +1c
.ti -1c
.RI "static KStringDict * \fB_stringDict\fP = 0"
.br
.ti -1c
.RI "static \fBKInstance\fP * \fB_instance\fP = 0"
.br
.ti -1c
.RI "static \fBKLocale\fP * \fB_locale\fP = 0"
.br
.ti -1c
.RI "static \fBKCharsets\fP * \fB_charsets\fP = 0"
.br
.ti -1c
.RI "static KStaticDeleterList * \fB_staticDeleters\fP = 0"
.br
.ti -1c
.RI "static \fBKInstance\fP * \fB_activeInstance\fP = 0"
.br
.in -1c
.SS "Related Functions"
(Note that these are not member functions.) 
.in +1c
.ti -1c
.RI "KDECORE_EXPORT bool \fBcheckAccess\fP (const \fBQString\fP &pathname, int mode)"
.br
.ti -1c
.RI "\fBkdbgstream\fP & \fBendl\fP (\fBkdbgstream\fP &s)"
.br
.ti -1c
.RI "\fBkdbgstream\fP & \fBflush\fP (\fBkdbgstream\fP &s)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBkdbgstream\fP \fBkdDebug\fP (int area=0)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBkdBacktrace\fP ()"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBkdBacktrace\fP (int levels)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBkdbgstream\fP \fBkdWarning\fP (int area=0)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBkdbgstream\fP \fBkdError\fP (int area=0)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBkdbgstream\fP \fBkdFatal\fP (int area=0)"
.br
.ti -1c
.RI "KDECORE_EXPORT void \fBkdClearDebugConfig\fP ()"
.br
.ti -1c
.RI "\fBKMIN\fP(a, b)"
.br
.ti -1c
.RI "\fBKMAX\fP(a, b)"
.br
.ti -1c
.RI "\fBKABS\fP(a)"
.br
.ti -1c
.RI "\fBKCLAMP\fP(x, low, high)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Access to the \fBKDE\fP global objects. 

KGlobal provides you with pointers of many central objects that exist only once in the process. It is also responsible for managing instances of \fBKStaticDeleterBase\fP.
.PP
\fBSee also:\fP
.RS 4
\fBKStaticDeleterBase\fP 
.RE
.PP
\fBAuthor:\fP
.RS 4
Sirtaj Singh Kang (taj@kde.org) 
.RE
.PP

.PP
Definition at line 44 of file kglobal.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBKInstance\fP * KGlobal::instance ()\fC [static]\fP"
.PP
Returns the global instance. 
.PP
There is always at least one instance of a component in one application (in most cases the application itself). 
.PP
\fBReturns:\fP
.RS 4
the global instance 
.RE
.PP

.PP
Definition at line 81 of file kglobal.cpp.
.PP
Referenced by KApplication::caption(), KLocale::KLocale(), and KApplication::x11EventFilter().
.SS "\fBKStandardDirs\fP * KGlobal::dirs ()\fC [static]\fP"
.PP
Returns the application standard dirs object. 
.PP
\fBReturns:\fP
.RS 4
the global standard dir object 
.RE
.PP

.PP
Definition at line 53 of file kglobal.cpp.
.PP
References KInstance::dirs().
.PP
Referenced by KIconLoader::addExtraDesktopThemes(), KLocale::allCountriesTwoAlpha(), KConfigBackEnd::changeFileName(), KPalette::getPaletteList(), KDesktopFile::isAuthorizedDesktopFile(), KIconTheme::KIconTheme(), KLocale::langLookup(), KIconTheme::list(), KDesktopFile::locateLocal(), and KConfigINIBackEnd::parseConfigFiles().
.SS "\fBKConfig\fP * KGlobal::config ()\fC [static]\fP"
.PP
Returns the general config object. 
.PP
\fBReturns:\fP
.RS 4
the global configuration object. 
.RE
.PP

.PP
Definition at line 60 of file kglobal.cpp.
.PP
References KInstance::config().
.PP
Referenced by KApplication::authorize(), KApplication::authorizeControlModule(), KApplication::authorizeControlModules(), KCharsets::codecForName(), KApplication::createApplicationPalette(), KIconTheme::current(), KIconEffect::init(), KShortcutList::readSettings(), KShortcutList::writeSettings(), and KApplication::x11EventFilter().
.SS "\fBKSharedConfig\fP * KGlobal::sharedConfig ()\fC [static]\fP"
.PP
Returns the general config object. 
.PP
\fBReturns:\fP
.RS 4
the global configuration object. 
.RE
.PP

.PP
Definition at line 67 of file kglobal.cpp.
.PP
References KInstance::sharedConfig().
.PP
Referenced by KConfigSkeleton::KConfigSkeleton().
.SS "\fBKIconLoader\fP * KGlobal::iconLoader ()\fC [static]\fP"
.PP
Returns an iconloader object. 
.PP
\fBReturns:\fP
.RS 4
the global iconloader object 
.RE
.PP

.PP
Definition at line 74 of file kglobal.cpp.
.PP
References KInstance::iconLoader().
.PP
Referenced by KIconLoader::unknown().
.SS "\fBKLocale\fP * KGlobal::locale ()\fC [static]\fP"
.PP
Returns the global locale object. 
.PP
\fBReturns:\fP
.RS 4
the global locale object 
.RE
.PP

.PP
Definition at line 87 of file kglobal.cpp.
.PP
Referenced by KCharsets::codecForName(), KLocale::i18n(), KLocale::langLookup(), and KConfigBase::setLocale().
.SS "\fBKCharsets\fP * KGlobal::charsets ()\fC [static]\fP"
.PP
The global charset manager. 
.PP
\fBReturns:\fP
.RS 4
the global charset manager 
.RE
.PP

.PP
Definition at line 101 of file kglobal.cpp.
.PP
Referenced by KCharsets::descriptiveEncodingNames().
.SS "const \fBQString\fP & KGlobal::staticQString (const char * str)\fC [static]\fP"
.PP
Creates a static \fBQString\fP. 
.PP
To be used inside functions(!) like: 
.PP
.nf
 static const QString &myString = KGlobal::staticQString('myText');

.fi
.PP
.PP
!!! Do _NOT_ use: !!! 
.PP
.nf
 static QString myString = KGlobal::staticQString('myText');

.fi
.PP
 This creates a static object (instead of a static reference) and as you know static objects are EVIL. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to create 
.RE
.PP
\fBReturns:\fP
.RS 4
the static string 
.RE
.PP

.PP
Definition at line 125 of file kglobal.cpp.
.PP
Referenced by KApplication::authorizeKAction(), KStringHandler::from8Bit(), KIconLoader::iconPath(), KIconLoader::loadIcon(), KConfigBase::readEntry(), and KConfigBase::readListEntry().
.SS "const \fBQString\fP & KGlobal::staticQString (const \fBQString\fP & str)\fC [static]\fP"
.PP
Creates a static \fBQString\fP. 
.PP
To be used inside functions(!) like: 
.PP
.nf
 static const QString &myString = KGlobal::staticQString(i18n('My Text'));

.fi
.PP
.PP
!!! Do _NOT_ use: !!! 
.PP
.nf
 static QString myString = KGlobal::staticQString(i18n('myText'));

.fi
.PP
 This creates a static object (instead of a static reference) and as you know static objects are EVIL. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to create 
.RE
.PP
\fBReturns:\fP
.RS 4
the static string 
.RE
.PP

.PP
Definition at line 143 of file kglobal.cpp.
.PP
References QString::find(), and QString::insert().
.SS "void KGlobal::registerStaticDeleter (\fBKStaticDeleterBase\fP * d)\fC [static]\fP"
.PP
Registers a static deleter. 
.PP
\fBParameters:\fP
.RS 4
\fId\fP the static deleter to register 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKStaticDeleterBase\fP 
.PP
\fBKStaticDeleter\fP 
.RE
.PP

.PP
Definition at line 166 of file kglobal.cpp.
.PP
References QString::append().
.PP
Referenced by KStaticDeleter< type >::setObject().
.SS "void KGlobal::unregisterStaticDeleter (\fBKStaticDeleterBase\fP * d)\fC [static]\fP"
.PP
Unregisters a static deleter. 
.PP
\fBParameters:\fP
.RS 4
\fId\fP the static deleter to unregister 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKStaticDeleterBase\fP 
.PP
\fBKStaticDeleter\fP 
.RE
.PP

.PP
Definition at line 175 of file kglobal.cpp.
.PP
Referenced by KStaticDeleter< type >::setObject().
.SS "void KGlobal::deleteStaticDeleters ()\fC [static]\fP"
.PP
Calls \fBKStaticDeleterBase::destructObject()\fP on all registered static deleters and unregisters them all. 
.PP
\fBSee also:\fP
.RS 4
\fBKStaticDeleterBase\fP 
.PP
\fBKStaticDeleter\fP 
.RE
.PP

.PP
Definition at line 182 of file kglobal.cpp.
.SS "void KGlobal::setActiveInstance (\fBKInstance\fP * d)\fC [static]\fP"
.PP
The instance currently active (useful in a multi-instance application, such as a KParts application). 
.PP
Don't use this - it's mainly for \fBKAboutDialog\fP and \fBKBugReport\fP. 
.PP
Definition at line 111 of file kglobal.cpp.
.PP
References KLocale::setActiveCatalogue().
.PP
Referenced by KInstance::KInstance(), and KInstance::~KInstance().
.SH "Friends And Related Function Documentation"
.PP 
.SS "KDECORE_EXPORT bool checkAccess (const \fBQString\fP & pathname, int mode)\fC [related]\fP"
.PP
Check, if a file may be accessed in a given mode. 
.PP
This is a wrapper around the access() system call. \fBcheckAccess()\fP calls access() with the given parameters. If this is OK, \fBcheckAccess()\fP returns true. If not, and W_OK is part of mode, it is checked if there is write access to the directory. If yes, \fBcheckAccess()\fP returns true. In all other cases \fBcheckAccess()\fP returns false.
.PP
Other than access() this function EXPLICITLY ignores non-existant files if checking for write access.
.PP
\fBParameters:\fP
.RS 4
\fIpathname\fP The full path of the file you want to test 
.br
\fImode\fP The access mode, as in the access() system call. 
.RE
.PP
\fBReturns:\fP
.RS 4
Whether the access is allowed, true = Access allowed 
.RE
.PP

.PP
Definition at line 2823 of file kapplication.cpp.
.PP
References QString::findRev(), and QString::truncate().
.SS "KMIN(a, b)\fC [related]\fP"
.PP
A typesafe function to find the minimum of the two arguments. 
.PP
Definition at line 177 of file kglobal.h.
.SS "KMAX(a, b)\fC [related]\fP"
.PP
A typesafe function to find the maximum of the two arguments. 
.PP
Definition at line 182 of file kglobal.h.
.SS "KABS(a)\fC [related]\fP"
.PP
A typesafe function to determine the absolute value of the argument. 
.PP
Definition at line 187 of file kglobal.h.
.SS "KCLAMP(x, low, high)\fC [related]\fP"
.PP
A typesafe function that returns x if it's between low and high values. 
.PP
low if x is smaller than then low and high if x is bigger than high. 
.PP
Definition at line 193 of file kglobal.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
