karbon

vselectnodes.h

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 #ifndef __VSELECTNODES_H__
00021 #define __VSELECTNODES_H__
00022 
00023 
00024 #include "KoRect.h"
00025 
00026 #include "vvisitor.h"
00027 #include "vsegment.h"
00028 
00029 class VSelectNodes : public VVisitor
00030 {
00031 public:
00032     VSelectNodes( bool select = true, bool exclusive = true )
00033     {
00034         m_select = select;
00035         m_exclusive = exclusive;
00036     }
00037 
00038     VSelectNodes( const KoRect& rect, bool select = true, bool exclusive = true )
00039     {
00040         m_select = select;
00041         m_exclusive = exclusive;
00042         m_rect = rect;
00043     }
00044 
00045     virtual void visitVSubpath( VSubpath& path );
00046     virtual void visitVLayer( VLayer& layer );
00047 
00048 private:
00049     bool m_select;
00050     bool m_exclusive;
00051     KoRect m_rect;
00052 };
00053 
00054 class VTestNodes : public VVisitor
00055 {
00056 public:
00057     VTestNodes( const KoRect& rect ) : m_rect( rect ) { m_segments.clear(); }
00058 
00059     virtual void visitVSubpath( VSubpath& path );
00060     virtual void visitVLayer( VLayer& layer );
00061 
00062     QPtrList<VSegment> &result() { return m_segments; }
00063 
00064 private:
00065     KoRect m_rect;
00066     QPtrList<VSegment>  m_segments;
00067 };
00068 
00069 #endif
00070 
00071 
KDE Home | KDE Accessibility Home | Description of Access Keys