diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-10-06 13:29:55 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-10-06 13:29:55 -0500 |
commit | bfb8895e56527b719d72c9c16a8ac6254b23e6cf (patch) | |
tree | 6ddc53d0d1fa624fb57220fdba2d6fae141b72ad | |
parent | 40778f37456fa527b7ea2292fe1c2f40b8176298 (diff) | |
download | tde-bfb8895e56527b719d72c9c16a8ac6254b23e6cf.tar.gz tde-bfb8895e56527b719d72c9c16a8ac6254b23e6cf.zip |
Apply qtkdeintegration patches to Qt3
This partially resolves Bug #528
l--------- | main/dependencies/qt3/include/private/qtkdeintegration_x11_p.h | 1 | ||||
-rw-r--r-- | main/dependencies/qt3/src/dialogs/qcolordialog.cpp | 16 | ||||
-rw-r--r-- | main/dependencies/qt3/src/dialogs/qfiledialog.cpp | 33 | ||||
-rw-r--r-- | main/dependencies/qt3/src/dialogs/qfontdialog.cpp | 10 | ||||
-rw-r--r-- | main/dependencies/qt3/src/dialogs/qmessagebox.cpp | 42 | ||||
-rw-r--r-- | main/dependencies/qt3/src/kernel/qt.h | 4 | ||||
-rw-r--r-- | main/dependencies/qt3/src/kernel/qt_x11.pri | 3 | ||||
-rw-r--r-- | main/dependencies/qt3/src/kernel/qtkdeintegration_x11.cpp | 245 | ||||
-rw-r--r-- | main/dependencies/qt3/src/kernel/qtkdeintegration_x11_p.h | 62 |
9 files changed, 411 insertions, 5 deletions
diff --git a/main/dependencies/qt3/include/private/qtkdeintegration_x11_p.h b/main/dependencies/qt3/include/private/qtkdeintegration_x11_p.h new file mode 120000 index 000000000..7bbc0318a --- /dev/null +++ b/main/dependencies/qt3/include/private/qtkdeintegration_x11_p.h @@ -0,0 +1 @@ +../../src/kernel/qtkdeintegration_x11_p.h
\ No newline at end of file diff --git a/main/dependencies/qt3/src/dialogs/qcolordialog.cpp b/main/dependencies/qt3/src/dialogs/qcolordialog.cpp index 44bf70e35..4ce83bba0 100644 --- a/main/dependencies/qt3/src/dialogs/qcolordialog.cpp +++ b/main/dependencies/qt3/src/dialogs/qcolordialog.cpp @@ -63,6 +63,10 @@ QRgb macGetRgba( QRgb initial, bool *ok, QWidget *parent, const char* name ); QColor macGetColor( const QColor& initial, QWidget *parent, const char *name ); #endif +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + //////////// QWellArray BEGIN struct QWellArrayData; @@ -1481,7 +1485,10 @@ QColorDialog::QColorDialog(QWidget* parent, const char* name, bool modal) : QColor QColorDialog::getColor( const QColor& initial, QWidget *parent, const char *name ) { -#if defined(Q_WS_MAC) +#if defined(Q_WS_X11) + if( QKDEIntegration::enabled()) + return QKDEIntegration::getColor( initial, parent, name ); +#elif defined(Q_WS_MAC) return macGetColor(initial, parent, name); #endif @@ -1519,6 +1526,13 @@ QRgb QColorDialog::getRgba( QRgb initial, bool *ok, QWidget *parent, const char* name ) { #if defined(Q_WS_MAC) + if( QKDEIntegration::enabled()) { + QColor color = QKDEIntegration::getColor( QColor( initial ), parent, name ); + if( ok ) + *ok = color.isValid(); + return color.rgba(); + } +#elif defined(Q_WS_MAC) return macGetRgba(initial, ok, parent, name); #endif diff --git a/main/dependencies/qt3/src/dialogs/qfiledialog.cpp b/main/dependencies/qt3/src/dialogs/qfiledialog.cpp index d69620496..7d0898646 100644 --- a/main/dependencies/qt3/src/dialogs/qfiledialog.cpp +++ b/main/dependencies/qt3/src/dialogs/qfiledialog.cpp @@ -95,6 +95,10 @@ #include "qvbox.h" #include "qwidgetstack.h" +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + #ifdef Q_WS_WIN #ifdef QT_THREAD_SUPPORT # include <private/qmutexpool_p.h> @@ -3489,7 +3493,11 @@ QString QFileDialog::getOpenFileName( const QString & startWith, if ( workingDirectory->isNull() ) *workingDirectory = ::toRootIfNotExists( QDir::currentDirPath() ); -#if defined(Q_WS_WIN) +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::getOpenFileNames( filter, workingDirectory, parent, name, + caption, selectedFilter, false ).first(); +#elif defined(Q_WS_WIN) if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle ) return winGetOpenFileName( initialSelection, filter, workingDirectory, parent, name, caption, selectedFilter ); @@ -3610,7 +3618,11 @@ QString QFileDialog::getSaveFileName( const QString & startWith, if ( workingDirectory->isNull() ) *workingDirectory = ::toRootIfNotExists( QDir::currentDirPath() ); -#if defined(Q_WS_WIN) +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::getSaveFileName( initialSelection, filter, workingDirectory, + parent, name, caption, selectedFilter ); +#elif defined(Q_WS_WIN) if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle ) return winGetSaveFileName( initialSelection, filter, workingDirectory, parent, name, caption, selectedFilter ); @@ -4500,7 +4512,17 @@ QString QFileDialog::getExistingDirectory( const QString & dir, if ( workingDirectory ) wd = *workingDirectory; -#if defined(Q_WS_WIN) +#if defined(Q_WS_X11) + QString initialDir; + if ( !dir.isEmpty() ) { + QUrlOperator u( dir ); + if ( QFileInfo( u.path() ).isDir() ) + initialDir = dir; + } else + initialDir = QString::null; + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::getExistingDirectory( initialDir, parent, name, caption ); +#elif defined(Q_WS_WIN) QString initialDir; if ( !dir.isEmpty() ) { QUrlOperator u( dir ); @@ -5664,7 +5686,10 @@ QStringList QFileDialog::getOpenFileNames( const QString & filter, } } -#if defined(Q_WS_WIN) +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::getOpenFileNames( filter, workingDirectory, parent, name, caption, selectedFilter, true ); +#elif defined(Q_WS_WIN) if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle ) return winGetOpenFileNames( filter, workingDirectory, parent, name, caption, selectedFilter ); #elif defined(Q_WS_MAC) diff --git a/main/dependencies/qt3/src/dialogs/qfontdialog.cpp b/main/dependencies/qt3/src/dialogs/qfontdialog.cpp index 1deec00e6..d1c31fa22 100644 --- a/main/dependencies/qt3/src/dialogs/qfontdialog.cpp +++ b/main/dependencies/qt3/src/dialogs/qfontdialog.cpp @@ -59,6 +59,10 @@ #include <private/qfontdata_p.h> #include <qvalidator.h> +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + /*! \class QFontDialog qfontdialog.h \ingroup dialogs @@ -387,9 +391,15 @@ QFont QFontDialog::getFont( bool *ok, QWidget *parent,const char* name) return getFont( ok, 0, parent, name ); } +extern bool qt_use_native_dialogs; + QFont QFontDialog::getFont( bool *ok, const QFont *def, QWidget *parent, const char* name) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::getFont( ok, def, parent, name ); +#endif QFont result; if ( def ) result = *def; diff --git a/main/dependencies/qt3/src/dialogs/qmessagebox.cpp b/main/dependencies/qt3/src/dialogs/qmessagebox.cpp index 848c008a9..37407b0ac 100644 --- a/main/dependencies/qt3/src/dialogs/qmessagebox.cpp +++ b/main/dependencies/qt3/src/dialogs/qmessagebox.cpp @@ -57,6 +57,12 @@ #endif +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + +extern bool qt_use_native_dialogs; + // Internal class - don't touch class QMessageBoxLabel : public QLabel @@ -1114,6 +1120,10 @@ int QMessageBox::information( QWidget *parent, const QString& caption, const QString& text, int button0, int button1, int button2 ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::information( parent, caption, text, button0, button1, button2 ); +#endif QMessageBox *mb = new QMessageBox( caption, text, Information, button0, button1, button2, parent, "qt_msgbox_information", TRUE, @@ -1161,6 +1171,10 @@ int QMessageBox::question( QWidget *parent, const QString& caption, const QString& text, int button0, int button1, int button2 ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::question( parent, caption, text, button0, button1, button2 ); +#endif QMessageBox *mb = new QMessageBox( caption, text, Question, button0, button1, button2, parent, "qt_msgbox_information", TRUE, @@ -1209,6 +1223,10 @@ int QMessageBox::warning( QWidget *parent, const QString& caption, const QString& text, int button0, int button1, int button2 ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::warning( parent, caption, text, button0, button1, button2 ); +#endif QMessageBox *mb = new QMessageBox( caption, text, Warning, button0, button1, button2, parent, "qt_msgbox_warning", TRUE, @@ -1257,6 +1275,10 @@ int QMessageBox::critical( QWidget *parent, const QString& caption, const QString& text, int button0, int button1, int button2 ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::critical( parent, caption, text, button0, button1, button2 ); +#endif QMessageBox *mb = new QMessageBox( caption, text, Critical, button0, button1, button2, parent, "qt_msgbox_critical", TRUE, @@ -1404,6 +1426,11 @@ int QMessageBox::information( QWidget *parent, const QString &caption, int defaultButtonNumber, int escapeButtonNumber ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::information( parent, caption, text, + button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); +#endif return textBox( parent, Information, caption, text, button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); @@ -1446,6 +1473,11 @@ int QMessageBox::question( QWidget *parent, const QString &caption, int defaultButtonNumber, int escapeButtonNumber ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::question( parent, caption, text, + button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); +#endif return textBox( parent, Question, caption, text, button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); @@ -1490,6 +1522,11 @@ int QMessageBox::warning( QWidget *parent, const QString &caption, int defaultButtonNumber, int escapeButtonNumber ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::warning( parent, caption, text, + button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); +#endif return textBox( parent, Warning, caption, text, button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); @@ -1530,6 +1567,11 @@ int QMessageBox::critical( QWidget *parent, const QString &caption, int defaultButtonNumber, int escapeButtonNumber ) { +#if defined(Q_WS_X11) + if ( qt_use_native_dialogs && QKDEIntegration::enabled()) + return QKDEIntegration::critical( parent, caption, text, + button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); +#endif return textBox( parent, Critical, caption, text, button0Text, button1Text, button2Text, defaultButtonNumber, escapeButtonNumber ); diff --git a/main/dependencies/qt3/src/kernel/qt.h b/main/dependencies/qt3/src/kernel/qt.h index 5a7720726..2145d8cd9 100644 --- a/main/dependencies/qt3/src/kernel/qt.h +++ b/main/dependencies/qt3/src/kernel/qt.h @@ -313,6 +313,10 @@ #endif // Private headers +#ifdef Q_WS_X11 +#include "private/qtkdeintegration_x11_p.h" +#endif + #ifdef Q_WS_MAC #include <qaquastyle.h> #include <qmacstyle_mac.h> diff --git a/main/dependencies/qt3/src/kernel/qt_x11.pri b/main/dependencies/qt3/src/kernel/qt_x11.pri index 9a751e6e3..06db6859b 100644 --- a/main/dependencies/qt3/src/kernel/qt_x11.pri +++ b/main/dependencies/qt3/src/kernel/qt_x11.pri @@ -10,6 +10,9 @@ unix { SOURCES += $$KERNEL_CPP/qtaddons_x11.cpp PRECOMPILED_HEADER = kernel/qt_pch.h + + SOURCES += $$KERNEL_CPP/qtkdeintegration_x11.cpp + HEADERS += $$KERNEL_H/qtkdeintegration_x11_p.h } nas { diff --git a/main/dependencies/qt3/src/kernel/qtkdeintegration_x11.cpp b/main/dependencies/qt3/src/kernel/qtkdeintegration_x11.cpp new file mode 100644 index 000000000..a562a760d --- /dev/null +++ b/main/dependencies/qt3/src/kernel/qtkdeintegration_x11.cpp @@ -0,0 +1,245 @@ +/* This file is licensed under the terms of the GPL v2 or v3, as it has been publicly released by + OpenSUSE as part of their GPLed Qt library disribution */ + +#define QT_CLEAN_NAMESPACE +#include "qtkdeintegration_x11_p.h" + +#include <qcolordialog.h> +#include <qfiledialog.h> +#include <qfontdialog.h> +#include <qlibrary.h> +#include <qregexp.h> +#include <qmessagebox.h> +#include <stdlib.h> + +bool QKDEIntegration::inited = false; +bool QKDEIntegration::enable = false; + +bool QKDEIntegration::enabled() + { + if( !inited ) + initLibrary(); + return enable; + } + +static QCString findLibrary() + { + if( getenv( "QT_NO_KDE_INTEGRATION" ) == NULL + || getenv( "QT_NO_KDE_INTEGRATION" )[ 0 ] == '0' ) + { +#ifdef USE_LIB64_PATHES + return "/opt/kde3/lib64/kde3/plugins/integration/libqtkde"; +#else + return "/opt/kde3/lib/kde3/plugins/integration/libqtkde"; +#endif + } + return ""; + } + +inline static long widgetToWinId( const QWidget* w ) + { + return w != NULL ? w->winId() : 0; + } + +inline static QFont fontPtrToFontRef( const QFont* f ) + { + return f != NULL ? *f : QFont(); + } + +// --- +static bool (*qtkde_initializeIntegration)( ); +static QStringList (*qtkde_getOpenFileNames)( const QString& filter, QString* workingDirectory, + long parent, const QCString& name, const QString& caption, QString* selectedFilter, + bool multiple ); +static QString (*qtkde_getSaveFileName)( const QString& initialSelection, const QString& filter, + QString* workingDirectory, long parent, const QCString& name, const QString& caption, + QString* selectedFilter ); +static QString (*qtkde_getExistingDirectory)( const QString& initialDirectory, long parent, + const QCString& name, const QString& caption ); +static QColor (*qtkde_getColor)( const QColor& color, long parent, const QCString& name ); +static QFont (*qtkde_getFont)( bool* ok, const QFont& def, long parent, const QCString& name ); +static int (*qtkde_messageBox1)( int type, long parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ); +static int (*qtkde_messageBox2)( int type, long parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ); + +void QKDEIntegration::initLibrary() + { + if( !inited ) + { + enable = false; + inited = true; + QString libpath = findLibrary(); + if( libpath.isEmpty()) + return; + QLibrary lib( libpath ); + lib.setAutoUnload( false ); + qtkde_initializeIntegration = ( + bool (*)( ) + ) + lib.resolve("initializeIntegration"); + if( qtkde_initializeIntegration == NULL ) + return; + qtkde_getOpenFileNames = ( + QStringList (*)( const QString& filter, QString* workingDirectory, long parent, + const QCString& name, const QString& caption, QString* selectedFilter, + bool multiple ) + ) + lib.resolve("getOpenFileNames"); + if( qtkde_getOpenFileNames == NULL ) + return; + qtkde_getSaveFileName = ( + QString (*)( const QString& initialSelection, const QString& filter, QString* workingDirectory, + long parent, const QCString& name, const QString& caption, QString* selectedFilter ) + ) + lib.resolve("getSaveFileName"); + if( qtkde_getSaveFileName == NULL ) + return; + qtkde_getExistingDirectory = ( + QString (*)( const QString& initialDirectory, long parent, const QCString& name, + const QString& caption ) + ) + lib.resolve("getExistingDirectory"); + if( qtkde_getExistingDirectory == NULL ) + return; + qtkde_getColor = ( + QColor (*)( const QColor& color, long parent, const QCString& name ) + ) + lib.resolve("getColor"); + if( qtkde_getColor == NULL ) + return; + qtkde_getFont = ( + QFont (*)( bool* ok, const QFont& def, long parent, const QCString& name ) + ) + lib.resolve("getFont"); + if( qtkde_getFont == NULL ) + return; + qtkde_messageBox1 = ( + int (*)( int type, long parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ) + ) + lib.resolve("messageBox1"); + if( qtkde_messageBox1 == NULL ) + return; + qtkde_messageBox2 = ( + int (*)( int type, long parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + ) + lib.resolve("messageBox2"); + if( qtkde_messageBox2 == NULL ) + return; + enable = qtkde_initializeIntegration(); + } + } + +bool QKDEIntegration::initializeIntegration( ) + { + return qtkde_initializeIntegration( + ); + } +QStringList QKDEIntegration::getOpenFileNames( const QString& filter, QString* workingDirectory, + QWidget* parent, const char* name, const QString& caption, QString* selectedFilter, + bool multiple ) + { + return qtkde_getOpenFileNames( + filter, workingDirectory, widgetToWinId( parent ), name, caption, selectedFilter, multiple ); + } +QString QKDEIntegration::getSaveFileName( const QString& initialSelection, const QString& filter, + QString* workingDirectory, QWidget* parent, const char* name, const QString& caption, + QString* selectedFilter ) + { + return qtkde_getSaveFileName( + initialSelection, filter, workingDirectory, widgetToWinId( parent ), name, caption, selectedFilter ); + } +QString QKDEIntegration::getExistingDirectory( const QString& initialDirectory, QWidget* parent, + const char* name, const QString& caption ) + { + return qtkde_getExistingDirectory( + initialDirectory, widgetToWinId( parent ), name, caption ); + } +QColor QKDEIntegration::getColor( const QColor& color, QWidget* parent, const char* name ) + { + return qtkde_getColor( + color, widgetToWinId( parent ), name ); + } +QFont QKDEIntegration::getFont( bool* ok, const QFont* def, QWidget* parent, const char* name ) + { + return qtkde_getFont( + ok, fontPtrToFontRef( def ), widgetToWinId( parent ), name ); + } +int QKDEIntegration::messageBox1( int type, QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ) + { + return qtkde_messageBox1( + type, widgetToWinId( parent ), caption, text, button0, button1, button2 ); + } +int QKDEIntegration::messageBox2( int type, QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + { + return qtkde_messageBox2( + type, widgetToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } +// --- + +int QKDEIntegration::information( QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ) + { + return qtkde_messageBox1( + QMessageBox::Information, widgetToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int QKDEIntegration::question( QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ) + { + return qtkde_messageBox1( + QMessageBox::Question, widgetToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int QKDEIntegration::warning( QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ) + { + return qtkde_messageBox1( + QMessageBox::Warning, widgetToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int QKDEIntegration::critical( QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ) + { + return qtkde_messageBox1( + QMessageBox::Critical, widgetToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int QKDEIntegration::information( QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + { + return qtkde_messageBox2( + QMessageBox::Information, widgetToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int QKDEIntegration::question( QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + { + return qtkde_messageBox2( + QMessageBox::Question, widgetToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int QKDEIntegration::warning( QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + { + return qtkde_messageBox2( + QMessageBox::Warning, widgetToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int QKDEIntegration::critical( QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ) + { + return qtkde_messageBox2( + QMessageBox::Critical, widgetToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } diff --git a/main/dependencies/qt3/src/kernel/qtkdeintegration_x11_p.h b/main/dependencies/qt3/src/kernel/qtkdeintegration_x11_p.h new file mode 100644 index 000000000..180ec7a04 --- /dev/null +++ b/main/dependencies/qt3/src/kernel/qtkdeintegration_x11_p.h @@ -0,0 +1,62 @@ +/* This file is licensed under the terms of the GPL v2 or v3, as it has been publicly released by + OpenSUSE as part of their GPLed Qt library disribution */ + +#ifndef QKDEINTEGRATION_H +#define QKDEINTEGRATION_H + +#include <qstringlist.h> + +class QLibrary; +class QWidget; +class QColor; +class QFont; + +class QKDEIntegration + { + public: + static bool enabled(); +// --- + static bool initializeIntegration( ); + static QStringList getOpenFileNames( const QString& filter, QString* workingDirectory, + QWidget* parent, const char* name, const QString& caption, QString* selectedFilter, + bool multiple ); + static QString getSaveFileName( const QString& initialSelection, const QString& filter, + QString* workingDirectory, QWidget* parent, const char* name, const QString& caption, + QString* selectedFilter ); + static QString getExistingDirectory( const QString& initialDirectory, QWidget* parent, + const char* name, const QString& caption ); + static QColor getColor( const QColor& color, QWidget* parent, const char* name ); + static QFont getFont( bool* ok, const QFont* def, QWidget* parent, const char* name ); + static int messageBox1( int type, QWidget* parent, const QString& caption, + const QString& text, int button0, int button1, int button2 ); + static int information( QWidget* parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ); + static int question( QWidget* parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ); + static int warning( QWidget* parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ); + static int critical( QWidget* parent, const QString& caption, const QString& text, + int button0, int button1, int button2 ); + static int messageBox2( int type, QWidget* parent, const QString& caption, + const QString& text, const QString& button0Text, const QString& button1Text, + const QString& button2Text, int defaultButton, int escapeButton ); + static int information( QWidget* parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ); + static int question( QWidget* parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ); + static int warning( QWidget* parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ); + static int critical( QWidget* parent, const QString& caption, const QString& text, + const QString& button0Text, const QString& button1Text, const QString& button2Text, + int defaultButton, int escapeButton ); +// --- + private: + static void initLibrary(); + static bool inited; + static bool enable; + }; + +#endif |