• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • kernel
kglobalsettings.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000,2006 David Faure <faure@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 _KGLOBALSETTINGS_H
19#define _KGLOBALSETTINGS_H
20
21#include <kdeui_export.h>
22#include <ksharedconfig.h>
23#include <QtCore/QObject>
24#include <QtCore/QString>
25#include <QtGui/QPalette>
26
27#define KDE_DEFAULT_SINGLECLICK true
28#define KDE_DEFAULT_SMOOTHSCROLL true
29#define KDE_DEFAULT_INSERTTEAROFFHANDLES 0
30#define KDE_DEFAULT_AUTOSELECTDELAY -1
31#define KDE_DEFAULT_CHANGECURSOR true
32#define KDE_DEFAULT_LARGE_CURSOR false
33#define KDE_DEFAULT_WHEEL_ZOOM false
34#ifdef Q_WS_MAEMO_5
35#define KDE_DEFAULT_ICON_ON_PUSHBUTTON false
36#else
37#define KDE_DEFAULT_ICON_ON_PUSHBUTTON true
38#endif
39#define KDE_DEFAULT_OPAQUE_RESIZE true
40#define KDE_DEFAULT_BUTTON_LAYOUT 0
41#define KDE_DEFAULT_SHADE_SORT_COLUMN true
42#define KDE_DEFAULT_ALLOW_DEFAULT_BACKGROUND_IMAGES true
43#define KDE_DEFAULT_NATURAL_SORTING true
44
45class KUrl;
46
47class QColor;
48class QFont;
49class QPoint;
50class QRect;
51class QWidget;
52
58class KDEUI_EXPORT KGlobalSettings : public QObject
59{
60 Q_OBJECT
61
62public:
63 ~KGlobalSettings();
64
107
108 static int dndEventDelay();
109
116 static bool singleClick();
117
123 static bool smoothScroll();
124
130 enum TearOffHandle {
131 Disable = 0,
132 ApplicationLevel,
133 Enable
134 };
135
140 static TearOffHandle insertTearOffHandle();
141
146 static bool changeCursorOverIcon();
147
153 static int autoSelectDelay();
154
162#ifndef KDE_NO_DEPRECATED
163 static KDE_DEPRECATED int contextMenuKey ();
164#endif
165
172 static bool showContextMenusOnPress ();
173
179 enum Completion {
183 CompletionNone=1,
187 CompletionAuto,
191 CompletionMan,
195 CompletionShell,
199 CompletionPopup,
204 CompletionPopupAuto
205 };
206
212 static Completion completionMode();
213
217 struct KMouseSettings
218 {
219 enum { RightHanded = 0, LeftHanded = 1 };
220 int handed; // left or right
221 };
222
228 static KMouseSettings & mouseSettings();
229
234 static QString desktopPath();
235
240 static QString autostartPath();
241
246 static QString documentPath();
247
252 static QString musicPath();
253
258 static QString videosPath();
259
264 static QString downloadPath();
265
270 static QString picturesPath();
271
276 static QColor inactiveTitleColor();
277
282 static QColor inactiveTextColor();
283
288 static QColor activeTitleColor();
289
294 static QColor activeTextColor();
295
301 static int contrast();
302
310 static qreal contrastF(const KSharedConfigPtr &config = KSharedConfigPtr());
311
317 static bool shadeSortColumn();
318
325 static bool allowDefaultBackgroundImages();
326
331 static QFont generalFont();
332
337 static QFont fixedFont();
338
343 static QFont toolBarFont();
344
349 static QFont menuFont();
350
355 static QFont windowTitleFont();
356
361 static QFont taskbarFont();
362
368 static QFont largeFont(const QString &text = QString());
369
374 static QFont smallestReadableFont();
375
383 static bool isMultiHead();
384
396 static bool wheelMouseZooms();
397
407 static QRect splashScreenDesktopGeometry();
408
424 static QRect desktopGeometry(const QPoint& point);
425
438 static QRect desktopGeometry(const QWidget* w);
439
446 static bool showIconsOnPushButtons();
447
462 static bool naturalSorting();
463
464 enum GraphicEffect {
465 NoEffects = 0x0000,
466 GradientEffects = 0x0001,
467 SimpleAnimationEffects = 0x0002,
468 ComplexAnimationEffects = 0x0006
470 };
471
472 Q_DECLARE_FLAGS(GraphicEffects, GraphicEffect)
473
474
479 static GraphicEffects graphicEffectsLevel();
480
487 static GraphicEffects graphicEffectsLevelDefault();
488
495 static bool showFilePreview(const KUrl &);
496
503 static bool opaqueResize();
504
510 static int buttonLayout();
511
522 static QPalette createApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
523
537 static QPalette createNewApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
538
543 enum ChangeType { PaletteChanged = 0, FontChanged, StyleChanged,
544 SettingsChanged, IconChanged, CursorChanged,
545 ToolbarStyleChanged, ClipboardConfigChanged,
546 BlockShortcuts, NaturalSortingChanged };
547
554 static void emitChange(ChangeType changeType, int arg = 0);
555
560 static KGlobalSettings* self();
561
567 enum ActivateOption {
568 ApplySettings = 0x1,
569 ListenForChanges = 0x2
570 };
571 Q_DECLARE_FLAGS(ActivateOptions, ActivateOption)
572
573
581 void activate(); //KDE5: Merge with the overloaded method below
582
588 void activate(ActivateOptions options);
589
593 enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS,
594 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS,
595 SETTINGS_LOCALE, SETTINGS_STYLE };
596
597Q_SIGNALS:
608 void kdisplayPaletteChanged();
609
621 void kdisplayStyleChanged();
622
634 void kdisplayFontChanged();
635
642 void appearanceChanged();
643
647 void toolbarAppearanceChanged(int);
648
655 void settingsChanged(int category);
656
661 void iconChanged(int group);
662
666 void cursorChanged();
667
671 void blockShortcuts(int data);
672
677 void naturalSortingChanged();
678
679private:
680 friend class KApplication;
681
682 KGlobalSettings();
683
684 class Private;
685 Private* const d;
686
687 Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int))
688};
689
690Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::GraphicEffects)
691Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::ActivateOptions)
692
693#endif
KGlobalSettings
Access the KDE global configuration.
Definition kglobalsettings.h:59
KGlobalSettings::wheelMouseZooms
static bool wheelMouseZooms()
Typically, QScrollView derived classes can be scrolled fast by holding down the Ctrl-button during wh...
Definition kglobalsettings.cpp:707
KGlobalSettings::shadeSortColumn
static bool shadeSortColumn()
Returns if the sorted column in a K3ListView shall be drawn with a shaded background color.
Definition kglobalsettings.cpp:375
KGlobalSettings::inactiveTitleColor
static QColor inactiveTitleColor()
The default color to use for inactive titles.
Definition kglobalsettings.cpp:317
KGlobalSettings::desktopPath
static QString desktopPath()
The path to the desktop directory of the current user.
Definition kglobalsettings.cpp:626
KGlobalSettings::GraphicEffect
GraphicEffect
Definition kglobalsettings.h:464
KGlobalSettings::GradientEffects
@ GradientEffects
GUI with only gradients enabled.
Definition kglobalsettings.h:466
KGlobalSettings::ComplexAnimationEffects
@ ComplexAnimationEffects
GUI with complex animations enabled.
Definition kglobalsettings.h:468
KGlobalSettings::NoEffects
@ NoEffects
GUI with no effects at all.
Definition kglobalsettings.h:465
KGlobalSettings::SimpleAnimationEffects
@ SimpleAnimationEffects
GUI with simple animations enabled.
Definition kglobalsettings.h:467
KGlobalSettings::smallestReadableFont
static QFont smallestReadableFont()
Returns the smallest readable font.
Definition kglobalsettings.cpp:470
KGlobalSettings::blockShortcuts
void blockShortcuts(int data)
Emitted by BlockShortcuts.
KGlobalSettings::ChangeType
ChangeType
An identifier for change signals.
Definition kglobalsettings.h:543
KGlobalSettings::ToolbarStyleChanged
@ ToolbarStyleChanged
Definition kglobalsettings.h:545
KGlobalSettings::StyleChanged
@ StyleChanged
Definition kglobalsettings.h:543
KGlobalSettings::SettingsChanged
@ SettingsChanged
Definition kglobalsettings.h:544
KGlobalSettings::CursorChanged
@ CursorChanged
Definition kglobalsettings.h:544
KGlobalSettings::IconChanged
@ IconChanged
Definition kglobalsettings.h:544
KGlobalSettings::ClipboardConfigChanged
@ ClipboardConfigChanged
Definition kglobalsettings.h:545
KGlobalSettings::PaletteChanged
@ PaletteChanged
Definition kglobalsettings.h:543
KGlobalSettings::BlockShortcuts
@ BlockShortcuts
Definition kglobalsettings.h:546
KGlobalSettings::NaturalSortingChanged
@ NaturalSortingChanged
Definition kglobalsettings.h:546
KGlobalSettings::FontChanged
@ FontChanged
Definition kglobalsettings.h:543
KGlobalSettings::singleClick
static bool singleClick()
Returns whether KDE runs in single (default) or double click mode.
Definition kglobalsettings.cpp:233
KGlobalSettings::videosPath
static QString videosPath()
The path where videos are stored of the current user.
Definition kglobalsettings.cpp:676
KGlobalSettings::dndEventDelay
static int dndEventDelay()
Returns a threshold in pixels for drag & drop operations.
Definition kglobalsettings.cpp:227
KGlobalSettings::contrast
static int contrast()
Returns the contrast for borders.
Definition kglobalsettings.cpp:360
KGlobalSettings::toolBarFont
static QFont toolBarFont()
Returns the default toolbar font.
Definition kglobalsettings.cpp:454
KGlobalSettings::contrastF
static qreal contrastF(const KSharedConfigPtr &config=KSharedConfigPtr())
Returns the contrast for borders as a floating point value.
Definition kglobalsettings.cpp:366
KGlobalSettings::ActivateOption
ActivateOption
Specifies options passed to activate().
Definition kglobalsettings.h:567
KGlobalSettings::ListenForChanges
@ ListenForChanges
Listen for changes to the settings.
Definition kglobalsettings.h:569
KGlobalSettings::ApplySettings
@ ApplySettings
Make all globally applicable settings take effect.
Definition kglobalsettings.h:568
KGlobalSettings::naturalSortingChanged
void naturalSortingChanged()
Emitted when the natural sorting has been changed.
KGlobalSettings::activeTextColor
static QColor activeTextColor()
The default color to use for active texts.
Definition kglobalsettings.cpp:350
KGlobalSettings::kdisplayPaletteChanged
void kdisplayPaletteChanged()
Emitted when the application has changed its palette due to a KControl request.
KGlobalSettings::musicPath
static QString musicPath()
The path where music are stored of the current user.
Definition kglobalsettings.cpp:688
KGlobalSettings::kdisplayStyleChanged
void kdisplayStyleChanged()
Emitted when the application has changed its GUI style in response to a KControl request.
KGlobalSettings::appearanceChanged
void appearanceChanged()
Emitted when the application has changed either its GUI style, its font or its palette in response to...
KGlobalSettings::Completion
Completion
This enum describes the completion mode used for by the KCompletion class.
Definition kglobalsettings.h:179
KGlobalSettings::CompletionPopup
@ CompletionPopup
Lists all possible matches in a popup list-box to choose from.
Definition kglobalsettings.h:199
KGlobalSettings::CompletionShell
@ CompletionShell
Complete text much in the same way as a typical *nix shell would.
Definition kglobalsettings.h:195
KGlobalSettings::CompletionMan
@ CompletionMan
Same as automatic except shortest match is used for completion.
Definition kglobalsettings.h:191
KGlobalSettings::CompletionAuto
@ CompletionAuto
Text is automatically filled in whenever possible.
Definition kglobalsettings.h:187
KGlobalSettings::CompletionNone
@ CompletionNone
No completion is used.
Definition kglobalsettings.h:183
KGlobalSettings::CompletionPopupAuto
@ CompletionPopupAuto
Lists all possible matches in a popup list-box to choose from, and automatically fill the result when...
Definition kglobalsettings.h:204
KGlobalSettings::KApplication
friend class KApplication
Definition kglobalsettings.h:680
KGlobalSettings::kdisplayFontChanged
void kdisplayFontChanged()
Emitted when the application has changed its font in response to a KControl request.
KGlobalSettings::largeFont
static QFont largeFont(const QString &text=QString())
Returns a font of approx.
Definition kglobalsettings.cpp:540
KGlobalSettings::taskbarFont
static QFont taskbarFont()
Returns the default taskbar font.
Definition kglobalsettings.cpp:466
KGlobalSettings::allowDefaultBackgroundImages
static bool allowDefaultBackgroundImages()
Returns if default background images are allowed by the color scheme.
Definition kglobalsettings.cpp:381
KGlobalSettings::desktopGeometry
static QRect desktopGeometry(const QPoint &point)
This function returns the desktop geometry for an application that needs to set the geometry of a wid...
Definition kglobalsettings.cpp:732
KGlobalSettings::smoothScroll
static bool smoothScroll()
Returns if item views should force smooth scrolling.
Definition kglobalsettings.cpp:239
KGlobalSettings::menuFont
static QFont menuFont()
Returns the default menu font.
Definition kglobalsettings.cpp:458
KGlobalSettings::documentPath
static QString documentPath()
The path where documents are stored of the current user.
Definition kglobalsettings.cpp:646
KGlobalSettings::mouseSettings
static KMouseSettings & mouseSettings()
This returns the current mouse settings.
Definition kglobalsettings.cpp:613
KGlobalSettings::iconChanged
void iconChanged(int group)
Emitted when the global icon settings have been changed.
KGlobalSettings::showIconsOnPushButtons
static bool showIconsOnPushButtons()
This function determines if the user wishes to see icons on the push buttons.
Definition kglobalsettings.cpp:768
KGlobalSettings::inactiveTextColor
static QColor inactiveTextColor()
The default color to use for inactive texts.
Definition kglobalsettings.cpp:328
KGlobalSettings::naturalSorting
static bool naturalSorting()
Returns true, if user visible strings should be sorted in a natural way: image 1.jpg image 2....
Definition kglobalsettings.cpp:775
KGlobalSettings::isMultiHead
static bool isMultiHead()
Returns if the user specified multihead.
Definition kglobalsettings.cpp:694
KGlobalSettings::toolbarAppearanceChanged
void toolbarAppearanceChanged(int)
Emitted when the settings for toolbars have been changed.
KGlobalSettings::cursorChanged
void cursorChanged()
Emitted when the cursor theme has been changed.
KGlobalSettings::autostartPath
static QString autostartPath()
The path to the autostart directory of the current user.
Definition kglobalsettings.cpp:633
KGlobalSettings::activeTitleColor
static QColor activeTitleColor()
The default color to use for active titles.
Definition kglobalsettings.cpp:339
KGlobalSettings::TearOffHandle
TearOffHandle
This enum describes the return type for insertTearOffHandle() whether to insert a handle or not.
Definition kglobalsettings.h:130
KGlobalSettings::Enable
@ Enable
enable tear-off handles
Definition kglobalsettings.h:133
KGlobalSettings::ApplicationLevel
@ ApplicationLevel
enable on application level
Definition kglobalsettings.h:132
KGlobalSettings::Disable
@ Disable
disable tear-off handles
Definition kglobalsettings.h:131
KGlobalSettings::generalFont
static QFont generalFont()
Returns the default general font.
Definition kglobalsettings.cpp:446
KGlobalSettings::fixedFont
static QFont fixedFont()
Returns the default fixed font.
Definition kglobalsettings.cpp:450
KGlobalSettings::splashScreenDesktopGeometry
static QRect splashScreenDesktopGeometry()
This function returns the desktop geometry for an application's splash screen.
Definition kglobalsettings.cpp:713
KGlobalSettings::settingsChanged
void settingsChanged(int category)
Emitted when the global settings have been changed.
KGlobalSettings::picturesPath
static QString picturesPath()
The path where pictures are stored of the current user.
Definition kglobalsettings.cpp:682
KGlobalSettings::SettingsCategory
SettingsCategory
Valid values for the settingsChanged signal.
Definition kglobalsettings.h:593
KGlobalSettings::SETTINGS_LOCALE
@ SETTINGS_LOCALE
Definition kglobalsettings.h:595
KGlobalSettings::SETTINGS_PATHS
@ SETTINGS_PATHS
Definition kglobalsettings.h:593
KGlobalSettings::SETTINGS_POPUPMENU
@ SETTINGS_POPUPMENU
Definition kglobalsettings.h:594
KGlobalSettings::SETTINGS_MOUSE
@ SETTINGS_MOUSE
Definition kglobalsettings.h:593
KGlobalSettings::SETTINGS_COMPLETION
@ SETTINGS_COMPLETION
Definition kglobalsettings.h:593
KGlobalSettings::SETTINGS_STYLE
@ SETTINGS_STYLE
Definition kglobalsettings.h:595
KGlobalSettings::SETTINGS_QT
@ SETTINGS_QT
Definition kglobalsettings.h:594
KGlobalSettings::SETTINGS_SHORTCUTS
@ SETTINGS_SHORTCUTS
Definition kglobalsettings.h:594
KGlobalSettings::windowTitleFont
static QFont windowTitleFont()
Returns the default window title font.
Definition kglobalsettings.cpp:462
KGlobalSettings::downloadPath
static QString downloadPath()
The path where download are stored of the current user.
Definition kglobalsettings.cpp:652
KUrl
QObject
QWidget
KSharedConfigPtr
KSharedPtr< KSharedConfig > KSharedConfigPtr
kdeui_export.h
ksharedconfig.h
KGlobalSettings::KMouseSettings
Describes the mouse settings.
Definition kglobalsettings.h:218
KGlobalSettings::KMouseSettings::handed
int handed
Definition kglobalsettings.h:220
KGlobalSettings::KMouseSettings::RightHanded
@ RightHanded
Definition kglobalsettings.h:219
KGlobalSettings::KMouseSettings::LeftHanded
@ LeftHanded
Definition kglobalsettings.h:219
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal