• 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.14
  • kdeedu
  • rocs
  • VisualEditor
  • Tools
  • AssignValues
AssignValuesToolsPlugin.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 "AssignValuesToolsPlugin.h"
20 #include "AssignValuesWidget.h"
21 #include "../ToolsPluginInterface.h"
22 #include <CoreTypes.h>
23 #include <Document.h>
24 #include <DataStructure.h>
25 #include <DocumentManager.h>
26 
27 #include <QtCore/QString>
28 #include <QtCore/QStringList>
29 #include <QtGui/QGridLayout>
30 #include <QtGui/QLabel>
31 #include <QtGui/QFont>
32 #include <QtGui/QDesktopWidget>
33 #include <QtGui/QApplication>
34 
35 #include <KAboutData>
36 #include <kgenericfactory.h>
37 #include <KLocalizedString>
38 
39 #include <map>
40 #include <ui_AssignValuesWidget.h>
41 
42 static const KAboutData aboutdata("rocs_assignvaluesplugin", 0, ki18nc("@title Displayed plugin name", "Assign Values") , "0.1");
43 
44 K_PLUGIN_FACTORY(ToolsPluginFactory, registerPlugin<AssignValuesToolPlugin>();)
45 K_EXPORT_PLUGIN(ToolsPluginFactory(aboutdata))
46 
47 AssignValuesToolPlugin::AssignValuesToolPlugin(QObject* parent, const QList<QVariant> & /* args*/):
48  ToolsPluginInterface(ToolsPluginFactory::componentData(), parent)
49 {
50 
51 }
52 
53 AssignValuesToolPlugin::~AssignValuesToolPlugin()
54 {
55 
56 }
57 
58 void AssignValuesToolPlugin::run(Document *document) const
59 {
60  if (document == 0) {
61  document = DocumentManager::self().activeDocument();
62  }
63  QPointer<AssignValuesWidget> dialog = new AssignValuesWidget(document);
64 
65  // data structures to selector box
66  QList< DataStructurePtr > dsList = document->dataStructures();
67  QStringList dsNames;
68  foreach(DataStructurePtr ds, dsList) {
69  dsNames << ds->name();
70  }
71  dialog->addDataStructures(dsNames);
72 
73  dialog->exec();
74  return;
75 }
AssignValuesWidget
Definition: AssignValuesWidget.h:30
QPointer
AssignValuesToolPlugin
Definition: AssignValuesToolsPlugin.h:26
AssignValuesToolsPlugin.h
QObject
QList
ToolsPluginInterface
This interface must be implemented by all Visual graph editor tools.
Definition: ToolsPluginInterface.h:73
AssignValuesWidget.h
QStringList
aboutdata
static const KAboutData aboutdata("rocs_assignvaluesplugin", 0, ki18nc("@title Displayed plugin name","Assign Values"),"0.1")
AssignValuesToolPlugin::~AssignValuesToolPlugin
~AssignValuesToolPlugin()
Definition: AssignValuesToolsPlugin.cpp:53
AssignValuesToolPlugin::run
void run(Document *document=0) const
Implement this method for each plugin.
Definition: AssignValuesToolsPlugin.cpp:58
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:27 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
  • 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