karbon

vvisitor.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002, 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
21#include "vcomposite.h"
22#include "vdocument.h"
23#include "vgroup.h"
24#include "vlayer.h"
25#include "vpath.h"
26#include "vselection.h"
27#include "vvisitor.h"
28#include "vimage.h"
29
30bool
32{
33 m_success = false;
34
35 object.accept( *this );
36
37 return m_success;
38}
39
40void
42{
43 VLayerListIterator itr( document.layers() );
44
45 for( ; itr.current(); ++itr )
46 {
47 itr.current()->accept( *this );
48 }
49}
50
51void
53{
54 VObjectListIterator itr( group.objects() );
55
56 for( ; itr.current(); ++itr )
57 {
58 itr.current()->accept( *this );
59 }
60}
61
62void
64{
65 VObjectListIterator itr( layer.objects() );
66
67 for( ; itr.current(); ++itr )
68 {
69 itr.current()->accept( *this );
70 }
71}
72
73void
75{
76 VSubpathListIterator itr( composite.paths() );
77
78 for( ; itr.current(); ++itr )
79 {
80 if( !itr.current()->isEmpty() )
81 itr.current()->accept( *this );
82 }
83}
84
85void
87{
88}
89
90void
92{
93 VObjectListIterator itr( selection.objects() );
94
95 for( ; itr.current() ; ++itr )
96 {
97 itr.current()->accept( *this );
98 }
99}
100
101void
102VVisitor::visitVText( VText& /*text*/ )
103{
104}
105
106void
107VVisitor::visitVImage( VImage& /*img*/ )
108{
109}
110
111void
113{
114}
All non-visual, static doc info is in here.
Definition vdocument.h:53
const VLayerList & layers() const
Returns the list of layers.
Definition vdocument.h:217
Base class for all sort of VObject conglomerats.
Definition vgroup.h:35
const VObjectList & objects() const
Read only access to the grouped objects.
Definition vgroup.h:110
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
const VObjectList & objects() const
Read only access to the selected objects.
Definition vselection.h:136
VSubpath provides a sophisticated list of VSegment.
Definition vpath.h:43
virtual void visitVSubpath(VSubpath &path)
Visit method for a VSubpath.
Definition vvisitor.cpp:86
virtual void visitVText(VText &text)
Visit method for a VText.
Definition vvisitor.cpp:102
virtual bool visit(VObject &object)
General visit method.
Definition vvisitor.cpp:31
virtual void visitVImage(VImage &img)
Visit method for a VImage.
Definition vvisitor.cpp:107
virtual void visitVDocument(VDocument &document)
Visit method for a VDocument.
Definition vvisitor.cpp:41
virtual void visitVObject(VObject &object)
Visit method for a VObject.
Definition vvisitor.cpp:112
virtual void visitVGroup(VGroup &group)
Visit method for a VGroup.
Definition vvisitor.cpp:52
virtual void visitVLayer(VLayer &layer)
Visit method for a VLayer.
Definition vvisitor.cpp:63
virtual void visitVPath(VPath &composite)
Visit method for a VPath.
Definition vvisitor.cpp:74
virtual void visitVSelection(VSelection &selection)
Visit method for a VSelection.
Definition vvisitor.cpp:91