• 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
text_imp.h
Go to the documentation of this file.
1 // Copyright (C) 2003 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 KIG_OBJECTS_TEXT_IMP_H
19 #define KIG_OBJECTS_TEXT_IMP_H
20 
21 #include "object_imp.h"
22 
23 #include "../misc/coordinate.h"
24 #include "../misc/rect.h"
25 
26 class TextImp
27  : public ObjectImp
28 {
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();
38 
39  Coordinate attachPoint() const;
40  TextImp( const QString& text, const Coordinate& loc, bool frame = false );
41  TextImp* copy() const;
42  ~TextImp();
43 
44  ObjectImp* transform( const Transformation& ) const;
45 
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;
51 
52  int numberOfProperties() const;
53  const QByteArrayList properties() const;
54  const QByteArrayList propertiesInternalNames() const;
55  ObjectImp* property( int which, const KigDocument& w ) const;
56  const char* iconForProperty( int which ) const;
57  const ObjectImpType* impRequirementForProperty( int which ) const;
58  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
59 
60  const ObjectImpType* type() const;
61  void visit( ObjectImpVisitor* vtor ) const;
62 
63  QString text() const;
64  const Coordinate coordinate() const;
65  bool hasFrame() const;
66 
67  bool equals( const ObjectImp& rhs ) const;
68 };
69 
70 class NumericTextImp
71  : public TextImp
72 {
73  double mvalue;
74 public:
75  typedef TextImp Parent;
76  static const ObjectImpType* stype();
77  NumericTextImp( const QString& text, const Coordinate& loc, bool frame, double value );
78  NumericTextImp* copy() const;
79  double getValue() const;
80  const ObjectImpType* type() const;
81 
82  int numberOfProperties() const;
83  const QByteArrayList properties() const;
84  const QByteArrayList propertiesInternalNames() const;
85  ObjectImp* property( int which, const KigDocument& w ) const;
86  const char* iconForProperty( int which ) const;
87  const ObjectImpType* impRequirementForProperty( int which ) const;
88  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
89 };
90 
91 class BoolTextImp
92  : public TextImp
93 {
94  bool mvalue;
95 public:
96  typedef TextImp Parent;
97  static const ObjectImpType* stype();
98  BoolTextImp( const QString& text, const Coordinate& loc, bool frame, bool value );
99  BoolTextImp* copy() const;
100  bool getValue() const;
101  const ObjectImpType* type() const;
102 
103  int numberOfProperties() const;
104  const QByteArrayList properties() const;
105  const QByteArrayList propertiesInternalNames() const;
106  ObjectImp* property( int which, const KigDocument& w ) const;
107  const char* iconForProperty( int which ) const;
108  const ObjectImpType* impRequirementForProperty( int which ) const;
109  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
110 };
111 
112 #endif
object_imp.h
TextImp::surroundingRect
Rect surroundingRect() const
Definition: text_imp.cc:170
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
BoolTextImp::iconForProperty
const char * iconForProperty(int which) const
Definition: text_imp.cc:334
NumericTextImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: text_imp.cc:262
TextImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &) const
Definition: text_imp.cc:54
NumericTextImp::getValue
double getValue() const
Definition: text_imp.cc:211
TextImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: text_imp.cc:88
TextImp::iconForProperty
const char * iconForProperty(int which) const
Definition: text_imp.cc:95
TextImp::coordinate
const Coordinate coordinate() const
Definition: text_imp.cc:125
NumericTextImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: text_imp.cc:235
TextImp
Definition: text_imp.h:26
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
BoolTextImp::Parent
TextImp Parent
Definition: text_imp.h:96
TextImp::attachPoint
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
Definition: text_imp.cc:37
TextImp::transform
ObjectImp * transform(const Transformation &) const
Return this ObjectImp, transformed by the transformation t.
Definition: text_imp.cc:42
NumericTextImp
Definition: text_imp.h:70
TextImp::numberOfProperties
int numberOfProperties() const
Definition: text_imp.cc:69
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
TextImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: text_imp.cc:130
TextImp::copy
TextImp * copy() const
Returns a copy of this ObjectImp.
Definition: text_imp.cc:28
BoolTextImp::numberOfProperties
int numberOfProperties() const
Definition: text_imp.cc:308
BoolTextImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: text_imp.cc:313
TextImp::draw
void draw(KigPainter &p) const
Definition: text_imp.cc:48
NumericTextImp::Parent
TextImp Parent
Definition: text_imp.h:75
NumericTextImp::numberOfProperties
int numberOfProperties() const
Definition: text_imp.cc:216
BoolTextImp::properties
const QByteArrayList properties() const
Definition: text_imp.cc:320
TextImp::text
QString text() const
Definition: text_imp.cc:115
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
NumericTextImp::properties
const QByteArrayList properties() const
Definition: text_imp.cc:228
BoolTextImp
Definition: text_imp.h:91
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
NumericTextImp::iconForProperty
const char * iconForProperty(int which) const
Definition: text_imp.cc:242
TextImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: text_imp.cc:120
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
BoolTextImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: text_imp.cc:327
NumericTextImp::NumericTextImp
NumericTextImp(const QString &text, const Coordinate &loc, bool frame, double value)
Definition: text_imp.cc:179
TextImp::TextImp
TextImp(const QString &text, const Coordinate &loc, bool frame=false)
Definition: text_imp.cc:23
NumericTextImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: text_imp.cc:206
BoolTextImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: text_imp.cc:344
BoolTextImp::BoolTextImp
BoolTextImp(const QString &text, const Coordinate &loc, bool frame, bool value)
Definition: text_imp.cc:271
NumericTextImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: text_imp.cc:252
TextImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: text_imp.cc:74
TextImp::~TextImp
~TextImp()
Definition: text_imp.cc:33
TextImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: text_imp.cc:160
BoolTextImp::getValue
bool getValue() const
Definition: text_imp.cc:303
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
NumericTextImp::stype
static const ObjectImpType * stype()
Definition: text_imp.cc:189
TextImp::Parent
ObjectImp Parent
Definition: text_imp.h:36
QByteArrayList
QList< QByteArray > QByteArrayList
Definition: objects/common.h:50
BoolTextImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: text_imp.cc:354
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
TextImp::valid
bool valid() const
Definition: text_imp.cc:64
TextImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &) const
Definition: text_imp.cc:59
TextImp::properties
const QByteArrayList properties() const
Definition: text_imp.cc:81
TextImp::stype
static const ObjectImpType * stype()
Definition: text_imp.cc:143
NumericTextImp::copy
NumericTextImp * copy() const
Returns a copy of this ObjectImp.
Definition: text_imp.cc:184
TextImp::hasFrame
bool hasFrame() const
Definition: text_imp.cc:138
TextImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: text_imp.cc:165
NumericTextImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: text_imp.cc:221
TextImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: text_imp.cc:105
BoolTextImp::stype
static const ObjectImpType * stype()
Definition: text_imp.cc:281
ObjectImpVisitor
Definition: object_imp.h:56
BoolTextImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: text_imp.cc:298
BoolTextImp::copy
BoolTextImp * copy() const
Returns a copy of this ObjectImp.
Definition: text_imp.cc:276
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:40 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