kglobalsettings.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 David Faure <faure@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 _KGLOBALSETTINGS_H 00019 #define _KGLOBALSETTINGS_H 00020 00021 #include <qstring.h> 00022 #include <qcolor.h> 00023 #include <qfont.h> 00024 #include "kdelibs_export.h" 00025 00026 #define KDE_DEFAULT_SINGLECLICK false 00027 #define KDE_DEFAULT_INSERTTEAROFFHANDLES 0 00028 #define KDE_DEFAULT_AUTOSELECTDELAY -1 00029 #define KDE_DEFAULT_CHANGECURSOR true 00030 #define KDE_DEFAULT_LARGE_CURSOR false 00031 #define KDE_DEFAULT_VISUAL_ACTIVATE true 00032 #define KDE_DEFAULT_VISUAL_ACTIVATE_SPEED 50 00033 #define KDE_DEFAULT_WHEEL_ZOOM false 00034 #define KDE_DEFAULT_ICON_ON_PUSHBUTTON false 00035 #define KDE_DEFAULT_OPAQUE_RESIZE true 00036 #define KDE_DEFAULT_BUTTON_LAYOUT 0 00037 00038 class KURL; 00039 00046 class KDECORE_EXPORT KGlobalSettings 00047 { 00048 public: 00049 00093 static int dndEventDelay(); 00094 00101 static bool singleClick(); 00102 00109 enum TearOffHandle { 00110 Disable = 0, 00111 ApplicationLevel, 00112 Enable 00113 }; 00114 00120 static TearOffHandle insertTearOffHandle(); 00121 00126 static bool changeCursorOverIcon(); 00127 00133 static bool visualActivate(); 00134 00140 static unsigned int visualActivateSpeed(); 00141 00147 static int autoSelectDelay(); 00148 00155 static int contextMenuKey (); 00156 00163 static bool showContextMenusOnPress (); 00164 00170 enum Completion { 00174 CompletionNone=1, 00178 CompletionAuto, 00182 CompletionMan, 00186 CompletionShell, 00190 CompletionPopup, 00195 CompletionPopupAuto 00196 }; 00197 00203 static Completion completionMode(); 00204 00208 struct KMouseSettings 00209 { 00210 enum { RightHanded = 0, LeftHanded = 1 }; 00211 int handed; // left or right 00212 }; 00213 00219 static KMouseSettings & mouseSettings(); 00220 00225 static QString desktopPath() { initStatic(); return *s_desktopPath; } 00226 00231 static QString autostartPath() { initStatic(); return *s_autostartPath; } 00232 00238 static QString trashPath() { initStatic(); return *s_trashPath; } 00239 // KDE4: if you want to remove the above, move it to kdesktop/init.cc, which needs 00240 // to know the old location of the trash 00241 00246 static QString documentPath() { initStatic(); return *s_documentPath; } 00247 00248 00253 static QColor toolBarHighlightColor(); 00254 00259 static QColor inactiveTitleColor(); 00260 00265 static QColor inactiveTextColor(); 00266 00271 static QColor activeTitleColor(); 00272 00277 static QColor activeTextColor(); 00278 00284 static int contrast(); 00285 00291 static QColor baseColor(); 00292 00298 static QColor textColor(); 00299 00304 static QColor linkColor(); 00305 00310 static QColor visitedLinkColor(); 00311 00317 static QColor highlightedTextColor(); 00318 00324 static QColor highlightColor(); 00325 00334 static QColor alternateBackgroundColor(); 00335 00343 static QColor calculateAlternateBackgroundColor(const QColor& base); 00344 00345 00350 static QFont generalFont(); 00351 00356 static QFont fixedFont(); 00357 00362 static QFont toolBarFont(); 00363 00368 static QFont menuFont(); 00369 00374 static QFont windowTitleFont(); 00375 00380 static QFont taskbarFont(); 00381 00388 static QFont largeFont(const QString &text = QString::null); 00389 00397 static bool isMultiHead(); 00398 00411 static bool wheelMouseZooms(); 00412 00423 static QRect splashScreenDesktopGeometry(); 00424 00441 static QRect desktopGeometry(const QPoint& point); 00442 00456 static QRect desktopGeometry(QWidget* w); 00457 00466 static bool showIconsOnPushButtons(); 00467 00476 static bool showFilePreview(const KURL &); 00477 00486 static bool opaqueResize(); 00487 00495 static int buttonLayout(); 00496 00497 private: 00501 static void initStatic(); 00505 static void initColors(); 00509 static void rereadFontSettings(); 00513 static void rereadPathSettings(); 00517 static void rereadMouseSettings(); 00518 00519 00520 static QString* s_desktopPath; 00521 static QString* s_autostartPath; 00522 static QString* s_trashPath; 00523 static QString* s_documentPath; 00524 static QFont *_generalFont; 00525 static QFont *_fixedFont; 00526 static QFont *_toolBarFont; 00527 static QFont *_menuFont; 00528 static QFont *_windowTitleFont; 00529 static QFont *_taskbarFont; 00530 static QFont *_largeFont; 00531 static QColor * kde2Gray; 00532 static QColor * kde2Blue; 00533 static QColor * kde2AlternateColor; 00534 static KMouseSettings *s_mouseSettings; 00535 00536 friend class KApplication; 00537 }; 00538 00539 #endif