Mercurial > hg > easaier-soundaccess
view sv/document/ESFileReader.h @ 282:d9319859a4cf tip
(none)
author | benoitrigolleau |
---|---|
date | Fri, 31 Oct 2008 11:00:24 +0000 |
parents | 74d1b3bda5a3 |
children |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Sound Access EASAIER client application. Silogic 2007. Laure Bajard. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. */ #ifndef _ES_FILE_READER_H_ #define _ES_FILE_READER_H_ #include "layer/LayerFactory.h" #include "transform/Transform.h" #include "data/model/AudioSourceInfoModel.h" #include "data/fileio/HttpClient.h" #include <QXmlDefaultHandler> #include <map> class Pane; class Model; class Document; class PlayParameters; class ESFileReaderPaneCallback { public: virtual ~ESFileReaderPaneCallback(){} virtual Pane *addPane() = 0; virtual void setWindowSize(int width, int height) = 0; virtual void addSelection(int start, int end) = 0; }; class ESFileReader : public QXmlDefaultHandler { public: ESFileReader(Document *document, ESFileReaderPaneCallback &callback); virtual ~ESFileReader(); void parse(const QString &xmlData); void parse(QXmlInputSource &source); bool isOK(); QString getErrorString() const { return m_errorString; } // For loading a single layer onto an existing pane void setCurrentPane(Pane *pane) { m_currentPane = pane; } virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes& atts); virtual bool characters(const QString &); virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName); bool error(const QXmlParseException &exception); bool fatalError(const QXmlParseException &exception); protected: bool readWindow(const QXmlAttributes &); bool readView(const QXmlAttributes &); bool readLayer(const QXmlAttributes &); bool readFilter(const QXmlAttributes &); Document *m_document; ESFileReaderPaneCallback &m_paneCallback; Pane *m_currentPane; std::map<int, Layer *> m_layers; bool m_inView; bool m_inData; QString m_errorString; bool m_ok; }; #endif