[kgraphviewer-devel] [KGraphViewer/libkgraphviz] ca72615: Move back kgraphviewer_(export|interface) to part/

Kevin Funk krf at electrostorm.net
Mon Dec 20 14:46:42 CET 2010


	A	 src/part/kgraphviewer_interface.h	 [License: UNKNOWN]


	A	 src/part/kgraphviewer_export.h	 [License: UNKNOWN]

commit ca726156dffd360b5654c0e7ad579e64ab014b56
Author: Kevin Funk <krf at electrostorm.net>
Date:   Mon Dec 20 14:45:37 2010 +0100

    Move back kgraphviewer_(export|interface) to part/
    
    It is no longer shared and used by kgraphviewerpart only.

diff --git a/src/kgraphviewer.cpp b/src/kgraphviewer.cpp
index 6b038c7..f2a7b32 100644
--- a/src/kgraphviewer.cpp
+++ b/src/kgraphviewer.cpp
@@ -18,7 +18,7 @@
 
 
 #include "kgraphviewer.h"
-#include "shared/kgraphviewer_interface.h"
+#include "kgraphviewer_interface.h"
 #include "kgraphviewerConfigDialog.h"
 #include "kgraphviewersettings.h"
 #include "ui_preferencesParsing.h"
diff --git a/src/part/CMakeLists.txt b/src/part/CMakeLists.txt
index 9042d5f..f01855f 100644
--- a/src/part/CMakeLists.txt
+++ b/src/part/CMakeLists.txt
@@ -52,3 +52,6 @@ install( FILES kgraphviewer_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
 install( FILES kgraphviewer-bev.png DESTINATION ${DATA_INSTALL_DIR}/kgraphviewerpart/pics )
 install( FILES kgraphviewer-newnode.png DESTINATION ${DATA_INSTALL_DIR}/kgraphviewerpart/pics )
 install( FILES kgraphviewer-newedge.png DESTINATION ${DATA_INSTALL_DIR}/kgraphviewerpart/pics )
+
+install(FILES kgraphviewer_interface.h DESTINATION ${INCLUDE_INSTALL_DIR}/kgraphviewer/ COMPONENT Devel)
+install(FILES kgraphviewer_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/kgraphviewer/ COMPONENT Devel)
diff --git a/src/part/kgraphviewer_export.h b/src/part/kgraphviewer_export.h
new file mode 100644
index 0000000..b171ec4
--- /dev/null
+++ b/src/part/kgraphviewer_export.h
@@ -0,0 +1,40 @@
+/*  This file is part of the KGraphViewer
+    Copyright (C) 2010 Gael de Chalendar <kleag at free.fr>
+
+    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., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KGRAPHVIEWER_EXPORT_H
+#define KGRAPHVIEWER_EXPORT_H
+
+/* needed for KDE_EXPORT and KDE_IMPORT macros */
+#include <kdemacros.h>
+
+#ifndef KGRAPHVIEWER_EXPORT
+# if defined(MAKE_KGRAPHVIEWER_LIB)
+   /* We are building this library */
+#  define KGRAPHVIEWER_EXPORT KDE_EXPORT
+# else
+   /* We are using this library */
+#  define KGRAPHVIEWER_EXPORT KDE_IMPORT
+# endif
+#endif
+
+# ifndef KGRAPHVIEWER_EXPORT_DEPRECATED
+#  define KGRAPHVIEWER_EXPORT_DEPRECATED KDE_DEPRECATED KGRAPHVIEWER_EXPORT
+# endif
+
+#endif
diff --git a/src/part/kgraphviewer_interface.h b/src/part/kgraphviewer_interface.h
new file mode 100644
index 0000000..2095318
--- /dev/null
+++ b/src/part/kgraphviewer_interface.h
@@ -0,0 +1,140 @@
+// interface.h
+// Copyright (C)  2002  Dominique Devriese <devriese at kde.org>
+
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 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
+// Lesser General Public License for more details.
+
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301  USA
+
+#ifndef KGRAPHVIEWER_INTERFACE_H
+#define KGRAPHVIEWER_INTERFACE_H
+
+#include <kgraphviz/dotgraphview.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QMap>
+#include <QtGui/QCursor>
+
+namespace KParts
+{
+  class Part;
+}
+
+class QStringList;
+
+namespace KGraphViewer
+{
+
+/**
+ * KGraphViewerInterface is an interface implemented by KGraphViewer to
+ * allow developers access to the KGraphViewerPart in ways that are not
+ * possible through the normal KPart interface.
+ *
+ * Note that besides the functions below here, KGraphViewer also has
+ * some signals you can connect to.  They aren't in this class cause
+ * we can't have signals without having a QObject, which
+ * KGraphViewerInterface is not. To see a list of signals, take a look at kgraphviewer_part.h
+ * 
+ * See the example code below for how to connect to these..
+ *
+ * Use it like this:
+ * \code
+ *  // fetch the Part..
+ *  KLibFactory *factory = KLibLoader::self()->factory("kgraphviewerpart");
+ *  if (factory) {
+ *      part = factory->create<KParts::ReadOnlyPart>(this);
+ *
+ *      // cast the part to the KGraphViewerInterface...
+ *      KGraphViewerInterface* graph = qobject_cast<KGraphViewerInterface*>( part );
+ *      if( ! graph )
+ *      {
+ *        // This should not happen
+ *        return;
+ *      }
+ *      // now use the interface in all sorts of ways...
+ *  }
+ * \endcode
+ *
+ * @author Milian Wolff <mail at milianw.de>
+ * 
+ * 
+ * WARNING: This is highly experimental and no kind of BC guarantees are given!
+ * TODO: documentation
+ */
+class KGraphViewerInterface
+{
+public:
+  enum LayoutMethod
+  {
+    ExternalProgram,
+    InternalLibrary
+  };
+
+  virtual void setLayoutMethod(LayoutMethod method) = 0;
+  virtual void zoomIn() = 0;
+  virtual void zoomOut() = 0;
+  virtual void zoomBy(double factor) = 0;
+  virtual void setZoomFactor(double factor) = 0;
+
+  virtual void setPannerPosition(KGraphViz::DotGraphView::PannerPosition position) = 0;
+  virtual void setPannerEnabled(bool enabled) = 0;
+
+  virtual void setLayoutCommand(const QString& command) = 0;
+
+  virtual void selectNode(const QString& nodeId) = 0;
+  virtual void centerOnNode(const QString& nodeId) = 0;
+
+  // Slots
+  virtual void slotHide(KParts::Part* part) = 0;
+  virtual void slotUpdate() = 0;
+  virtual void prepareAddNewElement(QMap<QString,QString> attribs) = 0;
+  virtual void prepareAddNewEdge(QMap<QString,QString> attribs) = 0;
+  virtual void setReadOnly() = 0;
+  virtual void setReadWrite() = 0;
+  virtual void saveTo(const QString& fileName) = 0;
+  virtual void slotRemoveNode(const QString&) = 0;
+  virtual void slotRemoveNodeFromSubgraph(const QString& nodeName, const QString& subgraphName) = 0;
+  virtual void slotRemoveSubgraph(const QString&) = 0;
+  virtual void slotAddAttribute(const QString&) = 0;
+  virtual void slotSetAttribute(const QString& elementId, const QString& attributeName, const QString& attributeValue) = 0;
+  virtual void slotRemoveAttribute(const QString&,const QString&) = 0;
+  virtual void slotSetGraphAttributes(QMap<QString,QString> attribs) = 0;
+  virtual void slotAddNewNode(QMap<QString,QString> attribs) = 0;
+  virtual void slotAddNewNodeToSubgraph(QMap<QString,QString> attribs, QString subgraph) = 0;
+  virtual void slotAddExistingNodeToSubgraph(QMap<QString,QString> attribs, QString subgraph) = 0;
+  virtual void slotMoveExistingNodeToMainGraph(QMap<QString,QString>) = 0;
+  virtual void slotAddNewSubgraph(QMap<QString,QString> attribs) = 0;
+  virtual void slotAddNewEdge(QString src, QString tgt, QMap<QString,QString> attribs) = 0;
+  virtual void slotRemoveEdge(const QString& id) = 0;
+  virtual void slotRemoveElement(const QString& id) = 0;
+  virtual void slotClose() = 0;
+  virtual void slotSelectNode(const QString&) = 0;
+  virtual void slotSetHighlighting(bool highlightingValue) = 0;
+  virtual void slotPrepareToSelect() = 0;
+  virtual void slotSetCursor(const QCursor& cursor) = 0;
+  virtual void slotUnsetCursor() = 0;
+  virtual void slotSetLayoutMethod(LayoutMethod method) = 0;
+  virtual void slotRenameNode(const QString& oldName, const QString& newName) = 0;
+  virtual void setBackgroundColor(const QColor& color) = 0;
+  
+
+protected:
+  KGraphViewerInterface() {}
+  virtual ~KGraphViewerInterface() {}
+};
+
+}
+
+Q_DECLARE_INTERFACE(KGraphViewer::KGraphViewerInterface, "org.kde.KGraphViewerInterface")
+
+#endif // KGRAPHVIEWER_INTERFACE_H
diff --git a/src/part/kgraphviewer_part.h b/src/part/kgraphviewer_part.h
index 4e2f326..aeb213b 100644
--- a/src/part/kgraphviewer_part.h
+++ b/src/part/kgraphviewer_part.h
@@ -19,7 +19,7 @@
 #ifndef _KGRAPHVIEWERPART_H_
 #define _KGRAPHVIEWERPART_H_
 
-#include "shared/kgraphviewer_interface.h"
+#include "kgraphviewer_interface.h"
 
 #include <kgraphviz/dotgraphview.h>
 
diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt
deleted file mode 100644
index b19c9be..0000000
--- a/src/shared/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-install(FILES kgraphviewer_interface.h DESTINATION ${INCLUDE_INSTALL_DIR}/kgraphviewer/ COMPONENT Devel)
-install(FILES kgraphviewer_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/kgraphviewer/ COMPONENT Devel)
diff --git a/src/shared/kgraphviewer_export.h b/src/shared/kgraphviewer_export.h
deleted file mode 100644
index b171ec4..0000000
--- a/src/shared/kgraphviewer_export.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*  This file is part of the KGraphViewer
-    Copyright (C) 2010 Gael de Chalendar <kleag at free.fr>
-
-    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., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef KGRAPHVIEWER_EXPORT_H
-#define KGRAPHVIEWER_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KGRAPHVIEWER_EXPORT
-# if defined(MAKE_KGRAPHVIEWER_LIB)
-   /* We are building this library */
-#  define KGRAPHVIEWER_EXPORT KDE_EXPORT
-# else
-   /* We are using this library */
-#  define KGRAPHVIEWER_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KGRAPHVIEWER_EXPORT_DEPRECATED
-#  define KGRAPHVIEWER_EXPORT_DEPRECATED KDE_DEPRECATED KGRAPHVIEWER_EXPORT
-# endif
-
-#endif
diff --git a/src/shared/kgraphviewer_interface.h b/src/shared/kgraphviewer_interface.h
deleted file mode 100644
index 2095318..0000000
--- a/src/shared/kgraphviewer_interface.h
+++ /dev/null
@@ -1,140 +0,0 @@
-// interface.h
-// Copyright (C)  2002  Dominique Devriese <devriese at kde.org>
-
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 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
-// Lesser General Public License for more details.
-
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301  USA
-
-#ifndef KGRAPHVIEWER_INTERFACE_H
-#define KGRAPHVIEWER_INTERFACE_H
-
-#include <kgraphviz/dotgraphview.h>
-
-#include <QtCore/QObject>
-#include <QtCore/QMap>
-#include <QtGui/QCursor>
-
-namespace KParts
-{
-  class Part;
-}
-
-class QStringList;
-
-namespace KGraphViewer
-{
-
-/**
- * KGraphViewerInterface is an interface implemented by KGraphViewer to
- * allow developers access to the KGraphViewerPart in ways that are not
- * possible through the normal KPart interface.
- *
- * Note that besides the functions below here, KGraphViewer also has
- * some signals you can connect to.  They aren't in this class cause
- * we can't have signals without having a QObject, which
- * KGraphViewerInterface is not. To see a list of signals, take a look at kgraphviewer_part.h
- * 
- * See the example code below for how to connect to these..
- *
- * Use it like this:
- * \code
- *  // fetch the Part..
- *  KLibFactory *factory = KLibLoader::self()->factory("kgraphviewerpart");
- *  if (factory) {
- *      part = factory->create<KParts::ReadOnlyPart>(this);
- *
- *      // cast the part to the KGraphViewerInterface...
- *      KGraphViewerInterface* graph = qobject_cast<KGraphViewerInterface*>( part );
- *      if( ! graph )
- *      {
- *        // This should not happen
- *        return;
- *      }
- *      // now use the interface in all sorts of ways...
- *  }
- * \endcode
- *
- * @author Milian Wolff <mail at milianw.de>
- * 
- * 
- * WARNING: This is highly experimental and no kind of BC guarantees are given!
- * TODO: documentation
- */
-class KGraphViewerInterface
-{
-public:
-  enum LayoutMethod
-  {
-    ExternalProgram,
-    InternalLibrary
-  };
-
-  virtual void setLayoutMethod(LayoutMethod method) = 0;
-  virtual void zoomIn() = 0;
-  virtual void zoomOut() = 0;
-  virtual void zoomBy(double factor) = 0;
-  virtual void setZoomFactor(double factor) = 0;
-
-  virtual void setPannerPosition(KGraphViz::DotGraphView::PannerPosition position) = 0;
-  virtual void setPannerEnabled(bool enabled) = 0;
-
-  virtual void setLayoutCommand(const QString& command) = 0;
-
-  virtual void selectNode(const QString& nodeId) = 0;
-  virtual void centerOnNode(const QString& nodeId) = 0;
-
-  // Slots
-  virtual void slotHide(KParts::Part* part) = 0;
-  virtual void slotUpdate() = 0;
-  virtual void prepareAddNewElement(QMap<QString,QString> attribs) = 0;
-  virtual void prepareAddNewEdge(QMap<QString,QString> attribs) = 0;
-  virtual void setReadOnly() = 0;
-  virtual void setReadWrite() = 0;
-  virtual void saveTo(const QString& fileName) = 0;
-  virtual void slotRemoveNode(const QString&) = 0;
-  virtual void slotRemoveNodeFromSubgraph(const QString& nodeName, const QString& subgraphName) = 0;
-  virtual void slotRemoveSubgraph(const QString&) = 0;
-  virtual void slotAddAttribute(const QString&) = 0;
-  virtual void slotSetAttribute(const QString& elementId, const QString& attributeName, const QString& attributeValue) = 0;
-  virtual void slotRemoveAttribute(const QString&,const QString&) = 0;
-  virtual void slotSetGraphAttributes(QMap<QString,QString> attribs) = 0;
-  virtual void slotAddNewNode(QMap<QString,QString> attribs) = 0;
-  virtual void slotAddNewNodeToSubgraph(QMap<QString,QString> attribs, QString subgraph) = 0;
-  virtual void slotAddExistingNodeToSubgraph(QMap<QString,QString> attribs, QString subgraph) = 0;
-  virtual void slotMoveExistingNodeToMainGraph(QMap<QString,QString>) = 0;
-  virtual void slotAddNewSubgraph(QMap<QString,QString> attribs) = 0;
-  virtual void slotAddNewEdge(QString src, QString tgt, QMap<QString,QString> attribs) = 0;
-  virtual void slotRemoveEdge(const QString& id) = 0;
-  virtual void slotRemoveElement(const QString& id) = 0;
-  virtual void slotClose() = 0;
-  virtual void slotSelectNode(const QString&) = 0;
-  virtual void slotSetHighlighting(bool highlightingValue) = 0;
-  virtual void slotPrepareToSelect() = 0;
-  virtual void slotSetCursor(const QCursor& cursor) = 0;
-  virtual void slotUnsetCursor() = 0;
-  virtual void slotSetLayoutMethod(LayoutMethod method) = 0;
-  virtual void slotRenameNode(const QString& oldName, const QString& newName) = 0;
-  virtual void setBackgroundColor(const QColor& color) = 0;
-  
-
-protected:
-  KGraphViewerInterface() {}
-  virtual ~KGraphViewerInterface() {}
-};
-
-}
-
-Q_DECLARE_INTERFACE(KGraphViewer::KGraphViewerInterface, "org.kde.KGraphViewerInterface")
-
-#endif // KGRAPHVIEWER_INTERFACE_H


More information about the kgraphviewer-devel mailing list