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_INSERTTEAROFFHANDLES 0
00029 #define KDE_DEFAULT_AUTOSELECTDELAY -1
00030 #define KDE_DEFAULT_CHANGECURSOR true
00031 #define KDE_DEFAULT_LARGE_CURSOR false
00032 #define KDE_DEFAULT_WHEEL_ZOOM false
00033 #define KDE_DEFAULT_ICON_ON_PUSHBUTTON true
00034 #define KDE_DEFAULT_OPAQUE_RESIZE true
00035 #define KDE_DEFAULT_BUTTON_LAYOUT 0
00036 #define KDE_DEFAULT_SHADE_SORT_COLUMN true
00037 #define KDE_DEFAULT_ALLOW_DEFAULT_BACKGROUND_IMAGES true
00038
00039 class KUrl;
00040
00041 class QColor;
00042 class QFont;
00043 class QPoint;
00044 class QRect;
00045 class QWidget;
00046
00052 class KDEUI_EXPORT KGlobalSettings : public QObject
00053 {
00054 Q_OBJECT
00055
00056 public:
00057 ~KGlobalSettings();
00058
00102 static int dndEventDelay();
00103
00110 static bool singleClick();
00111
00117 enum TearOffHandle {
00118 Disable = 0,
00119 ApplicationLevel,
00120 Enable
00121 };
00122
00127 static TearOffHandle insertTearOffHandle();
00128
00133 static bool changeCursorOverIcon();
00134
00140 static int autoSelectDelay();
00141
00149 static KDE_DEPRECATED int contextMenuKey ();
00150
00157 static bool showContextMenusOnPress ();
00158
00164 enum Completion {
00168 CompletionNone=1,
00172 CompletionAuto,
00176 CompletionMan,
00180 CompletionShell,
00184 CompletionPopup,
00189 CompletionPopupAuto
00190 };
00191
00197 static Completion completionMode();
00198
00202 struct KMouseSettings
00203 {
00204 enum { RightHanded = 0, LeftHanded = 1 };
00205 int handed;
00206 };
00207
00213 static KMouseSettings & mouseSettings();
00214
00219 static QString desktopPath();
00220
00225 static QString autostartPath();
00226
00231 static QString documentPath();
00232
00233
00238 static QColor inactiveTitleColor();
00239
00244 static QColor inactiveTextColor();
00245
00250 static QColor activeTitleColor();
00251
00256 static QColor activeTextColor();
00257
00263 static int contrast();
00264
00272 static qreal contrastF(const KSharedConfigPtr &config = KSharedConfigPtr());
00273
00279 static bool shadeSortColumn();
00280
00287 static bool allowDefaultBackgroundImages();
00288
00293 static QFont generalFont();
00294
00299 static QFont fixedFont();
00300
00305 static QFont toolBarFont();
00306
00311 static QFont menuFont();
00312
00317 static QFont windowTitleFont();
00318
00323 static QFont taskbarFont();
00324
00330 static QFont largeFont(const QString &text = QString());
00331
00336 static QFont smallestReadableFont();
00337
00345 static bool isMultiHead();
00346
00358 static bool wheelMouseZooms();
00359
00369 static QRect splashScreenDesktopGeometry();
00370
00386 static QRect desktopGeometry(const QPoint& point);
00387
00400 static QRect desktopGeometry(const QWidget* w);
00401
00408 static bool showIconsOnPushButtons();
00409
00410 enum GraphicEffect {
00411 NoEffects = 0x0000,
00412 GradientEffects = 0x0001,
00413 SimpleAnimationEffects = 0x0002,
00414 ComplexAnimationEffects = 0x0006
00415
00416 };
00417
00418 Q_DECLARE_FLAGS(GraphicEffects, GraphicEffect)
00419
00420
00425 static GraphicEffects graphicEffectsLevel();
00426
00433 static GraphicEffects graphicEffectsLevelDefault();
00434
00441 static bool showFilePreview(const KUrl &);
00442
00449 static bool opaqueResize();
00450
00456 static int buttonLayout();
00457
00468 static QPalette createApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
00469
00474 enum ChangeType { PaletteChanged = 0, FontChanged, StyleChanged,
00475 SettingsChanged, IconChanged, CursorChanged,
00476 ToolbarStyleChanged, ClipboardConfigChanged,
00477 BlockShortcuts };
00478
00485 static void emitChange(ChangeType changeType, int arg = 0);
00486
00491 static KGlobalSettings* self();
00492
00496 enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS,
00497 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
00498
00499 Q_SIGNALS:
00506 void kdisplayPaletteChanged();
00507
00515 void kdisplayStyleChanged();
00516
00528 void kdisplayFontChanged();
00529
00536 void appearanceChanged();
00537
00541 void toolbarAppearanceChanged(int);
00542
00549 void settingsChanged(int category);
00550
00555 void iconChanged(int group);
00556
00560 void cursorChanged();
00561
00565 void blockShortcuts(int data);
00566
00567 private:
00568 friend class KApplication;
00569
00570 KGlobalSettings();
00571
00572 class Private;
00573 Private* const d;
00574
00575 Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int))
00576 };
00577
00578 Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::GraphicEffects)
00579
00580 #endif