File indexing completed on 2024-04-14 03:58:30

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_SPECIFICITEM_H
0009 #define SYNDICATION_SPECIFICITEM_H
0010 
0011 #include <QSharedPointer>
0012 
0013 #include "syndication_export.h"
0014 
0015 namespace Syndication
0016 {
0017 class SpecificItemVisitor;
0018 class SpecificItem;
0019 
0020 //@cond PRIVATE
0021 typedef QSharedPointer<SpecificItem> SpecificItemPtr;
0022 //@endcond
0023 
0024 /**
0025  * Interface for all format-specific item-like classes, such as
0026  * RSS2/RDF items, and Atom entries. To process items based on their
0027  * format, use a SpecificItemVisitor.
0028  *
0029  * @author Frank Osterfeld
0030  */
0031 class SYNDICATION_EXPORT SpecificItem
0032 {
0033 public:
0034     /**
0035      * virtual dtor
0036      */
0037     virtual ~SpecificItem();
0038 
0039     /**
0040      * This must be implemented for the double dispatch
0041      * technique (Visitor pattern).
0042      *
0043      * The usual implementation is
0044      * @code
0045      * return visitor->visit(this);
0046      * @endcode
0047      *
0048      * See also SpecificItemVisitor.
0049      *
0050      * @param visitor the visitor "visiting" this object
0051      */
0052     virtual bool accept(SpecificItemVisitor *visitor) = 0;
0053 };
0054 
0055 } // namespace Syndication
0056 
0057 #endif // SYNDICATION_SPECIFICITEM_H