Chris@439: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@439: Chris@439: /* Chris@439: Sonic Visualiser Chris@439: An audio file viewer and annotation editor. Chris@439: Centre for Digital Music, Queen Mary, University of London. Chris@439: This file copyright 2008 QMUL. Chris@439: Chris@439: This program is free software; you can redistribute it and/or Chris@439: modify it under the terms of the GNU General Public License as Chris@439: published by the Free Software Foundation; either version 2 of the Chris@439: License, or (at your option) any later version. See the file Chris@439: COPYING included with this distribution for more information. Chris@439: */ Chris@439: Chris@1581: #ifndef SV_RDF_TRANSFORM_FACTORY_H Chris@1581: #define SV_RDF_TRANSFORM_FACTORY_H Chris@439: Chris@439: #include Chris@439: #include Chris@439: Chris@439: #include Chris@439: Chris@439: #include "transform/Transform.h" Chris@439: Chris@439: class RDFTransformFactoryImpl; Chris@439: class ProgressReporter; Chris@439: Chris@439: class RDFTransformFactory : public QObject Chris@439: { Chris@439: Q_OBJECT Chris@439: Chris@439: public: Chris@439: static QString getKnownExtensions(); Chris@439: Chris@439: RDFTransformFactory(QString url); Chris@439: virtual ~RDFTransformFactory(); Chris@439: Chris@1163: /** isRDF() may be queried at any point after construction. It Chris@1163: returns true if the file was parseable as RDF. Chris@1163: */ Chris@1163: bool isRDF(); Chris@1163: Chris@1163: /** isOK() may be queried at any point after getTransforms() has Chris@1163: been called. It is true if the file was parseable as RDF and Chris@1163: any transforms in it could be completely constructed. Chris@1163: Chris@1163: Note that even if isOK() returns true, it is still possible Chris@1163: that the file did not define any transforms; in this case, Chris@1163: getTransforms() would have returned an empty list. Chris@1163: Chris@1163: If isOK() is called before getTransforms() has been invoked to Chris@1163: query the file, it will return true iff isRDF() is true. Chris@1163: */ Chris@1163: bool isOK(); Chris@1163: Chris@1163: /** Return any error string resulting from loading or querying the Chris@1163: file. This will be non-empty if isRDF() or isOK() returns Chris@1163: false. Chris@1163: */ Chris@439: QString getErrorString() const; Chris@439: Chris@439: std::vector getTransforms(ProgressReporter *reporter); Chris@439: Chris@494: static QString writeTransformToRDF(const Transform &, QString uri); Chris@494: Chris@439: protected: Chris@439: RDFTransformFactoryImpl *m_d; Chris@439: }; Chris@439: Chris@439: #endif