Syndication

specificitemvisitor.h
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SYNDICATION_SPECIFICITEMVISITOR_H
9#define SYNDICATION_SPECIFICITEMVISITOR_H
10
11#include "syndication_export.h"
12
13namespace Syndication
14{
15class SpecificItem;
16
17namespace Atom
18{
19class Entry;
20}
21
22namespace RDF
23{
24class Item;
25}
26
27namespace RSS2
28{
29class Item;
30}
31
32/**
33 * Visitor interface, following the Visitor design pattern. Use this if you
34 * want to process items and the way how to handle the items depends
35 * on it's concrete type (e.g. RSS2::Item, RDF::Item...).
36 *
37 * TODO: insert code example
38 *
39 * @author Frank Osterfeld
40 */
41class SYNDICATION_EXPORT SpecificItemVisitor // krazy:exclude=dpointer
42{
43public:
44 /**
45 * destructor
46 */
47 virtual ~SpecificItemVisitor();
48
49 /**
50 * call this method to handle an item. Depending on the concrete type
51 * of the item, a specialized visit method is called.
52 *
53 * @param item the item to process
54 * @return whether this visitor handles the type of the item
55 */
56 virtual bool visit(SpecificItem *item);
57
58 /**
59 * reimplement this method to handle RSS2 items.
60 *
61 * @param item the RSS2 item to visit
62 * @return whether the visitor handled the item.
63 * Reimplementations of this method must return @c true.
64 */
65 virtual bool visitRSS2Item(Syndication::RSS2::Item *item);
66
67 /**
68 * reimplement this method to handle RDF items.
69 *
70 * @param item the RDF item to visit
71 * @return whether the visitor handled the item.
72 * Reimplementations of this method must return @c true.
73 */
74 virtual bool visitRDFItem(Syndication::RDF::Item *item);
75
76 /**
77 * reimplement this method to handle Atom entries.
78 *
79 * @param item the Atom entry to visit
80 * @return whether the visitor handled the entry.
81 * Reimplementations of this method must return @c true.
82 */
83 virtual bool visitAtomEntry(Syndication::Atom::Entry *item);
84};
85
86} // namespace Syndication
87
88#endif // SYNDICATION_SPECIFICITEMVISITOR_H
an Atom entry, equivalent to the "items" in the RSS world.
Definition entry.h:39
Visitor interface, following the Visitor design pattern.
Interface for all format-specific item-like classes, such as RSS2/RDF items, and Atom entries.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.