summaryrefslogtreecommitdiffstats
path: root/tqt3integration/module/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'tqt3integration/module/module.h')
-rw-r--r--tqt3integration/module/module.h154
1 files changed, 154 insertions, 0 deletions
diff --git a/tqt3integration/module/module.h b/tqt3integration/module/module.h
new file mode 100644
index 000000000..80bc4a346
--- /dev/null
+++ b/tqt3integration/module/module.h
@@ -0,0 +1,154 @@
+ /*
+ * This file is part of the Trinity Desktop Environment
+ *
+ * Original file taken from the OpenSUSE kdebase builds
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _INTEGRATION_MODULE_H_
+#define _INTEGRATION_MODULE_H_
+
+#include <kcolordialog.h>
+#include <kdedmodule.h>
+#include <kdirselectdialog.h>
+#include <kfiledialog.h>
+#include <kfontdialog.h>
+#include <kdialogbase.h>
+
+class DCOPClientTransaction;
+
+namespace KDEIntegration
+{
+
+class Module
+ : public KDEDModule
+ {
+ Q_OBJECT
+ public:
+ Module( const QCString& obj );
+ // DCOP
+ virtual bool process(const QCString &fun, const QByteArray &data,
+ QCString &replyType, QByteArray &replyData);
+ virtual QCStringList functions();
+ virtual QCStringList interfaces();
+ private slots:
+ void dialogDone( int result );
+ private:
+ struct JobData
+ {
+ DCOPClientTransaction* transaction;
+ enum
+ {
+ GetOpenFileNames,
+ GetSaveFileName,
+ GetExistingDirectory,
+ GetColor,
+ GetFont,
+ MessageBox1,
+ MessageBox2
+ } type;
+ };
+ QMap< void*, JobData > jobs;
+#include "module_functions.h"
+ };
+
+class KFileDialog
+ : public ::KFileDialog
+ {
+ Q_OBJECT
+ public:
+ KFileDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name, bool modal)
+ : ::KFileDialog( startDir, filter, parent, name, modal )
+ {}
+ signals:
+ void dialogDone( int result );
+ protected:
+ virtual void done( int r ) { ::KFileDialog::done( r ); emit dialogDone( r ); }
+ };
+
+
+class KDirSelectDialog
+ : public ::KDirSelectDialog
+ {
+ Q_OBJECT
+ public:
+ KDirSelectDialog(const QString& startDir, bool localOnly,
+ QWidget *parent, const char *name, bool modal)
+ : ::KDirSelectDialog( startDir, localOnly, parent, name, modal )
+ {}
+ signals:
+ void dialogDone( int result );
+ protected:
+ virtual void done( int r ) { ::KDirSelectDialog::done( r ); emit dialogDone( r ); }
+ };
+
+
+class KColorDialog
+ : public ::KColorDialog
+ {
+ Q_OBJECT
+ public:
+ KColorDialog( QWidget *parent, const char *name, bool modal )
+ : ::KColorDialog( parent, name, modal )
+ {}
+ signals:
+ void dialogDone( int result );
+ protected:
+ virtual void done( int r ) { ::KColorDialog::done( r ); emit dialogDone( r ); } // hmm?
+ };
+
+class KFontDialog
+ : public ::KFontDialog
+ {
+ Q_OBJECT
+ public:
+ KFontDialog( QWidget *parent, const char *name, bool onlyFixed, bool modal,
+ const QStringList &fontlist = QStringList(), bool makeFrame = true,
+ bool diff = false, QButton::ToggleState *sizeIsRelativeState = 0L )
+ : ::KFontDialog( parent, name, onlyFixed, modal, fontlist, makeFrame, diff, sizeIsRelativeState )
+ {}
+ signals:
+ void dialogDone( int result );
+ protected:
+ virtual void done( int r ) { ::KFontDialog::done( r ); emit dialogDone( r ); }
+ };
+
+class KDialogBase
+ : public ::KDialogBase
+ {
+ Q_OBJECT
+ public:
+ KDialogBase( const QString &caption, int buttonMask=Yes|No|Cancel,
+ ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel,
+ QWidget *parent=0, const char *name=0,
+ bool modal=true, bool separator=false,
+ const KGuiItem &yes = KStdGuiItem::yes(), // i18n("&Yes")
+ const KGuiItem &no = KStdGuiItem::no(), // i18n("&No"),
+ const KGuiItem &cancel = KStdGuiItem::cancel()) // i18n("&Cancel")
+ : ::KDialogBase( caption, buttonMask, defaultButton, escapeButton, parent, name, modal, separator,
+ yes, no, cancel )
+ {}
+ signals:
+ void dialogDone( int result );
+ protected:
+ virtual void done( int r ) { ::KDialogBase::done( r ); emit dialogDone( r ); }
+ };
+
+
+} // namespace
+
+#endif