karbon

vvisitor.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2005, 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 #ifndef __VVISITOR_H__
00021 #define __VVISITOR_H__
00022 
00023 #include <koffice_export.h>
00024 
00025 class VPath;
00026 class VDocument;
00027 class VGroup;
00028 class VLayer;
00029 class VObject;
00030 class VSubpath;
00031 class VSelection;
00032 class VText;
00033 class VImage;
00034 
00050 class KARBONBASE_EXPORT VVisitor
00051 {
00052 public:
00056     VVisitor()
00057     {
00058         m_success = false;
00059     }
00060 
00066     virtual bool visit( VObject& object );
00067 
00072     virtual void visitVObject( VObject& object );
00073 
00078     virtual void visitVPath( VPath& composite );
00079 
00084     virtual void visitVDocument( VDocument& document );
00085 
00090     virtual void visitVGroup( VGroup& group );
00091 
00096     virtual void visitVLayer( VLayer& layer );
00097 
00102     virtual void visitVSubpath( VSubpath& path );
00103 
00108     virtual void visitVSelection( VSelection& selection );
00109 
00114     virtual void visitVText( VText& text );
00115 
00120     virtual void visitVImage( VImage& img );
00121 
00125     bool success() const
00126     {
00127         return m_success;
00128     }
00129 
00130 protected:
00131     /*
00132      * Make this class "abstract".
00133      */
00137     virtual ~VVisitor() {}
00138 
00142     void setSuccess( bool success = true )
00143     {
00144         m_success = success;
00145     }
00146 
00147 private:
00148     bool m_success;
00149 };
00150 
00151 #endif
00152 
KDE Home | KDE Accessibility Home | Description of Access Keys