karbon
vselection.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __VSELECTION_H__
00022 #define __VSELECTION_H__
00023
00024
00025 #include <qptrlist.h>
00026
00027 #include <KoRect.h>
00028
00029 #include "vobject.h"
00030 #include "vvisitor.h"
00031 #include <koffice_export.h>
00032 class KoPoint;
00033 class QObject;
00034 class VPainter;
00035 class VVisitor;
00036 class VSegment;
00037
00038 typedef QPtrList<VObject> VObjectList;
00039 typedef QPtrListIterator<VObject> VObjectListIterator;
00040
00041
00043 enum VHandleNode
00044 {
00045 node_none = 0,
00046 node_lt = 1,
00047 node_mt = 2,
00048 node_rt = 3,
00049 node_lm = 4,
00050 node_mm = 5,
00051 node_rm = 6,
00052 node_lb = 7,
00053 node_mb = 8,
00054 node_rb = 9
00055 };
00056
00057
00061 class KARBONBASE_EXPORT VSelection : public VObject, public VVisitor
00062 {
00063 public:
00069 VSelection( VObject* parent = 0L );
00070
00076 VSelection( const VSelection& selection );
00077
00081 virtual ~VSelection();
00082
00086 void draw( VPainter* painter, double zoomFactor ) const;
00087
00088 virtual const KoRect& boundingBox() const;
00089
00090 virtual VSelection* clone() const;
00091
00092 virtual void accept( VVisitor& visitor );
00093
00097 void append();
00098
00102 void append( VObject* object );
00103
00109 void append( const VObjectList &objects );
00110
00115 bool append( const KoRect& rect, bool selectObjects = true, bool exclusive = true );
00116
00120 void take( VObject& object );
00121
00126 bool take( const KoRect& rect, bool selectObjects = true, bool exclusive = true );
00127
00131 void clear();
00132
00136 const VObjectList& objects() const { return m_objects; }
00137
00144 QPtrList<VSegment> getSegments( const KoRect& rect );
00145
00151 void selectNodes( bool select = true );
00152
00159 VHandleNode handleNode( const KoPoint &point ) const;
00160
00166 void showHandle( bool handle = true ) { m_showhandle = handle; }
00167
00173 virtual void setSelectObjects( bool selectObjects = true ) { m_selectObjects = selectObjects; }
00174
00175 static void setHandleSize( uint size )
00176 { m_handleNodeSize = size; }
00177
00178 static uint handleSize()
00179 { return m_handleNodeSize; }
00180 private:
00184 bool m_showhandle;
00185
00189 bool m_selectObjects;
00190
00194 VObjectList m_objects;
00195
00200 KoRect *m_handleRect;
00201
00205 static uint m_handleNodeSize;
00206 };
00207
00208 #endif
00209
|