Syndication

specificdocument.h
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SYNDICATION_SPECIFICDOCUMENT_H
9#define SYNDICATION_SPECIFICDOCUMENT_H
10
11#include "syndication_export.h"
12
13#include <QSharedPointer>
14
15class QString;
16
17namespace Syndication
18{
19class DocumentVisitor;
20class SpecificDocument;
21
22//@cond PRIVATE
23typedef QSharedPointer<SpecificDocument> SpecificDocumentPtr;
24//@endcond
25
26/**
27 * Document interface for format-specific feed documents as parsed from a
28 * document source (see DocumentSource).
29 * The Document classes from the several syndication formats must implement
30 * this interface. It's main purpose is to provide access for document visitors
31 * (see DocumentVisitor).
32 * Usually it is not necessary to access the format-specific document at all,
33 * use Feed for a format-agnostic interface to all feed documents supported by
34 * the library.
35 *
36 * @author Frank Osterfeld
37 */
38class SYNDICATION_EXPORT SpecificDocument
39{
40public:
41 /**
42 * virtual dtor
43 */
44 virtual ~SpecificDocument();
45
46 /**
47 * This must be implemented for the double dispatch
48 * technique (Visitor pattern).
49 *
50 * The usual implementation is
51 * @code
52 * return visitor->visit(this);
53 * @endcode
54 *
55 * See also DocumentVisitor.
56 *
57 * @param visitor the visitor "visiting" this object
58 */
59 virtual bool accept(DocumentVisitor *visitor) = 0;
60
61 /**
62 * Returns whether this document is valid or not.
63 * Invalid documents do not contain any useful
64 * information.
65 */
66 virtual bool isValid() const = 0;
67
68 /**
69 * Returns a description of the document for debugging purposes.
70 *
71 * @return debug string
72 */
73 virtual QString debugInfo() const = 0;
74};
75
76} // namespace Syndication
77
78#endif // SYNDICATION_SPECIFICDOCUMENT_H
Visitor interface, following the Visitor design pattern.
Document interface for format-specific feed documents as parsed from a document source (see DocumentS...
virtual QString debugInfo() const =0
Returns a description of the document for debugging purposes.
virtual bool accept(DocumentVisitor *visitor)=0
This must be implemented for the double dispatch technique (Visitor pattern).
virtual bool isValid() const =0
Returns whether this document is valid or not.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.