summaryrefslogtreecommitdiffstats
path: root/lib/interfaces/extras
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /lib/interfaces/extras
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/interfaces/extras')
-rw-r--r--lib/interfaces/extras/Mainpage.dox11
-rw-r--r--lib/interfaces/extras/Makefile.am18
-rw-r--r--lib/interfaces/extras/kdevcompileroptions.cpp6
-rw-r--r--lib/interfaces/extras/kdevcompileroptions.h90
-rw-r--r--lib/interfaces/extras/kdevelopcompileroptions.desktop48
-rw-r--r--lib/interfaces/extras/kdevelopvcsintegrator.desktop45
-rw-r--r--lib/interfaces/extras/kdevvcsintegrator.cpp26
-rw-r--r--lib/interfaces/extras/kdevvcsintegrator.h76
8 files changed, 320 insertions, 0 deletions
diff --git a/lib/interfaces/extras/Mainpage.dox b/lib/interfaces/extras/Mainpage.dox
new file mode 100644
index 00000000..f72dade5
--- /dev/null
+++ b/lib/interfaces/extras/Mainpage.dox
@@ -0,0 +1,11 @@
+/**
+@mainpage The KDevelop Extra Interfaces Library
+
+This library contains extra interfaces that are not the part of KDevelop plugin architecture
+but that can be implemented by extra plugins or "plugins for plugins".
+
+<b>Link with</b>: -lkdevextras
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/interfaces/extras
+*/
+
diff --git a/lib/interfaces/extras/Makefile.am b/lib/interfaces/extras/Makefile.am
new file mode 100644
index 00000000..b8b3e091
--- /dev/null
+++ b/lib/interfaces/extras/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+libkdevextras_la_LIBADD = $(LIB_QT)
+libkdevextras_la_LDFLAGS = $(all_libraries)
+lib_LTLIBRARIES = libkdevextras.la
+kdevelopincludedir = $(includedir)/kdevelop/interfaces/extras
+servicetypedir = $(kde_servicetypesdir)
+
+kdevelopinclude_HEADERS = kdevcompileroptions.h kdevvcsintegrator.h
+libkdevextras_la_SOURCES = kdevcompileroptions.cpp kdevvcsintegrator.cpp
+servicetype_DATA = kdevelopcompileroptions.desktop \
+ kdevelopvcsintegrator.desktop
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Extra Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../../Doxyfile.am
diff --git a/lib/interfaces/extras/kdevcompileroptions.cpp b/lib/interfaces/extras/kdevcompileroptions.cpp
new file mode 100644
index 00000000..5d87eec7
--- /dev/null
+++ b/lib/interfaces/extras/kdevcompileroptions.cpp
@@ -0,0 +1,6 @@
+#include "kdevcompileroptions.h"
+
+KDevCompilerOptions::KDevCompilerOptions( QObject * parent, const char * name )
+ :QObject(parent, name)
+{
+}
diff --git a/lib/interfaces/extras/kdevcompileroptions.h b/lib/interfaces/extras/kdevcompileroptions.h
new file mode 100644
index 00000000..268ce0af
--- /dev/null
+++ b/lib/interfaces/extras/kdevcompileroptions.h
@@ -0,0 +1,90 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+@file kdevcompileroptions.h
+The interface to compiler options configuration.
+*/
+
+#ifndef _KDEVCOMPILEROPTIONS_H_
+#define _KDEVCOMPILEROPTIONS_H_
+
+#include <qobject.h>
+
+/**
+The interface to compiler options configuration.
+Used by build systems to give users a compiler options configuration dialog.
+
+Common use case:
+@code
+static KDevCompilerOptions *createCompilerOptions( const QString &name, QObject *parent )
+{
+ KService::Ptr service = KService::serviceByDesktopName( name );
+ if ( !service )
+ return 0;
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory)
+ return 0;
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(parent, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions"))
+ return 0;
+
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+ return dlg;
+}
+
+...
+KDevCompilerOptions *plugin = createCompilerOptions(compilerName, parent);
+QString flags = ""; //old compiler flags
+if ( plugin )
+{
+ flags = plugin->exec( parent, flags ); //new compiler flags are returned
+ delete plugin;
+}
+@endcode
+*/
+class KDevCompilerOptions : public QObject
+{
+ Q_OBJECT
+
+public:
+ KDevCompilerOptions( QObject *parent=0, const char *name=0 );
+
+ /**
+ * Opens a dialog which allows the user to configure the
+ * compiler options. The initial settings in the dialog
+ * will be set from the flags argument of this method.
+ * After the dialog is accepted, the new settings will
+ * be returned as a string. If the dialog was cancelled,
+ * QString::null is returned.
+ */
+ virtual QString exec(QWidget *parent, const QString &flags) = 0;
+};
+
+#endif
diff --git a/lib/interfaces/extras/kdevelopcompileroptions.desktop b/lib/interfaces/extras/kdevelopcompileroptions.desktop
new file mode 100644
index 00000000..7ed1df67
--- /dev/null
+++ b/lib/interfaces/extras/kdevelopcompileroptions.desktop
@@ -0,0 +1,48 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/CompilerOptions
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Compiler Options Dialog Interface
+Name[ca]=Interfície del diàleg d'opcions del compilador per a KDevelop
+Name[da]=KDevelop grænseflade til oversætterindstillinger
+Name[de]=Schnittstelle für Compiler-Einstellungsdialoge (KDevelop)
+Name[el]=Διασύνδεση διαλόγου επιλογών μεταγλωττιστή KDevelop
+Name[en_GB]=KDevelop Compiler Options Dialogue Interface
+Name[es]=Interfaz del diálogo de opciones del compilador de KDevelop
+Name[et]=KDevelopi kompilaatori valikute dialoogiliides
+Name[eu]=KDevelop-en konpiladore aukeren elkarrizketa-koadro interfazea
+Name[fa]=واسط محاورۀ گزینه‌های مترجم KDevelop
+Name[fr]=Interface de la boîte de dialogue des options du compilateur de KDevelop
+Name[gl]=Interface do diálogo de opcións de compilación de KDevelop
+Name[hi]=के-डेवलप कम्पायलर विकल्प संवाद इंटरफ़ेस
+Name[hu]=A KDevelop fordítási opcióinak párbeszédablaka
+Name[it]=Interfaccia KDevelop per le opzioni di compilazione
+Name[ja]=KDevelop コンパイラオプションダイアログ インターフェース
+Name[nds]=KDevelop-Dialoogkoppelsteed för Kompilerer-Optschonen
+Name[ne]=केडीई विकास कम्पाइलर विकल्प संवाद इन्टरफेस
+Name[nl]=KDevelop Compileroptiesdialoog-interface
+Name[pl]=Interfejs KDevelopa do okna dialogowego opcji kompilatora
+Name[pt]=Interface da Janela de Opções do Compilador do KDevelop
+Name[pt_BR]=Interface de Diálogo de Opções do Compilador do KDevelop
+Name[ru]=Интерфейс диалога опций компилятора
+Name[sk]=KDevelop rozhranie pre možnosti kompilátora
+Name[sl]=Vmesnik za možnosti prevajanja v KDevelopu
+Name[sr]=KDevelop-ов интерфејс дијалога „Опције преводиоца“
+Name[sr@Latn]=KDevelop-ov interfejs dijaloga „Opcije prevodioca“
+Name[sv]=KDevelop dialoggränssnitt för kompilatoralternativ
+Name[ta]=கெடெவலப் தொகுப்பித் தேர்வுகள் உரை இடைமுகம்
+Name[tg]=Гуфтугуи интерфейси талфифгари интихоб
+Name[tr]=KDevelop Derleyici Seçenekleri Pencere Arayüzü
+Name[zh_CN]=KDevelop编译器选项对话框接口
+Name[zh_TW]=KDevelop 編譯器選項對話框介面
+
+[PropertyDef::X-KDevelop-Language]
+Type=QString
+
+[PropertyDef::X-KDevelop-Default]
+Type=bool
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extras/kdevelopvcsintegrator.desktop b/lib/interfaces/extras/kdevelopvcsintegrator.desktop
new file mode 100644
index 00000000..141bf189
--- /dev/null
+++ b/lib/interfaces/extras/kdevelopvcsintegrator.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/VCSIntegrator
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop VCS Integrator
+Name[ca]=Integrador VCS per a KDevelop
+Name[da]=KDevelop VCS-importør
+Name[de]=VCS-Integration für KDevelop
+Name[el]=Ενσωματωτής VCS του KDevelop
+Name[es]=Integrador VCS de KDevelop
+Name[et]=KDevelopi VCS põimija
+Name[eu]=KDevelop-en VCS integratzailea
+Name[fa]=مجتمع‌ساز KDevelop VCS
+Name[fr]=Intégrateur VCS de KDevelop
+Name[gl]=Integrador de VCS de KDevelop
+Name[hu]=KDevelop VCS-integráló
+Name[it]=Integratore VCS di KDevelop
+Name[ja]=KDevelop VCS インテグレータ
+Name[nds]=VKS-Integreren för KDevelop
+Name[ne]=KDevelop VCS इन्टिगेटर
+Name[pl]=KDevelop: integracja z VCS
+Name[pt]=Importador de VCS do KDevelop
+Name[pt_BR]=Integrador VCS para o KDevelop
+Name[ru]=Модуль работы с системами контроля версий для KDevelop
+Name[sk]=Kdevelop VCS integrácia
+Name[sr]=KDevelop-ов VCS интегратор
+Name[sr@Latn]=KDevelop-ov VCS integrator
+Name[sv]=KDevelop VCS-import
+Name[tr]=KDevelop VCS Bütünleyicisi
+Name[zh_CN]=KDevelop VCS 集成器
+Name[zh_TW]=KDevelop VCS 整合器
+
+[PropertyDef::X-KDevelop-VCS]
+Type=QString
+
+[PropertyDef::X-KDevelop-VCSPlugin]
+Type=QString
+
+[PropertyDef::X-KDevelop-Default]
+Type=bool
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extras/kdevvcsintegrator.cpp b/lib/interfaces/extras/kdevvcsintegrator.cpp
new file mode 100644
index 00000000..d231030a
--- /dev/null
+++ b/lib/interfaces/extras/kdevvcsintegrator.cpp
@@ -0,0 +1,26 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevvcsintegrator.h"
+
+KDevVCSIntegrator::KDevVCSIntegrator(QObject *parent, const char *name)
+ :QObject(parent, name)
+{
+}
+
+#include "kdevvcsintegrator.moc"
diff --git a/lib/interfaces/extras/kdevvcsintegrator.h b/lib/interfaces/extras/kdevvcsintegrator.h
new file mode 100644
index 00000000..d180e55f
--- /dev/null
+++ b/lib/interfaces/extras/kdevvcsintegrator.h
@@ -0,0 +1,76 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVVCSINTEGRATOR_H
+#define KDEVVCSINTEGRATOR_H
+
+#include <qobject.h>
+
+/**
+@file kdevvcsintegrator.h
+The interface to VCS integrators.
+*/
+
+class QDomDocument;
+class QWidget;
+
+/**
+VCS Integration Dialog.
+
+Usually it is created as:
+@code
+class MyVCSDialog: public QWidget, public VCSDialog {
+ MyVCSDialog(QWidget *parent = 0, const char *name = 0);
+ virtual void accept() { ... }
+ virtual void init(const QString &projectName, const QString &projectLocation) { ... }
+ virtual QWidget *self() {
+ return const_cast<MyVCSDialog*>(this);
+ }
+}
+@endcode
+*/
+class VCSDialog {
+public:
+ VCSDialog() { }
+ /**Implement all integration actions here. Do not use QDialog::accept method
+ to perform integration actions.*/
+ virtual void accept() = 0;
+ /**Init integration dialog with the project name and location.*/
+ virtual void init(const QString &projectName, const QString &projectLocation) = 0;
+ /**Reimplement to return an actual integration widget. Use QWidgets for that, not
+ QDialogs because integrator dialogs are usually have parent containers.*/
+ virtual QWidget *self() = 0;
+};
+
+/**
+The interface to VCS integrators.
+VCS integrator takes care about setting up VCS for new and existing projects.
+It can, for example, perform checkout or import operations.
+*/
+class KDevVCSIntegrator: public QObject {
+ Q_OBJECT
+public:
+ KDevVCSIntegrator(QObject *parent = 0, const char *name = 0);
+
+ /**Reimplement to return a dialog to fetch the project from VCS.*/
+ virtual VCSDialog *fetcher(QWidget *parent) = 0;
+ /**Reimplement to return a dialog to integrate the project into VCS.*/
+ virtual VCSDialog *integrator(QWidget *parent) = 0;
+};
+
+#endif