• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kglobal.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Sirtaj Singh Kanq <taj@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef _KGLOBAL_H
19 #define _KGLOBAL_H
20 
21 #include "kdelibs_export.h"
22 #include <kinstance.h> // KDE4: class KInstance is enough here
23 
24 class KCharsets;
25 class KConfig;
26 class KSharedConfig;
27 class KIconLoader;
28 class KLocale;
29 class KStandardDirs;
30 class KStaticDeleterBase;
31 class KStaticDeleterList;
32 class KStringDict;
33 class TQString;
34 
44 class KDECORE_EXPORT KGlobal
45 {
46 public:
47 
54  static KInstance *instance();
55 
60  static KStandardDirs *dirs();
61 
66  static KConfig *config();
67 
72  static KSharedConfig *sharedConfig();
73 
78  static KIconLoader *iconLoader();
79 
84  static KLocale *locale();
85 
90  static KCharsets *charsets();
91 
109  static const TQString &staticQString(const char *str);
110 
128  static const TQString &staticQString(const TQString &str);
129 
136  static void registerStaticDeleter(KStaticDeleterBase *d);
137 
144  static void unregisterStaticDeleter(KStaticDeleterBase *d);
145 
152  static void deleteStaticDeleters();
153 
154  //private:
155  static KStringDict *_stringDict;
156  static KInstance *_instance;
157  static KLocale *_locale;
158  static KCharsets *_charsets;
159  static KStaticDeleterList *_staticDeleters;
160 
167  static void setActiveInstance(KInstance *d);
168  static KInstance *activeInstance() { return _activeInstance; }
169 
170  static KInstance *_activeInstance;
171 };
172 
177 #define KMIN(a,b) kMin(a,b)
178 
182 #define KMAX(a,b) kMax(a,b)
183 
187 #define KABS(a) kAbs(a)
188 
193 #define KCLAMP(x,low,high) kClamp(x,low,high)
194 
195 // XXX KDE4: Make kMin, kMax and kClamp return "T" instead of "const T &"!
196 template<class T>
197 inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; }
198 
199 template<class T>
200 inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; }
201 
202 template<class T>
203 inline T kAbs (const T& a) { return a < 0 ? -a : a; }
204 
205 template<class T>
206 inline const T& kClamp( const T& x, const T& low, const T& high )
207 {
208  if ( x < low ) return low;
209  else if ( high < x ) return high;
210  else return x;
211 }
212 
219 int KDECORE_EXPORT kasciistricmp( const char *str1, const char *str2 );
220 
221 
236 #endif // _KGLOBAL_H
237 
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

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |