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

rocs/RocsCore

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • RocsCore
  • LoadSave
GraphFilePluginInterface.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright 2010-2011 Tomaz Canabrava <tomaz.canabrava@gmail.com>
4  Copyright 2010 Wagner Reck <wagner.reck@gmail.com>
5  Copyright 2012 Andreas Cord-Landwehr <cola@uni-paderborn.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "GraphFilePluginInterface.h"
22 
23 #include <QStringList>
24 #include <QObject>
25 #include <Document.h>
26 #include <KUrl>
27 #include <KDebug>
28 #include <KAboutData>
29 
30 class GraphFilePluginInterfacePrivate
31 {
32 public:
33  GraphFilePluginInterfacePrivate(const KAboutData* aboutData) :
34  aboutData(aboutData)
35  {
36  lastError = GraphFilePluginInterface::None;
37  }
38 
39  const KAboutData* aboutData;
40  GraphFilePluginInterface::Error lastError;
41  QString lastErrorString;
42  Document* graphDocument;
43  KUrl file;
44 };
45 
46 
47 GraphFilePluginInterface::GraphFilePluginInterface(const KAboutData* aboutData, QObject* parent):
48  QObject(parent),
49  d(new GraphFilePluginInterfacePrivate(aboutData))
50 {
51 }
52 
53 
54 GraphFilePluginInterface::~GraphFilePluginInterface()
55 {
56 }
57 
58 
59 GraphFilePluginInterface::PluginType GraphFilePluginInterface::pluginCapability() const
60 {
61  return ImportAndExport;
62 }
63 
64 
65 bool GraphFilePluginInterface::hasError() const
66 {
67  return d->lastError != GraphFilePluginInterface::None;
68 }
69 
70 
71 GraphFilePluginInterface::Error GraphFilePluginInterface::error() const
72 {
73  return d->lastError;
74 }
75 
76 
77 QString GraphFilePluginInterface::errorString() const
78 {
79  return d->lastErrorString;
80 }
81 
82 
83 void GraphFilePluginInterface::setError(GraphFilePluginInterface::Error error, QString message)
84 {
85  d->lastError = error;
86  d->lastErrorString = message;
87 }
88 
89 
90 const KAboutData* GraphFilePluginInterface::aboutData() const
91 {
92  return d->aboutData;
93 }
94 
95 
96 bool GraphFilePluginInterface::isGraphDocument() const
97 {
98  return (d->graphDocument && d->graphDocument->dataStructures().count() > 0);
99 }
100 
101 
102 Document* GraphFilePluginInterface::graphDocument() const
103 {
104  return d->graphDocument;
105 }
106 
107 
108 void GraphFilePluginInterface::setGraphDocument(Document* document)
109 {
110  d->graphDocument = document;
111 }
112 
113 
114 void GraphFilePluginInterface::setFile(const KUrl& file)
115 {
116  d->file = file;
117 }
118 
119 
120 const KUrl& GraphFilePluginInterface::file() const
121 {
122  return d->file;
123 }
124 
GraphFilePluginInterface.h
GraphFilePluginInterface::~GraphFilePluginInterface
virtual ~GraphFilePluginInterface()
Definition: GraphFilePluginInterface.cpp:54
GraphFilePluginInterface::Error
Error
Describes the last error of the plugin.
Definition: GraphFilePluginInterface.h:50
GraphFilePluginInterface::None
Definition: GraphFilePluginInterface.h:51
GraphFilePluginInterface::aboutData
const KAboutData * aboutData() const
Definition: GraphFilePluginInterface.cpp:90
GmlParser::document
Document * document
Definition: GmlGrammar.cpp:40
GraphFilePluginInterface::hasError
bool hasError() const
Definition: GraphFilePluginInterface.cpp:65
GraphFilePluginInterface::GraphFilePluginInterface
GraphFilePluginInterface(const KAboutData *aboutData, QObject *parent)
Constructor.
Definition: GraphFilePluginInterface.cpp:47
QObject
Document.h
GraphFilePluginInterface::setError
void setError(Error error, QString message=QString())
Definition: GraphFilePluginInterface.cpp:83
GraphFilePluginInterface::isGraphDocument
virtual bool isGraphDocument() const
Definition: GraphFilePluginInterface.cpp:96
GraphFilePluginInterface::PluginType
PluginType
Describes the capability of the plugin, i.e., if the plugin can be used to read and/or write files...
Definition: GraphFilePluginInterface.h:65
GraphFilePluginInterface::error
Error error() const
Returns last error.
Definition: GraphFilePluginInterface.cpp:71
GraphFilePluginInterface::ImportAndExport
Definition: GraphFilePluginInterface.h:68
Document
Definition: Document.h:41
GraphFilePluginInterface::setFile
void setFile(const KUrl &file)
Set file that shall be used for nexte read or write operation.
Definition: GraphFilePluginInterface.cpp:114
GraphFilePluginInterface::graphDocument
virtual Document * graphDocument() const
If.
Definition: GraphFilePluginInterface.cpp:102
GraphFilePluginInterface::setGraphDocument
void setGraphDocument(Document *document)
Definition: GraphFilePluginInterface.cpp:108
GraphFilePluginInterface::errorString
QString errorString() const
Definition: GraphFilePluginInterface.cpp:77
GraphFilePluginInterface::pluginCapability
virtual PluginType pluginCapability() const
Returns PluginType to indicate whether the plugin only provides import, only export or both capabilit...
Definition: GraphFilePluginInterface.cpp:59
GraphFilePluginInterface::file
const KUrl & file() const
Definition: GraphFilePluginInterface.cpp:120
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/RocsCore

Skip menu "rocs/RocsCore"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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