KCalendarCore

visitor.h
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <[email protected]>
6  SPDX-FileCopyrightText: 2005 Rafal Rzepecki <[email protected]>
7  SPDX-FileCopyrightText: 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
8  SPDX-FileContributor: Alvaro Manera <[email protected]>
9 
10  SPDX-License-Identifier: LGPL-2.0-or-later
11 */
12 
13 #ifndef KCALCORE_VISITOR_H
14 #define KCALCORE_VISITOR_H
15 
16 #include "event.h"
17 #include "freebusy.h"
18 #include "journal.h"
19 #include "todo.h"
20 
21 namespace KCalendarCore
22 {
23 /**
24  This class provides the interface for a visitor of calendar components.
25  It serves as base class for concrete visitors, which implement certain
26  actions on calendar components. It allows to add functions, which operate
27  on the concrete types of calendar components, without changing the
28  calendar component classes.
29 */
30 class KCALENDARCORE_EXPORT Visitor // krazy:exclude=dpointer
31 {
32 public:
33  /** Destruct Incidence::Visitor */
34  virtual ~Visitor();
35 
36  /**
37  Reimplement this function in your concrete subclass of
38  IncidenceBase::Visitor to perform actions on an Event object.
39  @param event is a pointer to a valid Event object.
40  */
41  virtual bool visit(const Event::Ptr &event);
42 
43  /**
44  Reimplement this function in your concrete subclass of
45  IncidenceBase::Visitor to perform actions on a Todo object.
46  @param todo is a pointer to a valid Todo object.
47  */
48  virtual bool visit(const Todo::Ptr &todo);
49 
50  /**
51  Reimplement this function in your concrete subclass of
52  IncidenceBase::Visitor to perform actions on an Journal object.
53  @param journal is a pointer to a valid Journal object.
54  */
55  virtual bool visit(const Journal::Ptr &journal);
56 
57  /**
58  Reimplement this function in your concrete subclass of
59  IncidenceBase::Visitor to perform actions on a FreeBusy object.
60  @param freebusy is a pointer to a valid FreeBusy object.
61  */
62  virtual bool visit(const FreeBusy::Ptr &freebusy);
63 
64 protected:
65  /**
66  Constructor is protected to prevent direct creation of visitor
67  base class.
68  */
69  Visitor();
70 };
71 
72 } // end namespace
73 
74 #endif
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:55:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.