KDEUI
kglobalsettings.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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 #define KDE_DEFAULT_ICON_ON_PUSHBUTTON true
00035 #define KDE_DEFAULT_OPAQUE_RESIZE true
00036 #define KDE_DEFAULT_BUTTON_LAYOUT 0
00037 #define KDE_DEFAULT_SHADE_SORT_COLUMN true
00038 #define KDE_DEFAULT_ALLOW_DEFAULT_BACKGROUND_IMAGES true
00039 #define KDE_DEFAULT_NATURAL_SORTING true
00040
00041 class KUrl;
00042
00043 class QColor;
00044 class QFont;
00045 class QPoint;
00046 class QRect;
00047 class QWidget;
00048
00054 class KDEUI_EXPORT KGlobalSettings : public QObject
00055 {
00056 Q_OBJECT
00057
00058 public:
00059 ~KGlobalSettings();
00060
00104 static int dndEventDelay();
00105
00112 static bool singleClick();
00113
00119 static bool smoothScroll();
00120
00126 enum TearOffHandle {
00127 Disable = 0,
00128 ApplicationLevel,
00129 Enable
00130 };
00131
00136 static TearOffHandle insertTearOffHandle();
00137
00142 static bool changeCursorOverIcon();
00143
00149 static int autoSelectDelay();
00150
00158 static KDE_DEPRECATED int contextMenuKey ();
00159
00166 static bool showContextMenusOnPress ();
00167
00173 enum Completion {
00177 CompletionNone=1,
00181 CompletionAuto,
00185 CompletionMan,
00189 CompletionShell,
00193 CompletionPopup,
00198 CompletionPopupAuto
00199 };
00200
00206 static Completion completionMode();
00207
00211 struct KMouseSettings
00212 {
00213 enum { RightHanded = 0, LeftHanded = 1 };
00214 int handed;
00215 };
00216
00222 static KMouseSettings & mouseSettings();
00223
00228 static QString desktopPath();
00229
00234 static QString autostartPath();
00235
00240 static QString documentPath();
00241
00246 static QString musicPath();
00247
00252 static QString videosPath();
00253
00258 static QString downloadPath();
00259
00264 static QString picturesPath();
00265
00270 static QColor inactiveTitleColor();
00271
00276 static QColor inactiveTextColor();
00277
00282 static QColor activeTitleColor();
00283
00288 static QColor activeTextColor();
00289
00295 static int contrast();
00296
00304 static qreal contrastF(const KSharedConfigPtr &config = KSharedConfigPtr());
00305
00311 static bool shadeSortColumn();
00312
00319 static bool allowDefaultBackgroundImages();
00320
00325 static QFont generalFont();
00326
00331 static QFont fixedFont();
00332
00337 static QFont toolBarFont();
00338
00343 static QFont menuFont();
00344
00349 static QFont windowTitleFont();
00350
00355 static QFont taskbarFont();
00356
00362 static QFont largeFont(const QString &text = QString());
00363
00368 static QFont smallestReadableFont();
00369
00377 static bool isMultiHead();
00378
00390 static bool wheelMouseZooms();
00391
00401 static QRect splashScreenDesktopGeometry();
00402
00418 static QRect desktopGeometry(const QPoint& point);
00419
00432 static QRect desktopGeometry(const QWidget* w);
00433
00440 static bool showIconsOnPushButtons();
00441
00456 static bool naturalSorting();
00457
00458 enum GraphicEffect {
00459 NoEffects = 0x0000,
00460 GradientEffects = 0x0001,
00461 SimpleAnimationEffects = 0x0002,
00462 ComplexAnimationEffects = 0x0006
00463
00464 };
00465
00466 Q_DECLARE_FLAGS(GraphicEffects, GraphicEffect)
00467
00468
00473 static GraphicEffects graphicEffectsLevel();
00474
00481 static GraphicEffects graphicEffectsLevelDefault();
00482
00489 static bool showFilePreview(const KUrl &);
00490
00497 static bool opaqueResize();
00498
00504 static int buttonLayout();
00505
00516 static QPalette createApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
00517
00522 enum ChangeType { PaletteChanged = 0, FontChanged, StyleChanged,
00523 SettingsChanged, IconChanged, CursorChanged,
00524 ToolbarStyleChanged, ClipboardConfigChanged,
00525 BlockShortcuts, NaturalSortingChanged };
00526
00533 static void emitChange(ChangeType changeType, int arg = 0);
00534
00539 static KGlobalSettings* self();
00540
00549 void activate();
00550
00554 enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS,
00555 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
00556
00557 Q_SIGNALS:
00568 void kdisplayPaletteChanged();
00569
00581 void kdisplayStyleChanged();
00582
00594 void kdisplayFontChanged();
00595
00602 void appearanceChanged();
00603
00607 void toolbarAppearanceChanged(int);
00608
00615 void settingsChanged(int category);
00616
00621 void iconChanged(int group);
00622
00626 void cursorChanged();
00627
00631 void blockShortcuts(int data);
00632
00637 void naturalSortingChanged();
00638
00639 private:
00640 friend class KApplication;
00641
00642 KGlobalSettings();
00643
00644 class Private;
00645 Private* const d;
00646
00647 Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int))
00648 };
00649
00650 Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::GraphicEffects)
00651
00652 #endif