Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Core::OGlobalSettings Class Reference

#include </home/clem/local/src/opie/libopie2/opiecore/oglobalsettings.h>

Collaboration diagram for Opie::Core::OGlobalSettings:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Completion {
  CompletionNone = 1, CompletionAuto, CompletionMan, CompletionShell,
  CompletionPopup, CompletionPopupAuto
}
enum  Debug {
  DebugNone = -1, DebugFiles = 0, DebugMsgBox = 1, DebugStdErr = 2,
  DebugSysLog = 3, DebugSocket = 4
}

Static Public Member Functions

static int dndEventDelay ()
static bool singleClick ()
static bool insertTearOffHandle ()
static bool changeCursorOverIcon ()
static bool visualActivate ()
static unsigned int visualActivateSpeed ()
static int autoSelectDelay ()
static int contextMenuKey ()
static bool showContextMenusOnPress ()
static Completion completionMode ()
static Debug debugMode ()
static QString debugOutput ()
static OMouseSettingsmouseSettings ()
static QString desktopPath ()
static QString autostartPath ()
static QString trashPath ()
static QString documentPath ()
static QColor toolBarHighlightColor ()
static QColor inactiveTitleColor ()
static QColor inactiveTextColor ()
static QColor activeTitleColor ()
static QColor activeTextColor ()
static int contrast ()
static QColor baseColor ()
static QColor textColor ()
static QColor linkColor ()
static QColor visitedLinkColor ()
static QColor highlightedTextColor ()
static QColor highlightColor ()
static QColor alternateBackgroundColor ()
static QColor calculateAlternateBackgroundColor (const QColor &base)
static QFont generalFont ()
static QFont fixedFont ()
static QFont toolBarFont ()
static QFont menuFont ()
static QFont windowTitleFont ()
static QFont taskbarFont ()
static bool isMultiHead ()

Static Private Member Functions

static void initStatic ()
static void initColors ()
static void rereadFontSettings ()
static void rereadPathSettings ()
static void rereadMouseSettings ()

Private Attributes

Private * d

Static Private Attributes

static QStrings_desktopPath = 0
static QStrings_autostartPath = 0
static QStrings_trashPath = 0
static QStrings_documentPath = 0
static QFont * _generalFont = 0
static QFont * _fixedFont = 0
static QFont * _toolBarFont = 0
static QFont * _menuFont = 0
static QFont * _windowTitleFont = 0
static QFont * _taskbarFont = 0
static QColor * kde2Gray
static QColor * kde2Blue
static QColor * kde2AlternateColor
static OMouseSettingss_mouseSettings = 0
static QColor * OpieGray = 0
static QColor * OpieBlue
static QColor * OpieAlternate = 0
static QColor * OpieHighlight = 0

Friends

class OApplication

Classes

struct  OMouseSettings

Detailed Description

Access the OPIE global configuration settings.

Definition at line 62 of file oglobalsettings.h.


Member Enumeration Documentation

enum Opie::Core::OGlobalSettings::Completion
 

This enum describes the completion mode used for by the OCompletion class. See the styleguide.

Enumeration values:
CompletionNone  No completion is used.
CompletionAuto  Text is automatically filled in whenever possible.
CompletionMan  Same as automatic except shortest match is used for completion.
CompletionShell  Complete text much in the same way as a typical *nix shell would.
CompletionPopup  Lists all possible matches in a popup list-box to choose from.
CompletionPopupAuto  Lists all possible matches in a popup list-box to choose from, and automatically fill the result whenever possible.

Definition at line 168 of file oglobalsettings.h.

enum Opie::Core::OGlobalSettings::Debug
 

This enum describes the debug mode used for by the odbgstream class. See the styleguide.

Enumeration values:
DebugNone  Debug messages are ignored.
DebugFiles  Debug output is sent to files /var/log/.
DebugMsgBox  Debug output is written in a QMessageBox.
DebugStdErr  Debug output is sent to stderr.
DebugSysLog  Debug output is sent to syslog.
DebugSocket  Debug output is sent via udp over a socket.

Definition at line 207 of file oglobalsettings.h.


Member Function Documentation

QColor OGlobalSettings::activeTextColor  )  [static]
 

Definition at line 222 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), Opie::Core::OConfig::readColorEntry(), and Qt::white.

QColor OGlobalSettings::activeTitleColor  )  [static]
 

Definition at line 214 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), initColors(), OpieHighlight, and Opie::Core::OConfig::readColorEntry().

QColor OGlobalSettings::alternateBackgroundColor  )  [static]
 

Returns the alternate background color used by OListView with OListViewItem. 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.

See also:
calculateAlternateBackgroundColor

Definition at line 267 of file oglobalsettings.cpp.

References baseColor(), calculateAlternateBackgroundColor(), Opie::Core::OGlobal::config(), QString::fromLatin1(), initColors(), OpieAlternate, and Opie::Core::OConfig::readColorEntry().

int OGlobalSettings::autoSelectDelay  )  [static]
 

Returns the OPIE setting for the auto-select option

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

Definition at line 116 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_AUTOSELECTDELAY, and Config::readNumEntry().

static QString Opie::Core::OGlobalSettings::autostartPath  )  [inline, static]
 

The path to the autostart directory of the current user.

Definition at line 269 of file oglobalsettings.h.

References initStatic(), and s_autostartPath.

QColor OGlobalSettings::baseColor  )  [static]
 

The default colors to use for text and links.

Definition at line 238 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), Opie::Core::OConfig::readColorEntry(), and Qt::white.

Referenced by alternateBackgroundColor().

QColor OGlobalSettings::calculateAlternateBackgroundColor const QColor &  base  )  [static]
 

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

See also:
alternateBackgroundColor

Definition at line 276 of file oglobalsettings.cpp.

References Qt::black, s, v, and Qt::white.

Referenced by alternateBackgroundColor().

bool OGlobalSettings::changeCursorOverIcon  )  [static]
 

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

Definition at line 91 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_CHANGECURSOR, and Config::readBoolEntry().

OGlobalSettings::Completion OGlobalSettings::completionMode  )  [static]
 

Returns the preferred completion mode setting.

Returns:
Completion. Default is CompletionPopup.

Definition at line 123 of file oglobalsettings.cpp.

References CompletionNone, CompletionPopup, CompletionPopupAuto, Opie::Core::OGlobal::config(), and Config::readNumEntry().

int OGlobalSettings::contextMenuKey  )  [static]
 

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

Returns:
the key that pops up context menus.

Definition at line 147 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config().

int OGlobalSettings::contrast  )  [static]
 

Definition at line 229 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), and Config::readNumEntry().

OGlobalSettings::Debug OGlobalSettings::debugMode  )  [static]
 

Returns the preferred debug mode setting.

Returns:
Debug. Default is DebugStdErr.

Definition at line 159 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), debug, DebugSocket, DebugStdErr, Opie::Core::ODEBUG_STDERR, and Config::readNumEntry().

Referenced by Opie::Core::Internal::DebugBackend::DebugBackend(), debugOutput(), and main().

QString OGlobalSettings::debugOutput  )  [static]
 

Returns additional information for debug output (dependent on the debug mode).

Returns:
Additional debug output information.

Definition at line 172 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), DebugFiles, debugMode(), DebugMsgBox, DebugNone, DebugSocket, DebugStdErr, DebugSysLog, QString::null, QString::number(), and Config::readEntry().

Referenced by Opie::Core::Internal::DebugBackend::debugFile(), Opie::Core::Internal::DebugBackend::debugSock(), and main().

static QString Opie::Core::OGlobalSettings::desktopPath  )  [inline, static]
 

The path to the desktop directory of the current user.

Definition at line 264 of file oglobalsettings.h.

References initStatic(), and s_desktopPath.

int OGlobalSettings::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 OColorCells::mousePressEvent( QMouseEvent *e )
 {
    mOldPos = e->pos();
 }

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

    int delay = OGlobalSettings::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())
       {
          OColorDrag *d = OColorDrag::makeDrag( colors[cell], this);
          d->dragCopy();
       }
    }
 }
 

Definition at line 70 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), and Config::readNumEntry().

static QString Opie::Core::OGlobalSettings::documentPath  )  [inline, static]
 

The path where documents are stored of the current user.

Definition at line 280 of file oglobalsettings.h.

References initStatic(), and s_documentPath.

QFont OGlobalSettings::fixedFont  )  [static]
 

Definition at line 328 of file oglobalsettings.cpp.

References _fixedFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().

QFont OGlobalSettings::generalFont  )  [static]
 

Definition at line 312 of file oglobalsettings.cpp.

References _generalFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().

QColor OGlobalSettings::highlightColor  )  [static]
 

Definition at line 259 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), initColors(), OpieHighlight, and Opie::Core::OConfig::readColorEntry().

QColor OGlobalSettings::highlightedTextColor  )  [static]
 

Definition at line 252 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), Opie::Core::OConfig::readColorEntry(), and Qt::white.

QColor OGlobalSettings::inactiveTextColor  )  [static]
 

Definition at line 207 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), Qt::darkGray, QString::fromLatin1(), and Opie::Core::OConfig::readColorEntry().

QColor OGlobalSettings::inactiveTitleColor  )  [static]
 

Definition at line 199 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), OpieGray, and Opie::Core::OConfig::readColorEntry().

void OGlobalSettings::initColors  )  [static, private]
 

initialise kde2Blue

Definition at line 475 of file oglobalsettings.cpp.

References OpieAlternate, OpieGray, and OpieHighlight.

Referenced by activeTitleColor(), alternateBackgroundColor(), highlightColor(), linkColor(), and toolBarHighlightColor().

void OGlobalSettings::initStatic  )  [static, private]
 

reads in all paths from kdeglobals

Definition at line 410 of file oglobalsettings.cpp.

References QDir::cleanDirPath(), Opie::Core::OGlobal::config(), Config::hasKey(), QDir::homeDirPath(), QString::null, Config::readEntry(), s_autostartPath, s_desktopPath, s_documentPath, s_trashPath, tr, and Config::writeEntry().

Referenced by autostartPath(), desktopPath(), documentPath(), and trashPath().

bool OGlobalSettings::insertTearOffHandle  )  [static]
 

Returns whether tear-off handles are inserted in OPopupMenus.

Definition at line 84 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_INSERTTEAROFFHANDLES, and Config::readBoolEntry().

bool OGlobalSettings::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 OPIE to run on all of them or just on the primary

Definition at line 542 of file oglobalsettings.cpp.

References QCString::isEmpty(), and QCString::lower().

QColor OGlobalSettings::linkColor  )  [static]
 

Definition at line 293 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), initColors(), OpieGray, and Opie::Core::OConfig::readColorEntry().

QFont OGlobalSettings::menuFont  )  [static]
 

Definition at line 360 of file oglobalsettings.cpp.

References _menuFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().

OGlobalSettings::OMouseSettings & OGlobalSettings::mouseSettings  )  [static]
 

This returns the current mouse settings.

Definition at line 511 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), Opie::Core::OGlobalSettings::OMouseSettings::handed, Opie::Core::OGlobalSettings::OMouseSettings::LeftHanded, Opie::Core::OGlobalSettings::OMouseSettings::RightHanded, s, and s_mouseSettings.

void OGlobalSettings::rereadFontSettings  )  [static, private]
 

drop cached values for fonts (called by OApplication)

Definition at line 482 of file oglobalsettings.cpp.

References _fixedFont, _generalFont, _menuFont, _taskbarFont, _toolBarFont, and _windowTitleFont.

void OGlobalSettings::rereadMouseSettings  )  [static, private]
 

drop cached values for mouse settings (called by OApplication)

Definition at line 534 of file oglobalsettings.cpp.

References s_mouseSettings.

void OGlobalSettings::rereadPathSettings  )  [static, private]
 

drop cached values for paths (called by OApplication)

Definition at line 498 of file oglobalsettings.cpp.

References qDebug(), s_autostartPath, s_desktopPath, s_documentPath, and s_trashPath.

bool OGlobalSettings::showContextMenusOnPress  )  [static]
 

Returns the OPIE setting for context menus.

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

Definition at line 138 of file oglobalsettings.cpp.

References Opie::Core::OConfigGroupSaver::config(), and Opie::Core::OGlobal::config().

bool OGlobalSettings::singleClick  )  [static]
 

Returns whether OPIE runs in single (default) or double click mode.

Returns:
true if single click mode, or false if double click mode.
see http://opie.handhelds.org/documentation/standards/opie/style/mouse/index.html

Definition at line 77 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_SINGLECLICK, and Config::readBoolEntry().

QFont OGlobalSettings::taskbarFont  )  [static]
 

Definition at line 392 of file oglobalsettings.cpp.

References _taskbarFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().

QColor OGlobalSettings::textColor  )  [static]
 

Definition at line 245 of file oglobalsettings.cpp.

References Qt::black, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readColorEntry().

QFont OGlobalSettings::toolBarFont  )  [static]
 

Definition at line 344 of file oglobalsettings.cpp.

References _toolBarFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().

QColor OGlobalSettings::toolBarHighlightColor  )  [static]
 

The default color to use when highlighting toolbar buttons

Definition at line 191 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), initColors(), OpieHighlight, and Opie::Core::OConfig::readColorEntry().

static QString Opie::Core::OGlobalSettings::trashPath  )  [inline, static]
 

The path to the trash directory of the current user.

Definition at line 275 of file oglobalsettings.h.

References initStatic(), and s_trashPath.

QColor OGlobalSettings::visitedLinkColor  )  [static]
 

Definition at line 301 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), QString::fromLatin1(), Qt::magenta, and Opie::Core::OConfig::readColorEntry().

bool OGlobalSettings::visualActivate  )  [static]
 

Returns:
whether to show some feedback when an item (specifically an icon) is activated.

Definition at line 98 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_VISUAL_ACTIVATE, and Config::readBoolEntry().

unsigned int OGlobalSettings::visualActivateSpeed  )  [static]
 

Definition at line 105 of file oglobalsettings.cpp.

References Opie::Core::OGlobal::config(), OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED, and Config::readNumEntry().

QFont OGlobalSettings::windowTitleFont  )  [static]
 

Definition at line 376 of file oglobalsettings.cpp.

References _windowTitleFont, Opie::Core::OGlobal::config(), QString::fromLatin1(), and Opie::Core::OConfig::readFontEntry().


Friends And Related Function Documentation

friend class OApplication [friend]
 

Definition at line 376 of file oglobalsettings.h.


Member Data Documentation

QFont * OGlobalSettings::_fixedFont = 0 [static, private]
 

Definition at line 56 of file oglobalsettings.cpp.

Referenced by fixedFont(), and rereadFontSettings().

QFont * OGlobalSettings::_generalFont = 0 [static, private]
 

Definition at line 55 of file oglobalsettings.cpp.

Referenced by generalFont(), and rereadFontSettings().

QFont * OGlobalSettings::_menuFont = 0 [static, private]
 

Definition at line 58 of file oglobalsettings.cpp.

Referenced by menuFont(), and rereadFontSettings().

QFont * OGlobalSettings::_taskbarFont = 0 [static, private]
 

Definition at line 60 of file oglobalsettings.cpp.

Referenced by rereadFontSettings(), and taskbarFont().

QFont * OGlobalSettings::_toolBarFont = 0 [static, private]
 

Definition at line 57 of file oglobalsettings.cpp.

Referenced by rereadFontSettings(), and toolBarFont().

QFont * OGlobalSettings::_windowTitleFont = 0 [static, private]
 

Definition at line 59 of file oglobalsettings.cpp.

Referenced by rereadFontSettings(), and windowTitleFont().

Private* Opie::Core::OGlobalSettings::d [private]
 

Definition at line 378 of file oglobalsettings.h.

QColor* Opie::Core::OGlobalSettings::kde2AlternateColor [static, private]
 

Definition at line 368 of file oglobalsettings.h.

QColor* Opie::Core::OGlobalSettings::kde2Blue [static, private]
 

Definition at line 367 of file oglobalsettings.h.

QColor* Opie::Core::OGlobalSettings::kde2Gray [static, private]
 

Definition at line 366 of file oglobalsettings.h.

QColor * OGlobalSettings::OpieAlternate = 0 [static, private]
 

Definition at line 64 of file oglobalsettings.cpp.

Referenced by alternateBackgroundColor(), and initColors().

QColor* Opie::Core::OGlobalSettings::OpieBlue [static, private]
 

Definition at line 372 of file oglobalsettings.h.

QColor * OGlobalSettings::OpieGray = 0 [static, private]
 

Definition at line 62 of file oglobalsettings.cpp.

Referenced by inactiveTitleColor(), initColors(), and linkColor().

QColor * OGlobalSettings::OpieHighlight = 0 [static, private]
 

Definition at line 63 of file oglobalsettings.cpp.

Referenced by activeTitleColor(), highlightColor(), initColors(), and toolBarHighlightColor().

QString * OGlobalSettings::s_autostartPath = 0 [static, private]
 

Definition at line 52 of file oglobalsettings.cpp.

Referenced by autostartPath(), initStatic(), and rereadPathSettings().

QString * OGlobalSettings::s_desktopPath = 0 [static, private]
 

Definition at line 51 of file oglobalsettings.cpp.

Referenced by desktopPath(), initStatic(), and rereadPathSettings().

QString * OGlobalSettings::s_documentPath = 0 [static, private]
 

Definition at line 54 of file oglobalsettings.cpp.

Referenced by documentPath(), initStatic(), and rereadPathSettings().

OGlobalSettings::OMouseSettings * OGlobalSettings::s_mouseSettings = 0 [static, private]
 

Definition at line 66 of file oglobalsettings.cpp.

Referenced by mouseSettings(), and rereadMouseSettings().

QString * OGlobalSettings::s_trashPath = 0 [static, private]
 

Definition at line 53 of file oglobalsettings.cpp.

Referenced by initStatic(), rereadPathSettings(), and trashPath().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:00:41 2005 for OPIE by  doxygen 1.4.2