moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / objects / point_imp.h
blobe1bcaeb2a5c4afba3563445200bf2f89202a6af9
1 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 // 02111-1307, USA.
18 #ifndef KIG_OBJECTS_POINT_IMP_H
19 #define KIG_OBJECTS_POINT_IMP_H
21 #include "object_imp.h"
22 #include "../misc/coordinate.h"
24 /**
25 * An ObjectImp representing a point..
27 class PointImp
28 : public ObjectImp
30 Coordinate mc;
31 public:
32 typedef ObjectImp Parent;
33 /**
34 * Returns the ObjectImpType representing PointImp's.
36 static const ObjectImpType* stype();
38 /**
39 * Construct a PointImp with coordinate c.
41 PointImp( const Coordinate& c );
42 ~PointImp();
44 Rect surroundingRect() const;
45 Coordinate attachPoint() const;
47 /**
48 * Get the coordinate of this PointImp.
50 const Coordinate& coordinate() const { return mc; };
51 /**
52 * Set the coordinate of this PointImp.
54 void setCoordinate( const Coordinate& c );
56 void draw( KigPainter& p ) const;
57 bool contains( const Coordinate& p, int width, const KigWidget& ) const;
58 bool inRect( const Rect& r, int width, const KigWidget& ) const;
60 const uint numberOfProperties() const;
61 const QCStringList properties() const;
62 const QCStringList propertiesInternalNames() const;
63 ObjectImp* property( uint which, const KigDocument& d ) const;
64 const char* iconForProperty( uint which ) const;
65 const ObjectImpType* impRequirementForProperty( uint which ) const;
66 bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
68 ObjectImp* transform( const Transformation& ) const;
70 PointImp* copy() const;
72 const ObjectImpType* type() const;
73 void visit( ObjectImpVisitor* vtor ) const;
75 void fillInNextEscape( QString& s, const KigDocument& ) const;
76 bool canFillInNextEscape() const;
78 bool equals( const ObjectImp& rhs ) const;
81 class BogusPointImp
82 : public PointImp
84 public:
85 BogusPointImp( const Coordinate& c );
86 ~BogusPointImp();
87 static const ObjectImpType* stype();
88 const ObjectImpType* type() const;
91 #endif