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

rocs/RocsCore

Public Types | Public Member Functions | Protected Member Functions | List of all members
GraphFilePluginInterface Class Referenceabstract

#include <GraphFilePluginInterface.h>

Inheritance diagram for GraphFilePluginInterface:
Inheritance graph
[legend]

Public Types

enum  Error {
  None, Unknown, FileIsReadOnly, CouldNotOpenFile,
  NoGraphFound, EncodingProblem, CouldNotRecognizeFileFormat, NotSupportedOperation
}
 
enum  PluginType { ImportOnly, ExportOnly, ImportAndExport }
 

Public Member Functions

 GraphFilePluginInterface (const KAboutData *aboutData, QObject *parent)
 
virtual ~GraphFilePluginInterface ()
 
const KAboutData * aboutData () const
 
Error error () const
 
QString errorString () const
 
virtual const QStringList extensions () const =0
 
virtual Document * graphDocument () const
 
bool hasError () const
 
virtual bool isGraphDocument () const
 
virtual PluginType pluginCapability () const
 
virtual void readFile ()=0
 
void setFile (const KUrl &file)
 
virtual void writeFile (Document &graph)=0
 

Protected Member Functions

const KUrl & file () const
 
void setError (Error error, QString message=QString())
 
void setGraphDocument (Document *document)
 

Detailed Description

This class provides an interface for graph file format plugins.

A graph file format plugin must provide implementations of

  • writeFile(...)
  • readFile()
  • extensions() and optionally, if it is not a read and write plugin, an implementation of
  • pluginCapability() to specify the plugin capabilities.

Definition at line 42 of file GraphFilePluginInterface.h.

Member Enumeration Documentation

enum GraphFilePluginInterface::Error

Describes the last error of the plugin.

Enumerator
None 
Unknown 
FileIsReadOnly 
CouldNotOpenFile 
NoGraphFound 
EncodingProblem 
CouldNotRecognizeFileFormat 
NotSupportedOperation 

Definition at line 50 of file GraphFilePluginInterface.h.

enum GraphFilePluginInterface::PluginType

Describes the capability of the plugin, i.e., if the plugin can be used to read and/or write files.

Enumerator
ImportOnly 
ExportOnly 
ImportAndExport 

Definition at line 65 of file GraphFilePluginInterface.h.

Constructor & Destructor Documentation

GraphFilePluginInterface::GraphFilePluginInterface ( const KAboutData *  aboutData,
QObject *  parent 
)

Constructor.

Parameters
aboutDatais description of the plugin
parentis the object parent

Definition at line 47 of file GraphFilePluginInterface.cpp.

GraphFilePluginInterface::~GraphFilePluginInterface ( )
virtual

Definition at line 54 of file GraphFilePluginInterface.cpp.

Member Function Documentation

const KAboutData * GraphFilePluginInterface::aboutData ( ) const
Returns
plugin about data

Definition at line 90 of file GraphFilePluginInterface.cpp.

GraphFilePluginInterface::Error GraphFilePluginInterface::error ( ) const

Returns last error.

If last operation was successful. Use

See also
hasError() to test if error exists.
Returns
last Error of the plugin.

Definition at line 71 of file GraphFilePluginInterface.cpp.

QString GraphFilePluginInterface::errorString ( ) const
Returns
last error as human readable text

Definition at line 77 of file GraphFilePluginInterface.cpp.

virtual const QStringList GraphFilePluginInterface::extensions ( ) const
pure virtual

File extensions that are common for this file type.

Returns
extension list

Implemented in RocsGraphFileFormatPlugin, TgfFileFormatPlugin, GmlFileFormatPlugin, TikzFileFormatPlugin, KmlFileFormatPlugin, and DotFileFormatPlugin.

const KUrl & GraphFilePluginInterface::file ( ) const
protected

Gives current file.

Returns
file that is last used for write/read

Definition at line 120 of file GraphFilePluginInterface.cpp.

Document * GraphFilePluginInterface::graphDocument ( ) const
virtual

If.

See also
isGraphDocument() returns true, this method returns document created by last
readFile() call.
Returns
the graph document

Definition at line 102 of file GraphFilePluginInterface.cpp.

bool GraphFilePluginInterface::hasError ( ) const
Returns
true if last read or write operation caused an error.

Definition at line 65 of file GraphFilePluginInterface.cpp.

bool GraphFilePluginInterface::isGraphDocument ( ) const
virtual
Returns
true if a valid graph document was read. Otherwise return false

Definition at line 96 of file GraphFilePluginInterface.cpp.

GraphFilePluginInterface::PluginType GraphFilePluginInterface::pluginCapability ( ) const
virtual

Returns PluginType to indicate whether the plugin only provides import, only export or both capabilities.

This method should be used to determine in which file dialogs the plugin shall be included.

Returns
is by default PluginType::ImportAndExport

Reimplemented in TikzFileFormatPlugin.

Definition at line 59 of file GraphFilePluginInterface.cpp.

virtual void GraphFilePluginInterface::readFile ( )
pure virtual

Open given file and imports it into internal format.

Implemented in RocsGraphFileFormatPlugin, TgfFileFormatPlugin, GmlFileFormatPlugin, TikzFileFormatPlugin, KmlFileFormatPlugin, and DotFileFormatPlugin.

void GraphFilePluginInterface::setError ( GraphFilePluginInterface::Error  error,
QString  message = QString() 
)
protected

Use this function to set or unset the current error of the plugin. To unset an error use Error::None.

Parameters
erroris type of error,
See also
GraphFilePluginInterface::Error
Parameters
messageis optional description for error

Definition at line 83 of file GraphFilePluginInterface.cpp.

void GraphFilePluginInterface::setFile ( const KUrl &  file)

Set file that shall be used for nexte read or write operation.

Parameters
fileis KUrl pointing to local file

Definition at line 114 of file GraphFilePluginInterface.cpp.

void GraphFilePluginInterface::setGraphDocument ( Document *  document)
protected

Use this function for read plugins to set read graph document

Parameters
documentthat contains the graph

Definition at line 108 of file GraphFilePluginInterface.cpp.

virtual void GraphFilePluginInterface::writeFile ( Document &  graph)
pure virtual

Writes given graph document to formerly specified file.

See also
setFile().
Parameters
graphis graph document to be serialized

Implemented in RocsGraphFileFormatPlugin, TgfFileFormatPlugin, GmlFileFormatPlugin, TikzFileFormatPlugin, KmlFileFormatPlugin, and DotFileFormatPlugin.


The documentation for this class was generated from the following files:
  • GraphFilePluginInterface.h
  • GraphFilePluginInterface.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 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