• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

rocs/VisualEditor

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • VisualEditor
  • Tools
  • TransformEdges
TransformEdgesToolsPlugin.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright (C) 2011 Andreas Cord-Landwehr <cola@uni-paderborn.de>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "TransformEdgesToolsPlugin.h"
20 #include "TransformEdgesWidget.h"
21 #include "../ToolsPluginInterface.h"
22 #include <CoreTypes.h>
23 #include <Document.h>
24 #include <DocumentManager.h>
25 #include <DataStructure.h>
26 #include <DataStructureBackendInterface.h>
27 
28 #include <QtCore/QString>
29 #include <QtCore/QStringList>
30 #include <QtGui/QGridLayout>
31 #include <QtGui/QLabel>
32 #include <QtGui/QFont>
33 #include <QtGui/QDesktopWidget>
34 #include <QtGui/QApplication>
35 
36 #include <KAboutData>
37 #include <kgenericfactory.h>
38 #include <KLocalizedString>
39 
40 #include <map>
41 #include "ui_TransformEdgesWidget.h"
42 
43 static const KAboutData aboutdata("rocs_transformedgesplugin", 0, ki18nc("@title Displayed plugin name", "Transform Edges") , "0.1");
44 
45 K_PLUGIN_FACTORY(ToolsPluginFactory, registerPlugin<TransformEdgesToolPlugin>();)
46 K_EXPORT_PLUGIN(ToolsPluginFactory(aboutdata))
47 
48 TransformEdgesToolPlugin::TransformEdgesToolPlugin(QObject* parent, const QList<QVariant> & /* args*/):
49  ToolsPluginInterface(ToolsPluginFactory::componentData(), parent)
50 {
51 
52 }
53 
54 TransformEdgesToolPlugin::~TransformEdgesToolPlugin()
55 {
56 
57 }
58 
59 void TransformEdgesToolPlugin::run(Document *document) const
60 {
61  if (document == 0) {
62  document = DocumentManager::self().activeDocument();
63  }
64 
65  QPointer<TransformEdgesWidget> dialog = new TransformEdgesWidget(document, 0);
66 
67  QList< DataStructurePtr > dsList = document->dataStructures();
68  QStringList dsNames;
69 
70  // be sure that only graph-datastructures are accessed by this plugin
71  if (document->backend()->internalName() == "Graph") {
72  foreach(DataStructurePtr ds, dsList) {
73  dsNames << ds->name();
74  }
75  }
76 
77  dialog->addDataStructures(dsNames);
78  dialog->exec();
79  return;
80 }
81 
TransformEdgesToolsPlugin.h
TransformEdgesToolPlugin::~TransformEdgesToolPlugin
~TransformEdgesToolPlugin()
Definition: TransformEdgesToolsPlugin.cpp:54
QObject
aboutdata
static const KAboutData aboutdata("rocs_transformedgesplugin", 0, ki18nc("@title Displayed plugin name","Transform Edges"),"0.1")
TransformEdgesWidget.h
ToolsPluginInterface
This interface must be implemented by all Visual graph editor tools.
Definition: ToolsPluginInterface.h:73
TransformEdgesWidget
Definition: TransformEdgesWidget.h:33
TransformEdgesToolPlugin
Definition: TransformEdgesToolsPlugin.h:26
TransformEdgesToolPlugin::run
void run(Document *document=0) const
Implement this method for each plugin.
Definition: TransformEdgesToolsPlugin.cpp:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/VisualEditor

Skip menu "rocs/VisualEditor"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal