Kig Python Scripting API Documentation

bogus_imp.h
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 <tqstring.h>
26 
37 class BogusImp
38  : public ObjectImp
39 {
40  typedef ObjectImp Parent;
41 public:
45  static const ObjectImpType* stype();
46 
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( TQString& 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( TQString& 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( TQString& s, const KigDocument& ) const;
160 
161  bool equals( const ObjectImp& rhs ) const;
162 };
163 
167 class StringImp
168  : public BogusImp
169 {
170  TQString mdata;
171 public:
175  static const ObjectImpType* stype();
176  typedef BogusImp Parent;
177 
181  StringImp( const TQString& d );
182 
186  const TQString& data() const { return mdata; }
190  void setData( const TQString& 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( TQString& 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 BogusImp
255 {
256  const TQString mdata;
257 public:
258  static const ObjectImpType* stype();
259  typedef BogusImp Parent;
260 
261  TestResultImp( const TQString& s );
262 
263  TestResultImp* copy() const;
264 
265  const TQString& data() const { return mdata; }
266 
267  const ObjectImpType* type() const;
268  void visit( ObjectImpVisitor* vtor ) const;
269 
270  const uint numberOfProperties() const;
271  const QCStringList properties() const;
272  const QCStringList propertiesInternalNames() const;
273  ObjectImp* property( uint which, const KigDocument& d ) const;
274  const char* iconForProperty( uint which ) const;
275  const ObjectImpType* impRequirementForProperty( uint which ) const;
276  bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
277 
278  bool equals( const ObjectImp& rhs ) const;
279 };
280 
281 #endif
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
static const ObjectType * stype()
Returns the ObjectType representing the BogusObject type.
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
The Coordinate class is the basic class representing a 2D location by its x and y components.
Definition: coordinate.h:34
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
void setData(double d)
Set the contained data to d.
Definition: bogus_imp.h:112
static const ObjectType * stype()
Returns the ObjectType representing the DoubleObject type.
double data() const
Get hold of the contained data.
Definition: bogus_imp.h:108
DoubleObject * copy() const
Returns a copy of this Object.
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
int data() const
Get hold of the contained data.
Definition: bogus_imp.h:147
static const ObjectType * stype()
Returns the ObjectType representing the IntObject type.
void setData(int d)
Set the contained data to d.
Definition: bogus_imp.h:151
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
IntObject * copy() const
Returns a copy of this Object.
static const ObjectType * stype()
Returns the ObjectType representing the InvalidObject type.
InvalidObject * copy() const
Returns a copy of this Object.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
The Object class represents the behaviour of an object after it is calculated.
Definition: object_imp.h:219
static const ObjectType * stype()
Returns the ObjectType representing the StringObject type.
const TQString & data() const
Get hold of the contained data.
Definition: bogus_imp.h:186
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
void setData(const TQString &s)
Set the contained data.
Definition: bogus_imp.h:190
StringObject * copy() const
Returns a copy of this Object.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Class representing a transformation.
Definition: kigtransform.h:38
KDE Logo
This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed May 15 2024 03:39:42 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2001