moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / objects / point_type.h
blob371e936b4b84037305732063b9c120aa831132eb
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_TYPE_H
19 #define KIG_OBJECTS_POINT_TYPE_H
21 #include "base_type.h"
22 #include "common.h"
23 #include "circle_imp.h"
25 class FixedPointType
26 : public ArgsParserObjectType
28 FixedPointType();
29 ~FixedPointType();
31 static const ArgsParser::spec argsspec[1];
32 public:
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
54 RelativePointType();
55 ~RelativePointType();
57 static const ArgsParser::spec argsspec[1];
58 public:
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;
75 class CursorPointType
76 : public ObjectType
78 CursorPointType();
79 ~CursorPointType();
81 public:
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();
100 public:
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;
120 class MidPointType
121 : public ObjectABType
123 MidPointType();
124 ~MidPointType();
125 public:
126 static const MidPointType* instance();
127 ObjectImp* calc( const Coordinate& a, const Coordinate& b ) const;
128 const ObjectImpType* resultId() const;
131 class MeasureTransportType
132 : public ObjectType
134 MeasureTransportType();
135 ~MeasureTransportType();
136 public:
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();
152 public:
153 static const MeasureTransportTypeOld* instance();
155 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
156 const ObjectImpType* resultId() const;
159 #endif