karbon

vvisitor.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002, The Karbon Developers
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 
00021 #include "vcomposite.h"
00022 #include "vdocument.h"
00023 #include "vgroup.h"
00024 #include "vlayer.h"
00025 #include "vpath.h"
00026 #include "vselection.h"
00027 #include "vvisitor.h"
00028 #include "vimage.h"
00029 
00030 bool
00031 VVisitor::visit( VObject& object )
00032 {
00033     m_success = false;
00034 
00035     object.accept( *this );
00036 
00037     return m_success;
00038 }
00039 
00040 void
00041 VVisitor::visitVDocument( VDocument& document )
00042 {
00043     VLayerListIterator itr( document.layers() );
00044 
00045     for( ; itr.current(); ++itr )
00046     {
00047         itr.current()->accept( *this );
00048     }
00049 }
00050 
00051 void
00052 VVisitor::visitVGroup( VGroup& group )
00053 {
00054     VObjectListIterator itr( group.objects() );
00055 
00056     for( ; itr.current(); ++itr )
00057     {
00058         itr.current()->accept( *this );
00059     }
00060 }
00061 
00062 void
00063 VVisitor::visitVLayer( VLayer& layer )
00064 {
00065     VObjectListIterator itr( layer.objects() );
00066 
00067     for( ; itr.current(); ++itr )
00068     {
00069         itr.current()->accept( *this );
00070     }
00071 }
00072 
00073 void
00074 VVisitor::visitVPath( VPath& composite )
00075 {
00076     VSubpathListIterator itr( composite.paths() );
00077 
00078     for( ; itr.current(); ++itr )
00079     {
00080         if( !itr.current()->isEmpty() )
00081             itr.current()->accept( *this );
00082     }
00083 }
00084 
00085 void
00086 VVisitor::visitVSubpath( VSubpath& /*path*/ )
00087 {
00088 }
00089 
00090 void
00091 VVisitor::visitVSelection( VSelection& selection )
00092 {
00093     VObjectListIterator itr( selection.objects() );
00094 
00095     for( ; itr.current() ; ++itr )
00096     {
00097         itr.current()->accept( *this );
00098     }
00099 }
00100 
00101 void
00102 VVisitor::visitVText( VText& /*text*/ )
00103 {
00104 }
00105 
00106 void
00107 VVisitor::visitVImage( VImage& /*img*/ )
00108 {
00109 }
00110 
00111 void 
00112 VVisitor::visitVObject( VObject& /*object*/ )
00113 {
00114 }
KDE Home | KDE Accessibility Home | Description of Access Keys