moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / objects / object_type.cc
blobc46a7c4fd2c96ad67aefa5f6ddcf754886b84491
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 #include "object_type.h"
20 #include "bogus_imp.h"
21 #include "object_type_factory.h"
23 #include "../misc/coordinate.h"
25 #include <qstringlist.h>
27 #include <klocale.h>
29 const char* ObjectType::fullName() const
31 return mfulltypename;
34 ObjectType::~ObjectType()
38 ObjectType::ObjectType( const char fulltypename[] )
39 : mfulltypename( fulltypename )
41 ObjectTypeFactory::instance()->add( this );
44 bool ObjectType::canMove( const ObjectTypeCalcer& ) const
46 return false;
49 bool ObjectType::isFreelyTranslatable( const ObjectTypeCalcer& ) const
51 return false;
54 void ObjectType::move( ObjectTypeCalcer&, const Coordinate&, const KigDocument& ) const
56 // we can't do an assert here, because sometimes ( like in
57 // ObjectABType::move, ObjectType::move is called without checking
58 // the object's canMove().
59 // assert( false );
62 bool ObjectType::inherits( int ) const
64 return false;
67 ArgsParserObjectType::ArgsParserObjectType( const char fulltypename[],
68 const struct ArgsParser::spec argsspec[],
69 int n )
70 : ObjectType( fulltypename ), margsparser( argsspec, n )
74 const ObjectImpType* ArgsParserObjectType::impRequirement( const ObjectImp* o, const Args& parents ) const
76 return margsparser.impRequirement( o, parents );
79 const ArgsParser& ArgsParserObjectType::argsParser() const
81 return margsparser;
84 bool ObjectType::isTransform() const
86 return false;
89 QStringList ObjectType::specialActions() const
91 return QStringList();
94 void ObjectType::executeAction( int, ObjectHolder&, ObjectTypeCalcer&, KigPart&, KigWidget&,
95 NormalMode& ) const
97 assert( false );
100 const Coordinate ObjectType::moveReferencePoint( const ObjectTypeCalcer& ) const
102 assert( false );
103 return Coordinate::invalidCoord();
106 std::vector<ObjectCalcer*> ArgsParserObjectType::sortArgs( const std::vector<ObjectCalcer*>& args ) const
108 return margsparser.parse( args );
111 Args ArgsParserObjectType::sortArgs( const Args& args ) const
113 return margsparser.parse( args );
116 std::vector<ObjectCalcer*> ObjectType::movableParents( const ObjectTypeCalcer& ) const
118 return std::vector<ObjectCalcer*>();
121 bool ArgsParserObjectType::isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const
123 return margsparser.isDefinedOnOrThrough( o, parents );