class KGlobalSettings

Access the KDE global configuration. More...

Definition#include <kglobalsettings.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Static Methods


Detailed Description

Access the KDE global configuration.

int  dndEventDelay ()

dndEventDelay

[static]

Returns a threshold in pixels for drag & drop operations. As long as the mouse movement has not exceeded this number of pixels in either X or Y direction no drag operation may be started. This prevents spurious drags when the user intended to click on something but moved the mouse a bit while doing so.

For this to work you must save the position of the mouse (oldPos) in the QWidget::mousePressEvent(). When the position of the mouse (newPos) in a QWidget::mouseMoveEvent() exceeds this threshold you may start a drag which should originate from oldPos.

Example code:


 void KColorCells::mousePressEvent( QMouseEvent *e )
 {
    mOldPos = e->pos();
 }

 void KColorCells::mouseMoveEvent( QMouseEvent *e )
 {
    if( !(e->state() && LeftButton)) return;

    int delay = KGlobalSettings::dndEventDelay();
    QPoint newPos = e->pos();
    if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay ||
       newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay)
    {
       // Drag color object
       int cell = posToCell(mOldPos); // Find color at mOldPos
       if ((cell != -1) && colors[cell].isValid())
       {
          KColorDrag *d = KColorDrag::makeDrag( colors[cell], this);
          d->dragCopy();
       }
    }
 }

Returns: the threshold for drag & drop in pixels

bool  singleClick ()

singleClick

[static]

Returns whether KDE runs in single (default) or double click mode. see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html

Returns: true if single click mode, or false if double click mode.

enum TearOffHandle { Disable = 0, ApplicationLevel, Enable }

TearOffHandle

This enum describes the return type for insertTearOffHandle() wether to insert a handle or not. Applications who independently want to use handles in their popup menus should test for Application level before calling the appropriate function in KPopupMenu.

TearOffHandle  insertTearOffHandle ()

insertTearOffHandle

[static]

Returns whether tear-off handles are inserted in KPopupMenus.

Returns: whether tear-off handles are inserted in KPopupMenus.

bool  changeCursorOverIcon ()

changeCursorOverIcon

[static]

Checks whether the cursor changes over icons.

Returns: the KDE setting for "change cursor over icon"

bool  visualActivate ()

visualActivate

[static]

Checks whether to show feedback when in item (specifically an icon) is activated.

Returns: whether to show some feedback when an item is activated.

unsigned int  visualActivateSpeed ()

visualActivateSpeed

[static]

Returns the speed of the visual activation feedback.

Returns: the speed of the visual activation feedback, between 0 for minimum and 100 for maximum speed

int  autoSelectDelay ()

autoSelectDelay

[static]

Returns the KDE setting for the auto-select option.

Returns: the auto-select delay or -1 if auto-select is disabled.

int  contextMenuKey ()

contextMenuKey

[static]

Returns the KDE setting for the shortcut key to open context menus.

Returns: the key that pops up context menus.

bool  showContextMenusOnPress ()

showContextMenusOnPress

[static]

Returns the KDE setting for context menus.

Returns: whether context menus should be shown on button press or button release (click).

enum Completion { CompletionNone=1, /** }

Completion

No completion is used.

Completion  completionMode ()

completionMode

[static]

Returns the preferred completion mode setting.

Returns: Completion. Default is CompletionPopup.

KMouseSettings (struct)

KMouseSettings

Describes the mouse settings.

KMouseSettings &  mouseSettings ()

mouseSettings

[static]

This returns the current mouse settings.

Returns: the current mouse settings

QString  desktopPath ()

desktopPath

[static]

The path to the desktop directory of the current user.

Returns: the user's desktop directory

QString  autostartPath ()

autostartPath

[static]

The path to the autostart directory of the current user.

Returns: the path of the autostart directory

QString  trashPath ()

trashPath

[static]

The path to the trash directory of the current user.

Returns: the path of the trash directory

QString  documentPath ()

documentPath

[static]

The path where documents are stored of the current user.

Returns: the path of the document directory

QColor  toolBarHighlightColor ()

toolBarHighlightColor

[static]

The default color to use when highlighting toolbar buttons.

Returns: the toolbar highlight color

QColor  inactiveTitleColor ()

inactiveTitleColor

[static]

The default color to use for inactive titles.

Returns: the inactive title color

QColor  inactiveTextColor ()

inactiveTextColor

[static]

The default color to use for inactive texts.

Returns: the inactive text color

QColor  activeTitleColor ()

activeTitleColor

[static]

The default color to use for active titles.

Returns: the active title color

QColor  activeTextColor ()

activeTextColor

[static]

The default color to use for active texts.

Returns: the active text color

int  contrast ()

contrast

[static]

Returns the contrast for borders.

Returns: the contrast (between 0 for minimum and 10 for maximum contrast)

QColor  baseColor ()

baseColor

[static]

Returns the default base (background) color.

Returns: the default base (background) color

See also: QColorGroup::base()

QColor  textColor ()

textColor

[static]

Returns the default text color.

Returns: the default text color

See also: QColorGroup::text()

QColor  linkColor ()

linkColor

[static]

Returns the default link color.

Returns: the default link color

QColor  visitedLinkColor ()

visitedLinkColor

[static]

Returns the default color for visited links.

Returns: the default color for visited links

QColor  highlightedTextColor ()

highlightedTextColor

[static]

Returns the default color for highlighted text.

Returns: the default color for highlighted text

See also: QColorGroup::hightlightedText()

QColor  highlightColor ()

highlightColor

[static]

Returns the default color for text highlights.

Returns: the default color for text highlights

See also: QColorGroup::hightlight()

QColor  alternateBackgroundColor ()

alternateBackgroundColor

[static]

Returns the alternate background color used by KListView with KListViewItem. Any other list that uses alternating background colors should use this too, to obey to the user's preferences. Returns an invalid color if the user doesn't want alternating backgrounds.

Returns: the alternate background color

See also: calculateAlternateBackgroundColor

QColor  calculateAlternateBackgroundColor (const QColor& base)

calculateAlternateBackgroundColor

[static]

Calculates a color based on base to be used as alternating color for e.g. listviews.

Parameters:
basethe base for the calculation

Returns: the calculated color

See also: alternateBackgroundColor

QFont  generalFont ()

generalFont

[static]

Returns the default general font.

Returns: the default general font.

QFont  fixedFont ()

fixedFont

[static]

Returns the default fixed font.

Returns: the default fixed font.

QFont  toolBarFont ()

toolBarFont

[static]

Returns the default toolbar font.

Returns: the default toolbar font.

QFont  menuFont ()

menuFont

[static]

Returns the default menu font.

Returns: the default menu font.

QFont  windowTitleFont ()

windowTitleFont

[static]

Returns the default window title font.

Returns: the default window title font.

QFont  taskbarFont ()

taskbarFont

[static]

Returns the default taskbar font.

Returns: the default taskbar font.

QFont  largeFont (const QString &text = QString::null)

largeFont

[static]

Returns a font of approx. 48 pt. capable of showing text.

Parameters:
textthe text to test

Returns: the font that is capable to show the text with 48 pt

bool  isMultiHead ()

isMultiHead

[static]

Returns if the user specified multihead. In case the display has multiple screens, the return value of this function specifies if the user wants KDE to run on all of them or just on the primary

Returns: true if the user chose multi head

bool  wheelMouseZooms ()

wheelMouseZooms

[static]

Typically, QScrollView derived classes can be scrolled fast by holding down the Ctrl-button during wheel-scrolling. But QTextEdit and derived classes perform zooming instead of fast scrolling.

This value determines whether the user wants to zoom or scroll fast with Ctrl-wheelscroll.

Returns: true if the user wishes to zoom with the mouse wheel, false for scrolling