parsercollection.h
00001 /* 00002 * This file is part of the syndication library 00003 * 00004 * Copyright (C) 2005 Frank Osterfeld <osterfeld@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #ifndef SYNDICATION_PARSERCOLLECTION_H 00024 #define SYNDICATION_PARSERCOLLECTION_H 00025 00026 #include <syndication/specificdocument.h> 00027 #include <syndication/abstractparser.h> 00028 #include <syndication/documentsource.h> 00029 #include <syndication/feed.h> 00030 #include <syndication/global.h> 00031 #include <syndication/mapper.h> 00032 00033 #include <QtCore/QString> 00034 00035 namespace Syndication { 00036 00037 00072 template <class T> 00073 class SYNDICATION_EXPORT ParserCollection 00074 { 00075 public: 00076 00078 virtual ~ParserCollection() {} 00079 00093 virtual boost::shared_ptr<T> parse(const DocumentSource& source, 00094 const QString& formatHint=QString()) = 0; 00095 00096 00103 virtual ErrorCode lastError() const = 0; 00104 00119 virtual bool registerParser(AbstractParser* parser, Mapper<T>* mapper) = 0; 00120 00129 virtual void changeMapper(const QString& format, Mapper<T>* mapper) = 0; 00130 00131 }; 00132 00133 } // namespace Syndication 00134 00135 #endif // SYNDICATION_PARSERCOLLECTION_H