1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (c) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
8 Contact: Alvaro Manera <alvaro.manera@nokia.com>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA.
24*/
25
26#ifndef KCALCORE_VISITOR_P_H
27#define KCALCORE_VISITOR_P_H
28
29#include "event.h"
30#include "journal.h"
31#include "todo.h"
32#include "freebusy.h"
33
34namespace KCalCore {
35
36/**
37 This class provides the interface for a visitor of calendar components.
38 It serves as base class for concrete visitors, which implement certain
39 actions on calendar components. It allows to add functions, which operate
40 on the concrete types of calendar components, without changing the
41 calendar component classes.
42*/
43class KCALCORE_EXPORT Visitor //krazy:exclude=dpointer
44{
45public:
46 /** Destruct Incidence::Visitor */
47 virtual ~Visitor();
48
49 /**
50 Reimplement this function in your concrete subclass of
51 IncidenceBase::Visitor to perform actions on an Event object.
52 @param event is a pointer to a valid Event object.
53 */
54 virtual bool visit(Event::Ptr event);
55
56 /**
57 Reimplement this function in your concrete subclass of
58 IncidenceBase::Visitor to perform actions on a Todo object.
59 @param todo is a pointer to a valid Todo object.
60 */
61 virtual bool visit(Todo::Ptr todo);
62
63 /**
64 Reimplement this function in your concrete subclass of
65 IncidenceBase::Visitor to perform actions on an Journal object.
66 @param journal is a pointer to a valid Journal object.
67 */
68 virtual bool visit(Journal::Ptr journal);
69
70 /**
71 Reimplement this function in your concrete subclass of
72 IncidenceBase::Visitor to perform actions on a FreeBusy object.
73 @param freebusy is a pointer to a valid FreeBusy object.
74 */
75 virtual bool visit(FreeBusy::Ptr freebusy);
76
77protected:
78 /**
79 Constructor is protected to prevent direct creation of visitor
80 base class.
81 */
82 Visitor();
83};
84
85} // end namespace
86
87#endif
88