org.kde.koala
Class KGlobalSettings

java.lang.Object
  extended by org.kde.koala.KGlobalSettings
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KGlobalSettings
extends java.lang.Object
implements org.kde.qt.QtSupport

Access the KDE global configuration.

Author:
David Faure

Field Summary
static int ApplicationLevel
           
static int CompletionAuto
           
static int CompletionMan
           
static int CompletionNone
          This enum describes the completion mode used for by the KCompletion class.
static int CompletionPopup
           
static int CompletionPopupAuto
           
static int CompletionShell
           
static int Disable
          This enum describes the return type for insertTearOffHandle() whether to insert a handle or not.
static int Enable
           
 
Constructor Summary
  KGlobalSettings()
           
protected KGlobalSettings(java.lang.Class dummy)
           
 
Method Summary
static org.kde.qt.QColor activeTextColor()
          The default color to use for active texts.
static org.kde.qt.QColor activeTitleColor()
          The default color to use for active titles.
static org.kde.qt.QColor alternateBackgroundColor()
          Returns the alternate background color used by KListView with KListViewItem.
static int autoSelectDelay()
          Returns the KDE setting for the auto-select option.
static java.lang.String autostartPath()
          The path to the autostart directory of the current user.
static org.kde.qt.QColor baseColor()
          Returns the default base (background) color.
static org.kde.qt.QColor buttonBackground()
          Returns the button background color
static int buttonLayout()
          The layout scheme to use for dialog buttons
static org.kde.qt.QColor buttonTextColor()
          Returns the button text color
static org.kde.qt.QColor calculateAlternateBackgroundColor(org.kde.qt.QColor base)
          Calculates a color based on base to be used as alternating color for e.g.
static boolean changeCursorOverIcon()
          Checks whether the cursor changes over icons.
static int completionMode()
          Returns the preferred completion mode setting.
static int contextMenuKey()
          Returns the KDE setting for the shortcut key to open context menus.
static int contrast()
          Returns the contrast for borders.
static org.kde.qt.QRect desktopGeometry(org.kde.qt.QPoint point)
          This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually.
static org.kde.qt.QRect desktopGeometry(org.kde.qt.QWidget w)
          This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually.
static java.lang.String desktopPath()
          The path to the desktop directory of the current user.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
static int dndEventDelay()
          Returns a threshold in pixels for drag & drop operations.
static java.lang.String documentPath()
          The path where documents are stored of the current user.
protected  void finalize()
          Deletes the wrapped C++ instance
static org.kde.qt.QFont fixedFont()
          Returns the default fixed font.
static org.kde.qt.QFont generalFont()
          Returns the default general font.
static org.kde.qt.QColor highlightColor()
          Returns the default color for text highlights.
static org.kde.qt.QColor highlightedTextColor()
          Returns the default color for highlighted text.
static org.kde.qt.QColor inactiveTextColor()
          The default color to use for inactive texts.
static org.kde.qt.QColor inactiveTitleColor()
          The default color to use for inactive titles.
static int insertTearOffHandle()
          Returns whether tear-off handles are inserted in KPopupMenus.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static boolean isMultiHead()
          Returns if the user specified multihead.
static org.kde.qt.QFont largeFont()
           
static org.kde.qt.QFont largeFont(java.lang.String text)
          Returns a font of approx.
static org.kde.qt.QColor linkColor()
          Returns the default link color.
static org.kde.qt.QFont menuFont()
          Returns the default menu font.
static boolean opaqueResize()
          Whether the user wishes to use opaque resizing.
static boolean shadeSortColumn()
          Returns if the sorted column in a KListView shall be drawn with a shaded background color.
static boolean showContextMenusOnPress()
          Returns the KDE setting for context menus.
static boolean showFilePreview(KURL arg1)
          This function determines if the user wishes to see previews for the selected url
static boolean showIconsOnPushButtons()
          This function determines if the user wishes to see icons on the push buttons.
static boolean singleClick()
          Returns whether KDE runs in single (default) or double click mode.
static org.kde.qt.QRect splashScreenDesktopGeometry()
          This function returns the desktop geometry for an application's splash screen.
static org.kde.qt.QFont taskbarFont()
          Returns the default taskbar font.
static org.kde.qt.QColor textColor()
          Returns the default text color.
static org.kde.qt.QFont toolBarFont()
          Returns the default toolbar font.
static org.kde.qt.QColor toolBarHighlightColor()
          The default color to use when highlighting toolbar buttons.
static java.lang.String trashPath()
          DEPRECATED (starting from kde-3.4).
static org.kde.qt.QColor visitedLinkColor()
          Returns the default color for visited links.
static boolean visualActivate()
          Checks whether to show feedback when in item (specifically an icon) is activated.
static int visualActivateSpeed()
          Returns the speed of the visual activation feedback.
static boolean wheelMouseZooms()
          Typically, QScrollView derived classes can be scrolled fast by holding down the Ctrl-button during wheel-scrolling.
static org.kde.qt.QFont windowTitleFont()
          Returns the default window title font.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Disable

public static final int Disable
This enum describes the return type for insertTearOffHandle() whether 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.

See Also:
Constant Field Values

ApplicationLevel

public static final int ApplicationLevel
See Also:
Constant Field Values

Enable

public static final int Enable
See Also:
Constant Field Values

CompletionNone

public static final int CompletionNone
This enum describes the completion mode used for by the KCompletion class. See the styleguide.

See Also:
Constant Field Values

CompletionAuto

public static final int CompletionAuto
See Also:
Constant Field Values

CompletionMan

public static final int CompletionMan
See Also:
Constant Field Values

CompletionShell

public static final int CompletionShell
See Also:
Constant Field Values

CompletionPopup

public static final int CompletionPopup
See Also:
Constant Field Values

CompletionPopupAuto

public static final int CompletionPopupAuto
See Also:
Constant Field Values
Constructor Detail

KGlobalSettings

protected KGlobalSettings(java.lang.Class dummy)

KGlobalSettings

public KGlobalSettings()
Method Detail

dndEventDelay

public static int dndEventDelay()
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

singleClick

public static boolean singleClick()
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.

insertTearOffHandle

public static int insertTearOffHandle()
Returns whether tear-off handles are inserted in KPopupMenus.

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

changeCursorOverIcon

public static boolean changeCursorOverIcon()
Checks whether the cursor changes over icons.

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

visualActivate

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

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

visualActivateSpeed

public static int visualActivateSpeed()
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

autoSelectDelay

public static int autoSelectDelay()
Returns the KDE setting for the auto-select option.

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

contextMenuKey

public static int contextMenuKey()
Returns the KDE setting for the shortcut key to open context menus.

Returns:
the key that pops up context menus.

showContextMenusOnPress

public static boolean showContextMenusOnPress()
Returns the KDE setting for context menus.

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

completionMode

public static int completionMode()
Returns the preferred completion mode setting.

Returns:
Completion. Default is CompletionPopup.

desktopPath

public static java.lang.String desktopPath()
The path to the desktop directory of the current user.

Returns:
the user's desktop directory

autostartPath

public static java.lang.String autostartPath()
The path to the autostart directory of the current user.

Returns:
the path of the autostart directory

trashPath

public static java.lang.String trashPath()
DEPRECATED (starting from kde-3.4). This isn't where the trash contents is, anymore. Use KIO.trash() to trash files, "trash:/" to list the trash contents.


documentPath

public static java.lang.String documentPath()
The path where documents are stored of the current user.

Returns:
the path of the document directory

toolBarHighlightColor

public static org.kde.qt.QColor toolBarHighlightColor()
The default color to use when highlighting toolbar buttons.

Returns:
the toolbar highlight color

inactiveTitleColor

public static org.kde.qt.QColor inactiveTitleColor()
The default color to use for inactive titles.

Returns:
the inactive title color

inactiveTextColor

public static org.kde.qt.QColor inactiveTextColor()
The default color to use for inactive texts.

Returns:
the inactive text color

activeTitleColor

public static org.kde.qt.QColor activeTitleColor()
The default color to use for active titles.

Returns:
the active title color

activeTextColor

public static org.kde.qt.QColor activeTextColor()
The default color to use for active texts.

Returns:
the active text color

contrast

public static int contrast()
Returns the contrast for borders.

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

buttonBackground

public static org.kde.qt.QColor buttonBackground()
Returns the button background color

Returns:
the button background color

buttonTextColor

public static org.kde.qt.QColor buttonTextColor()
Returns the button text color

Returns:
the button text color

baseColor

public static org.kde.qt.QColor baseColor()
Returns the default base (background) color.

Returns:
the default base (background) color
See Also:
QColorGroup.base()

textColor

public static org.kde.qt.QColor textColor()
Returns the default text color.

Returns:
the default text color
See Also:
QColorGroup.text()

linkColor

public static org.kde.qt.QColor linkColor()
Returns the default link color.

Returns:
the default link color

visitedLinkColor

public static org.kde.qt.QColor visitedLinkColor()
Returns the default color for visited links.

Returns:
the default color for visited links

highlightedTextColor

public static org.kde.qt.QColor highlightedTextColor()
Returns the default color for highlighted text.

Returns:
the default color for highlighted text
See Also:
org.kde.qt.QColorGroup#hightlightedText

highlightColor

public static org.kde.qt.QColor highlightColor()
Returns the default color for text highlights.

Returns:
the default color for text highlights
See Also:
org.kde.qt.QColorGroup#hightlight

alternateBackgroundColor

public static org.kde.qt.QColor alternateBackgroundColor()
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(org.kde.qt.QColor)

calculateAlternateBackgroundColor

public static org.kde.qt.QColor calculateAlternateBackgroundColor(org.kde.qt.QColor base)
Calculates a color based on base to be used as alternating color for e.g. listviews.

Parameters:
base - the base for the calculation
Returns:
the calculated color
See Also:
alternateBackgroundColor()

shadeSortColumn

public static boolean shadeSortColumn()
Returns if the sorted column in a KListView shall be drawn with a shaded background color.

Returns:
true if the sorted column shall be shaded

generalFont

public static org.kde.qt.QFont generalFont()
Returns the default general font.

Returns:
the default general font.

fixedFont

public static org.kde.qt.QFont fixedFont()
Returns the default fixed font.

Returns:
the default fixed font.

toolBarFont

public static org.kde.qt.QFont toolBarFont()
Returns the default toolbar font.

Returns:
the default toolbar font.

menuFont

public static org.kde.qt.QFont menuFont()
Returns the default menu font.

Returns:
the default menu font.

windowTitleFont

public static org.kde.qt.QFont windowTitleFont()
Returns the default window title font.

Returns:
the default window title font.

taskbarFont

public static org.kde.qt.QFont taskbarFont()
Returns the default taskbar font.

Returns:
the default taskbar font.

largeFont

public static org.kde.qt.QFont largeFont(java.lang.String text)
Returns a font of approx. 48 pt. capable of showing text.

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

largeFont

public static org.kde.qt.QFont largeFont()

isMultiHead

public static boolean isMultiHead()
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 On Windows, settings are retrieved from the system.

Returns:
true if the user chose multi head

wheelMouseZooms

public static boolean wheelMouseZooms()
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

splashScreenDesktopGeometry

public static org.kde.qt.QRect splashScreenDesktopGeometry()
This function returns the desktop geometry for an application's splash screen. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware).

Returns:
the geometry to use for the desktop. Note that it might not start at (0,0).

desktopGeometry

public static org.kde.qt.QRect desktopGeometry(org.kde.qt.QPoint point)
This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware). Note that this can break in multi-head (not Xinerama) mode because this point could be on multiple screens. Use with care.

Parameters:
point - a reference point for the widget, for instance one that the widget should be adjacent or on top of.
Returns:
the geometry to use for the desktop. Note that it might not start at (0,0).

desktopGeometry

public static org.kde.qt.QRect desktopGeometry(org.kde.qt.QWidget w)
This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware).

Parameters:
w - the widget in question. This is used to determine which screen to use in Xinerama or multi-head mode.
Returns:
the geometry to use for the desktop. Note that it might not start at (0,0).

showIconsOnPushButtons

public static boolean showIconsOnPushButtons()
This function determines if the user wishes to see icons on the push buttons.

Returns:
Returns true if user wants to show icons.

showFilePreview

public static boolean showFilePreview(KURL arg1)
This function determines if the user wishes to see previews for the selected url

Returns:
Returns true if user wants to show previews.

opaqueResize

public static boolean opaqueResize()
Whether the user wishes to use opaque resizing. Primarily intended for QSplitter.setOpaqueResize()

Returns:
Returns true if user wants to use opaque resizing.

buttonLayout

public static int buttonLayout()
The layout scheme to use for dialog buttons

Returns:
Returns the number of the scheme to use.
See Also:
KDialogBase#setButtonStyle

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?