KDEUI
kglobalsettings.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000,2006 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., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef _KGLOBALSETTINGS_H 00019 #define _KGLOBALSETTINGS_H 00020 00021 #include <kdeui_export.h> 00022 #include <ksharedconfig.h> 00023 #include <QtCore/QObject> 00024 #include <QtCore/QString> 00025 #include <QtGui/QPalette> 00026 00027 #define KDE_DEFAULT_SINGLECLICK true 00028 #define KDE_DEFAULT_SMOOTHSCROLL true 00029 #define KDE_DEFAULT_INSERTTEAROFFHANDLES 0 00030 #define KDE_DEFAULT_AUTOSELECTDELAY -1 00031 #define KDE_DEFAULT_CHANGECURSOR true 00032 #define KDE_DEFAULT_LARGE_CURSOR false 00033 #define KDE_DEFAULT_WHEEL_ZOOM false 00034 #ifdef Q_WS_MAEMO_5 00035 #define KDE_DEFAULT_ICON_ON_PUSHBUTTON false 00036 #else 00037 #define KDE_DEFAULT_ICON_ON_PUSHBUTTON true 00038 #endif 00039 #define KDE_DEFAULT_OPAQUE_RESIZE true 00040 #define KDE_DEFAULT_BUTTON_LAYOUT 0 00041 #define KDE_DEFAULT_SHADE_SORT_COLUMN true 00042 #define KDE_DEFAULT_ALLOW_DEFAULT_BACKGROUND_IMAGES true 00043 #define KDE_DEFAULT_NATURAL_SORTING true 00044 00045 class KUrl; 00046 00047 class QColor; 00048 class QFont; 00049 class QPoint; 00050 class QRect; 00051 class QWidget; 00052 00058 class KDEUI_EXPORT KGlobalSettings : public QObject 00059 { 00060 Q_OBJECT 00061 00062 public: 00063 ~KGlobalSettings(); 00064 00108 static int dndEventDelay(); 00109 00116 static bool singleClick(); 00117 00123 static bool smoothScroll(); 00124 00130 enum TearOffHandle { 00131 Disable = 0, 00132 ApplicationLevel, 00133 Enable 00134 }; 00135 00140 static TearOffHandle insertTearOffHandle(); 00141 00146 static bool changeCursorOverIcon(); 00147 00153 static int autoSelectDelay(); 00154 00162 #ifndef KDE_NO_DEPRECATED 00163 static KDE_DEPRECATED int contextMenuKey (); 00164 #endif 00165 00172 static bool showContextMenusOnPress (); 00173 00179 enum Completion { 00183 CompletionNone=1, 00187 CompletionAuto, 00191 CompletionMan, 00195 CompletionShell, 00199 CompletionPopup, 00204 CompletionPopupAuto 00205 }; 00206 00212 static Completion completionMode(); 00213 00217 struct KMouseSettings 00218 { 00219 enum { RightHanded = 0, LeftHanded = 1 }; 00220 int handed; // left or right 00221 }; 00222 00228 static KMouseSettings & mouseSettings(); 00229 00234 static QString desktopPath(); 00235 00240 static QString autostartPath(); 00241 00246 static QString documentPath(); 00247 00252 static QString musicPath(); 00253 00258 static QString videosPath(); 00259 00264 static QString downloadPath(); 00265 00270 static QString picturesPath(); 00271 00276 static QColor inactiveTitleColor(); 00277 00282 static QColor inactiveTextColor(); 00283 00288 static QColor activeTitleColor(); 00289 00294 static QColor activeTextColor(); 00295 00301 static int contrast(); 00302 00310 static qreal contrastF(const KSharedConfigPtr &config = KSharedConfigPtr()); 00311 00317 static bool shadeSortColumn(); 00318 00325 static bool allowDefaultBackgroundImages(); 00326 00331 static QFont generalFont(); 00332 00337 static QFont fixedFont(); 00338 00343 static QFont toolBarFont(); 00344 00349 static QFont menuFont(); 00350 00355 static QFont windowTitleFont(); 00356 00361 static QFont taskbarFont(); 00362 00368 static QFont largeFont(const QString &text = QString()); 00369 00374 static QFont smallestReadableFont(); 00375 00383 static bool isMultiHead(); 00384 00396 static bool wheelMouseZooms(); 00397 00407 static QRect splashScreenDesktopGeometry(); 00408 00424 static QRect desktopGeometry(const QPoint& point); 00425 00438 static QRect desktopGeometry(const QWidget* w); 00439 00446 static bool showIconsOnPushButtons(); 00447 00462 static bool naturalSorting(); 00463 00464 enum GraphicEffect { 00465 NoEffects = 0x0000, 00466 GradientEffects = 0x0001, 00467 SimpleAnimationEffects = 0x0002, 00468 ComplexAnimationEffects = 0x0006 00469 00470 }; 00471 00472 Q_DECLARE_FLAGS(GraphicEffects, GraphicEffect) 00473 00474 00479 static GraphicEffects graphicEffectsLevel(); 00480 00487 static GraphicEffects graphicEffectsLevelDefault(); 00488 00495 static bool showFilePreview(const KUrl &); 00496 00503 static bool opaqueResize(); 00504 00510 static int buttonLayout(); 00511 00522 static QPalette createApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr()); 00523 00528 enum ChangeType { PaletteChanged = 0, FontChanged, StyleChanged, 00529 SettingsChanged, IconChanged, CursorChanged, 00530 ToolbarStyleChanged, ClipboardConfigChanged, 00531 BlockShortcuts, NaturalSortingChanged }; 00532 00539 static void emitChange(ChangeType changeType, int arg = 0); 00540 00545 static KGlobalSettings* self(); 00546 00552 enum ActivateOption { 00553 ApplySettings = 0x1, 00554 ListenForChanges = 0x2 00555 }; 00556 Q_DECLARE_FLAGS(ActivateOptions, ActivateOption) 00557 00558 00566 void activate(); //KDE5: Merge with the overloaded method below 00567 00573 void activate(ActivateOptions options); 00574 00578 enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, 00579 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS }; 00580 00581 Q_SIGNALS: 00592 void kdisplayPaletteChanged(); 00593 00605 void kdisplayStyleChanged(); 00606 00618 void kdisplayFontChanged(); 00619 00626 void appearanceChanged(); 00627 00631 void toolbarAppearanceChanged(int); 00632 00639 void settingsChanged(int category); 00640 00645 void iconChanged(int group); 00646 00650 void cursorChanged(); 00651 00655 void blockShortcuts(int data); 00656 00661 void naturalSortingChanged(); 00662 00663 private: 00664 friend class KApplication; 00665 00666 KGlobalSettings(); 00667 00668 class Private; 00669 Private* const d; 00670 00671 Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int)) 00672 }; 00673 00674 Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::GraphicEffects) 00675 Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::ActivateOptions) 00676 00677 #endif
KDE 4.6 API Reference