• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • objects
bogus_imp.h
Go to the documentation of this file.
1 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
2 
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.
7 
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.
12 
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., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef BOGUS_IMP_H
19 #define BOGUS_IMP_H
20 
21 #include "object_imp.h"
22 #include "../misc/object_hierarchy.h"
23 #include "../misc/kigtransform.h"
24 
25 #include <qstring.h>
26 
37 class BogusImp
38  : public ObjectImp
39 {
40  typedef ObjectImp Parent;
41 public:
45  static const ObjectImpType* stype();
46 
47  Coordinate attachPoint( ) const;
48  void draw( KigPainter& p ) const;
49  bool contains( const Coordinate& p, int width, const KigWidget& w ) const;
50  bool inRect( const Rect& r, int width, const KigWidget& w ) const;
51  Rect surroundingRect() const;
52 
53  ObjectImp* transform( const Transformation& ) const;
54 };
55 
61 class InvalidImp
62  : public BogusImp
63 {
64 public:
68  static const ObjectImpType* stype();
69  typedef BogusImp Parent;
70 
74  InvalidImp();
75  InvalidImp* copy() const;
76 
77  const ObjectImpType* type() const;
78  void visit( ObjectImpVisitor* vtor ) const;
79 
80  bool canFillInNextEscape() const;
81  void fillInNextEscape( QString& s, const KigDocument& ) const;
82 
83  bool equals( const ObjectImp& rhs ) const;
84 };
85 
89 class DoubleImp
90  : public BogusImp
91 {
92  double mdata;
93 public:
97  static const ObjectImpType* stype();
98  typedef BogusImp Parent;
99 
103  DoubleImp( const double d );
104 
108  double data() const { return mdata; }
112  void setData( double d ) { mdata = d; }
113 
114  DoubleImp* copy() const;
115 
116  const ObjectImpType* type() const;
117  void visit( ObjectImpVisitor* vtor ) const;
118 
119  bool canFillInNextEscape() const;
120  void fillInNextEscape( QString& s, const KigDocument& ) const;
121 
122  bool equals( const ObjectImp& rhs ) const;
123 };
124 
128 class IntImp
129  : public BogusImp
130 {
131  int mdata;
132 public:
136  static const ObjectImpType* stype();
137  typedef BogusImp Parent;
138 
142  IntImp( const int d );
143 
147  int data() const { return mdata; }
151  void setData( int d ) { mdata = d; }
152 
153  IntImp* copy() const;
154 
155  const ObjectImpType* type() const;
156  void visit( ObjectImpVisitor* vtor ) const;
157 
158  bool canFillInNextEscape() const;
159  void fillInNextEscape( QString& s, const KigDocument& ) const;
160 
161  bool equals( const ObjectImp& rhs ) const;
162 };
163 
167 class StringImp
168  : public BogusImp
169 {
170  QString mdata;
171 public:
175  static const ObjectImpType* stype();
176  typedef BogusImp Parent;
177 
181  StringImp( const QString& d );
182 
186  const QString& data() const { return mdata; }
190  void setData( const QString& s ) { mdata = s; }
191 
192  StringImp* copy() const;
193 
194  const ObjectImpType* type() const;
195  void visit( ObjectImpVisitor* vtor ) const;
196 
197  bool canFillInNextEscape() const;
198  void fillInNextEscape( QString& s, const KigDocument& ) const;
199 
200  bool equals( const ObjectImp& rhs ) const;
201 };
202 
203 class HierarchyImp
204  : public BogusImp
205 {
206  ObjectHierarchy mdata;
207 public:
208  static const ObjectImpType* stype();
209  typedef BogusImp Parent;
210 
211  HierarchyImp( const ObjectHierarchy& h );
212 
213  const ObjectHierarchy& data() const { return mdata; }
214  void setData( const ObjectHierarchy& h ) { mdata = h; }
215 
216  HierarchyImp* copy() const;
217  const char* baseName() const;
218 
219  const ObjectImpType* type() const;
220  void visit( ObjectImpVisitor* vtor ) const;
221 
222  bool equals( const ObjectImp& rhs ) const;
223 };
224 
232 class TransformationImp
233  : public BogusImp
234 {
235  Transformation mdata;
236 public:
237  static const ObjectImpType* stype();
238  typedef BogusImp Parent;
239 
240  TransformationImp( const Transformation& h );
241 
242  const Transformation& data() const { return mdata; }
243  void setData( const Transformation& h ) { mdata = h; }
244 
245  TransformationImp* copy() const;
246 
247  const ObjectImpType* type() const;
248  void visit( ObjectImpVisitor* vtor ) const;
249 
250  bool equals( const ObjectImp& rhs ) const;
251 };
252 
253 class TestResultImp
254  : public StringImp
255 {
256  bool mtruth;
257 public:
258  static const ObjectImpType* stype();
259  typedef StringImp Parent;
260 
261  TestResultImp( bool truth, const QString& s );
262 
263  TestResultImp* copy() const;
264 
265  // const QString& data() const { return mdata; };
266  bool truth() const { return mtruth; }
267 
268  const ObjectImpType* type() const;
269  void visit( ObjectImpVisitor* vtor ) const;
270 
271  int numberOfProperties() const;
272  const QByteArrayList properties() const;
273  const QByteArrayList propertiesInternalNames() const;
274  ObjectImp* property( int which, const KigDocument& d ) const;
275  const char* iconForProperty( int which ) const;
276  const ObjectImpType* impRequirementForProperty( int which ) const;
277  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
278 
279  bool equals( const ObjectImp& rhs ) const;
280 };
281 
282 #endif
object_imp.h
HierarchyImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:227
DoubleImp::fillInNextEscape
void fillInNextEscape(QString &s, const KigDocument &) const
Definition: bogus_imp.cc:93
InvalidImp::copy
InvalidImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:79
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
TestResultImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:322
DoubleImp::setData
void setData(double d)
Set the contained data to d.
Definition: bogus_imp.h:112
BogusImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the BogusImp type.
Definition: bogus_imp.cc:286
HierarchyImp::Parent
BogusImp Parent
Definition: bogus_imp.h:209
DoubleImp::DoubleImp
DoubleImp(const double d)
Construct a new DoubleImp containing the value d.
Definition: bogus_imp.cc:44
ObjectHierarchy
Definition: object_hierarchy.h:30
IntImp::fillInNextEscape
void fillInNextEscape(QString &s, const KigDocument &) const
Definition: bogus_imp.cc:98
BogusImp::transform
ObjectImp * transform(const Transformation &) const
Return this ObjectImp, transformed by the transformation t.
Definition: bogus_imp.cc:74
StringImp::data
const QString & data() const
Get hold of the contained data.
Definition: bogus_imp.h:186
StringImp
This ObjectImp is a BogusImp containing only a string value.
Definition: bogus_imp.h:167
HierarchyImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:181
TestResultImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:312
StringImp::fillInNextEscape
void fillInNextEscape(QString &s, const KigDocument &) const
Definition: bogus_imp.cc:103
TestResultImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: bogus_imp.cc:343
BogusImp::attachPoint
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
Definition: bogus_imp.cc:25
DoubleImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:163
HierarchyImp::copy
HierarchyImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:113
InvalidImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:118
IntImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:169
TestResultImp::properties
const QByteArrayList properties() const
Definition: bogus_imp.cc:335
IntImp::copy
IntImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:64
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
DoubleImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:123
DoubleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the DoubleImp type.
Definition: bogus_imp.cc:270
InvalidImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:240
InvalidImp::fillInNextEscape
void fillInNextEscape(QString &s, const KigDocument &) const
Definition: bogus_imp.cc:88
TransformationImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:233
StringImp::canFillInNextEscape
bool canFillInNextEscape() const
Definition: bogus_imp.cc:208
TestResultImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: bogus_imp.cc:371
DoubleImp::data
double data() const
Get hold of the contained data.
Definition: bogus_imp.h:108
BogusImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &w) const
Definition: bogus_imp.cc:39
IntImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the IntImp type.
Definition: bogus_imp.cc:278
IntImp::setData
void setData(int d)
Set the contained data to d.
Definition: bogus_imp.h:151
TestResultImp::truth
bool truth() const
Definition: bogus_imp.h:266
IntImp
This ObjectImp is a BogusImp containing only an int value.
Definition: bogus_imp.h:128
StringImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:255
TransformationImp::Parent
BogusImp Parent
Definition: bogus_imp.h:238
HierarchyImp::baseName
const char * baseName() const
BogusImp
This is the base class for the so-called BogusImp's.
Definition: bogus_imp.h:37
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
HierarchyImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:138
BogusImp::surroundingRect
Rect surroundingRect() const
Definition: bogus_imp.cc:385
BogusImp::draw
void draw(KigPainter &p) const
Definition: bogus_imp.cc:30
InvalidImp::InvalidImp
InvalidImp()
Construct a new InvalidImp.
Definition: bogus_imp.cc:84
InvalidImp::canFillInNextEscape
bool canFillInNextEscape() const
Definition: bogus_imp.cc:193
IntImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:128
TestResultImp::copy
TestResultImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:307
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
TestResultImp::numberOfProperties
int numberOfProperties() const
Definition: bogus_imp.cc:330
TestResultImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:294
StringImp::StringImp
StringImp(const QString &d)
Construct a new StringImp containing the string d.
Definition: bogus_imp.cc:54
BogusImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &w) const
Definition: bogus_imp.cc:34
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
DoubleImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:245
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
TransformationImp
Definition: bogus_imp.h:232
HierarchyImp::setData
void setData(const ObjectHierarchy &h)
Definition: bogus_imp.h:214
HierarchyImp
Definition: bogus_imp.h:203
IntImp::data
int data() const
Get hold of the contained data.
Definition: bogus_imp.h:147
IntImp::IntImp
IntImp(const int d)
Construct a new IntImp containing the value d.
Definition: bogus_imp.cc:49
TestResultImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: bogus_imp.cc:378
HierarchyImp::HierarchyImp
HierarchyImp(const ObjectHierarchy &h)
Definition: bogus_imp.cc:108
TransformationImp::copy
TransformationImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:148
TestResultImp::property
ObjectImp * property(int which, const KigDocument &d) const
Definition: bogus_imp.cc:351
HierarchyImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:260
InvalidImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the InvalidImp type.
Definition: bogus_imp.cc:213
StringImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:133
TestResultImp::Parent
StringImp Parent
Definition: bogus_imp.h:259
StringImp::Parent
BogusImp Parent
Definition: bogus_imp.h:176
TransformationImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:187
InvalidImp::Parent
BogusImp Parent
Definition: bogus_imp.h:69
HierarchyImp::data
const ObjectHierarchy & data() const
Definition: bogus_imp.h:213
TransformationImp::setData
void setData(const Transformation &h)
Definition: bogus_imp.h:243
TestResultImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:317
DoubleImp::Parent
BogusImp Parent
Definition: bogus_imp.h:98
DoubleImp
This ObjectImp is a BogusImp containing only a double value.
Definition: bogus_imp.h:89
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
TestResultImp::iconForProperty
const char * iconForProperty(int which) const
Definition: bogus_imp.cc:361
StringImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:175
StringImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the StringImp type.
Definition: bogus_imp.cc:220
IntImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:250
TransformationImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: bogus_imp.cc:153
DoubleImp::canFillInNextEscape
bool canFillInNextEscape() const
Definition: bogus_imp.cc:198
QByteArrayList
QList< QByteArray > QByteArrayList
Definition: objects/common.h:50
IntImp::canFillInNextEscape
bool canFillInNextEscape() const
Definition: bogus_imp.cc:203
TransformationImp::TransformationImp
TransformationImp(const Transformation &h)
Definition: bogus_imp.cc:143
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
TestResultImp::TestResultImp
TestResultImp(bool truth, const QString &s)
Definition: bogus_imp.cc:302
StringImp::copy
StringImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:69
InvalidImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: bogus_imp.cc:158
TransformationImp::data
const Transformation & data() const
Definition: bogus_imp.h:242
TransformationImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: bogus_imp.cc:265
TestResultImp
Definition: bogus_imp.h:253
StringImp::setData
void setData(const QString &s)
Set the contained data.
Definition: bogus_imp.h:190
ObjectImpVisitor
Definition: object_imp.h:56
DoubleImp::copy
DoubleImp * copy() const
Returns a copy of this ObjectImp.
Definition: bogus_imp.cc:59
IntImp::Parent
BogusImp Parent
Definition: bogus_imp.h:137
InvalidImp
This ObjectImp represents an invalid object.
Definition: bogus_imp.h:61
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal