vselectobjects.h
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#ifndef __VSELECTOBJECTS_H__
21#define __VSELECTOBJECTS_H__
22
23
24#include "KoRect.h"
25
26#include "vcomposite.h"
27#include "vgroup.h"
28#include "vtext.h"
29#include "vimage.h"
30#include "vvisitor.h"
31
39{
40public:
41 VSelectObjects( VObjectList& selection, bool select = true )
42 : m_selection( selection ), m_select( select ), m_rectMode( true ), m_insideGroups( false ) {}
43
44 VSelectObjects( VObjectList& selection, const KoRect& rect, bool select = true )
45 : m_selection( selection ), m_select( select ), m_rect( rect ), m_rectMode( true ), m_insideGroups( false ) { }
46
47 VSelectObjects( VObjectList& selection, const KoPoint& point, bool select = true, bool insideGroups = false )
48 : m_selection( selection ), m_select( select ), m_point( point ), m_rectMode( false ), m_insideGroups( insideGroups ) {}
49
50 virtual void visitVGroup( VGroup& group );
51 virtual void visitVPath( VPath& composite );
52 virtual void visitVText( VText& text );
53 virtual void visitVImage( VImage& img )
54 { visitVObject( img ); }
55 virtual void visitVLayer( VLayer& layer );
56
57private:
58 void visitVObject( VObject& object );
59
60 VObjectList& m_selection;
61
62 bool m_select;
63
64 KoRect m_rect;
65 KoPoint m_point;
66 bool m_rectMode;
67 bool m_insideGroups;
68};
69
70#endif
71
Base class for all sort of VObject conglomerats.
Definition vgroup.h:35
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
This visitor visits a selection and selects objects that are contained in a paramater selection recta...
virtual void visitVGroup(VGroup &group)
Visit method for a VGroup.
virtual void visitVLayer(VLayer &layer)
Visit method for a VLayer.
virtual void visitVImage(VImage &img)
Visit method for a VImage.
virtual void visitVPath(VPath &composite)
Visit method for a VPath.
virtual void visitVText(VText &text)
Visit method for a VText.
The abstract visitor class.
Definition vvisitor.h:51