moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / objects / text_imp.h
blob87f17c87c8afea97e092648d83ae8e0b054a295a
1 // Copyright (C) 2003 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_TEXT_IMP_H
19 #define KIG_OBJECTS_TEXT_IMP_H
21 #include "object_imp.h"
23 #include "../misc/coordinate.h"
24 #include "../misc/rect.h"
26 class TextImp
27 : public ObjectImp
29 QString mtext;
30 Coordinate mloc;
31 bool mframe;
32 // with this var, we keep track of the place we drew in, for use in
33 // the contains() function..
34 mutable Rect mboundrect;
35 public:
36 typedef ObjectImp Parent;
37 static const ObjectImpType* stype();
39 Coordinate attachPoint() const;
40 TextImp( const QString& text, const Coordinate& loc, bool frame = false );
41 TextImp* copy() const;
42 ~TextImp();
44 ObjectImp* transform( const Transformation& ) const;
46 void draw( KigPainter& p ) const;
47 bool contains( const Coordinate& p, int width, const KigWidget& ) const;
48 bool inRect( const Rect& r, int width, const KigWidget& ) const;
49 bool valid() const;
50 Rect surroundingRect() const;
52 const uint numberOfProperties() const;
53 const QCStringList properties() const;
54 const QCStringList propertiesInternalNames() const;
55 ObjectImp* property( uint which, const KigDocument& w ) const;
56 const char* iconForProperty( uint which ) const;
57 const ObjectImpType* impRequirementForProperty( uint which ) const;
58 bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
60 const ObjectImpType* type() const;
61 void visit( ObjectImpVisitor* vtor ) const;
63 QString text() const;
64 const Coordinate coordinate() const;
65 bool hasFrame() const;
67 bool equals( const ObjectImp& rhs ) const;
70 #endif