karbon

vvisitor.h
1/* This file is part of the KDE project
2 Copyright (C) 2002-2005, The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VVISITOR_H__
21#define __VVISITOR_H__
22
23#include <koffice_export.h>
24
25class VPath;
26class VDocument;
27class VGroup;
28class VLayer;
29class VObject;
30class VSubpath;
31class VSelection;
32class VText;
33class VImage;
34
50class KARBONBASE_EXPORT VVisitor
51{
52public:
57 {
58 m_success = false;
59 }
60
66 virtual bool visit( VObject& object );
67
72 virtual void visitVObject( VObject& object );
73
78 virtual void visitVPath( VPath& composite );
79
84 virtual void visitVDocument( VDocument& document );
85
90 virtual void visitVGroup( VGroup& group );
91
96 virtual void visitVLayer( VLayer& layer );
97
102 virtual void visitVSubpath( VSubpath& path );
103
108 virtual void visitVSelection( VSelection& selection );
109
114 virtual void visitVText( VText& text );
115
120 virtual void visitVImage( VImage& img );
121
125 bool success() const
126 {
127 return m_success;
128 }
129
130protected:
131 /*
132 * Make this class "abstract".
133 */
137 virtual ~VVisitor() {}
138
142 void setSuccess( bool success = true )
143 {
144 m_success = success;
145 }
146
147private:
148 bool m_success;
149};
150
151#endif
152
All non-visual, static doc info is in here.
Definition vdocument.h:53
Base class for all sort of VObject conglomerats.
Definition vgroup.h:35
VLayer manages a set of vobjects.
Definition vlayer.h:37
The base class for all karbon objects.
Definition vobject.h:50
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
VSelection manages a set of selected vobjects.
Definition vselection.h:62
VSubpath provides a sophisticated list of VSegment.
Definition vpath.h:43
The abstract visitor class.
Definition vvisitor.h:51
bool success() const
Return if the operation was a success or not.
Definition vvisitor.h:125
virtual ~VVisitor()
Destructs a visitor class.
Definition vvisitor.h:137
VVisitor()
Constructs a new visitor class.
Definition vvisitor.h:56
void setSuccess(bool success=true)
Set the success property.
Definition vvisitor.h:142