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
18 #ifndef KIG_OBJECTS_POINT_TYPE_H
19 #define KIG_OBJECTS_POINT_TYPE_H
21 #include "base_type.h"
23 #include "circle_imp.h"
26 : public ArgsParserObjectType
31 static const ArgsParser::spec argsspec
[1];
33 static const FixedPointType
* instance();
35 bool inherits( int type
) const;
37 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
38 bool canMove( const ObjectTypeCalcer
& ourobj
) const;
39 bool isFreelyTranslatable( const ObjectTypeCalcer
& ourobj
) const;
40 std::vector
<ObjectCalcer
*> movableParents( const ObjectTypeCalcer
& ourobj
) const;
41 const Coordinate
moveReferencePoint( const ObjectTypeCalcer
& ourobj
) const;
42 void move( ObjectTypeCalcer
& ourobj
, const Coordinate
& to
,
43 const KigDocument
& ) const;
44 const ObjectImpType
* resultId() const;
46 QStringList
specialActions() const;
47 void executeAction( int i
, ObjectHolder
& o
, ObjectTypeCalcer
& t
,
48 KigPart
& d
, KigWidget
& w
, NormalMode
& m
) const;
51 class RelativePointType
52 : public ArgsParserObjectType
57 static const ArgsParser::spec argsspec
[1];
59 static const RelativePointType
* instance();
61 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
62 bool canMove( const ObjectTypeCalcer
& ourobj
) const;
63 bool isFreelyTranslatable( const ObjectTypeCalcer
& ourobj
) const;
64 std::vector
<ObjectCalcer
*> movableParents( const ObjectTypeCalcer
& ourobj
) const;
65 const Coordinate
moveReferencePoint( const ObjectTypeCalcer
& ourobj
) const;
66 void move( ObjectTypeCalcer
& ourobj
, const Coordinate
& to
,
67 const KigDocument
& ) const;
68 const ObjectImpType
* resultId() const;
70 // QStringList specialActions() const;
71 // void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t,
72 // KigPart& d, KigWidget& w, NormalMode& m ) const;
82 static const CursorPointType
* instance();
83 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
85 const ObjectImpType
* impRequirement( const ObjectImp
* o
, const Args
& parents
) const;
86 bool isDefinedOnOrThrough( const ObjectImp
* o
, const Args
& parents
) const;
87 std::vector
<ObjectCalcer
*> sortArgs( const std::vector
<ObjectCalcer
*>& args
) const;
88 Args
sortArgs( const Args
& args
) const;
89 bool canMove( const ObjectTypeCalcer
& ourobj
) const;
90 void move( ObjectTypeCalcer
& ourobj
, const Coordinate
& to
,
91 const KigDocument
& ) const;
92 const ObjectImpType
* resultId() const;
95 class ConstrainedPointType
96 : public ArgsParserObjectType
98 ConstrainedPointType();
99 ~ConstrainedPointType();
101 static const ConstrainedPointType
* instance();
103 bool inherits( int type
) const;
105 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
107 bool canMove( const ObjectTypeCalcer
& ourobj
) const;
108 bool isFreelyTranslatable( const ObjectTypeCalcer
& ourobj
) const;
109 std::vector
<ObjectCalcer
*> movableParents( const ObjectTypeCalcer
& ourobj
) const;
110 const Coordinate
moveReferencePoint( const ObjectTypeCalcer
& ourobj
) const;
111 void move( ObjectTypeCalcer
& ourobj
, const Coordinate
& to
,
112 const KigDocument
& ) const;
113 const ObjectImpType
* resultId() const;
115 QStringList
specialActions() const;
116 void executeAction( int i
, ObjectHolder
&, ObjectTypeCalcer
& o
, KigPart
& d
, KigWidget
& w
,
117 NormalMode
& m
) const;
121 : public ObjectABType
126 static const MidPointType
* instance();
127 ObjectImp
* calc( const Coordinate
& a
, const Coordinate
& b
) const;
128 const ObjectImpType
* resultId() const;
131 class MeasureTransportType
134 MeasureTransportType();
135 ~MeasureTransportType();
137 static const MeasureTransportType
* instance();
139 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
140 const ObjectImpType
* resultId() const;
141 const ObjectImpType
* impRequirement( const ObjectImp
* o
, const Args
& parents
) const;
142 bool isDefinedOnOrThrough( const ObjectImp
* o
, const Args
& parents
) const;
143 std::vector
<ObjectCalcer
*> sortArgs( const std::vector
<ObjectCalcer
*>& args
)const;
144 Args
sortArgs( const Args
& args
) const;
147 class MeasureTransportTypeOld
148 : public ArgsParserObjectType
150 MeasureTransportTypeOld();
151 ~MeasureTransportTypeOld();
153 static const MeasureTransportTypeOld
* instance();
155 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
156 const ObjectImpType
* resultId() const;