karbon

vselectobjects.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 __VSELECTOBJECTS_H__
00021 #define __VSELECTOBJECTS_H__
00022 
00023 
00024 #include "KoRect.h"
00025 
00026 #include "vcomposite.h"
00027 #include "vgroup.h"
00028 #include "vtext.h"
00029 #include "vimage.h"
00030 #include "vvisitor.h"
00031 
00038 class VSelectObjects : public VVisitor
00039 {
00040 public:
00041     VSelectObjects( VObjectList& selection, bool select = true )
00042         : m_selection( selection ), m_select( select ), m_rectMode( true ), m_insideGroups( false ) {}
00043 
00044     VSelectObjects( VObjectList& selection, const KoRect& rect, bool select = true )
00045         : m_selection( selection ), m_select( select ), m_rect( rect ), m_rectMode( true ), m_insideGroups( false ) { }
00046 
00047     VSelectObjects( VObjectList& selection, const KoPoint& point, bool select = true, bool insideGroups = false )
00048         : m_selection( selection ), m_select( select ), m_point( point ), m_rectMode( false ), m_insideGroups( insideGroups )  {}
00049 
00050     virtual void visitVGroup( VGroup& group );
00051     virtual void visitVPath( VPath& composite );
00052     virtual void visitVText( VText& text );
00053     virtual void visitVImage( VImage& img )
00054         { visitVObject( img ); }
00055     virtual void visitVLayer( VLayer& layer );
00056 
00057 private:
00058     void visitVObject( VObject& object );
00059 
00060     VObjectList& m_selection;
00061 
00062     bool m_select;
00063 
00064     KoRect m_rect;
00065     KoPoint m_point;
00066     bool m_rectMode;
00067     bool m_insideGroups;
00068 };
00069 
00070 #endif
00071 
KDE Home | KDE Accessibility Home | Description of Access Keys