• 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
object_drawer.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_OBJECT_DRAWER_H
19 #define KIG_OBJECTS_OBJECT_DRAWER_H
20 
21 #include <qcolor.h>
22 #include <qfont.h>
23 #include <qnamespace.h>
24 
25 class ObjectImp;
26 class KigPainter;
27 class Coordinate;
28 class KigWidget;
29 class Rect;
30 
47 class ObjectDrawer
48 {
49  QColor mcolor;
50  bool mshown;
51  int mwidth;
52  Qt::PenStyle mstyle;
53  int mpointstyle;
54  QFont mfont;
55 public:
61  ObjectDrawer();
62  explicit ObjectDrawer( const QColor& color, int width = -1, bool shown = true, Qt::PenStyle = Qt::SolidLine, int pointStyle = 0, const QFont& f = QFont() );
67  void draw( const ObjectImp& imp, KigPainter& p, bool selected ) const;
73  bool contains( const ObjectImp& imp, const Coordinate& pt, const KigWidget& w, bool nv = false ) const;
78  bool inRect( const ObjectImp& imp, const Rect& r, const KigWidget& w ) const;
79 
84  bool shown() const;
88  QColor color() const;
92  int width() const;
96  Qt::PenStyle style() const;
100  int pointStyle() const;
104  QFont font() const;
108  QString pointStyleToString() const;
112  QString styleToString() const;
117  ObjectDrawer* getCopyShown( bool s ) const;
122  ObjectDrawer* getCopyColor( const QColor& c ) const;
127  ObjectDrawer* getCopyWidth( int w ) const;
132  ObjectDrawer* getCopyStyle( Qt::PenStyle s ) const;
137  ObjectDrawer* getCopyPointStyle( int p ) const;
142  ObjectDrawer* getCopyFont( const QFont& f ) const;
148  static int pointStyleFromString( const QString& style );
154  static Qt::PenStyle styleFromString( const QString& style );
155 };
156 
157 #endif
ObjectDrawer::getCopyShown
ObjectDrawer * getCopyShown(bool s) const
returns a new ObjectDrawer that is identical to this one, except that the shown state is set to s ...
Definition: object_drawer.cc:62
ObjectDrawer::pointStyleToString
QString pointStyleToString() const
return pointStyle transformed in a string
Definition: object_drawer.cc:184
ObjectDrawer::shown
bool shown() const
returns whether the object this ObjectDrawer is responsible for will be drawn or not.
Definition: object_drawer.cc:52
ObjectDrawer::font
QFont font() const
return the font
Definition: object_drawer.cc:149
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
ObjectDrawer::getCopyStyle
ObjectDrawer * getCopyStyle(Qt::PenStyle s) const
returns a new ObjectDrawer that is identical to this one, except that the PenStyle state is set to s ...
Definition: object_drawer.cc:98
ObjectDrawer::inRect
bool inRect(const ObjectImp &imp, const Rect &r, const KigWidget &w) const
returns whether the object imp is in the rectangle r .
Definition: object_drawer.cc:164
ObjectDrawer::draw
void draw(const ObjectImp &imp, KigPainter &p, bool selected) const
Draw the object imp on kigpainter p .
Definition: object_drawer.cc:29
ObjectDrawer::ObjectDrawer
ObjectDrawer()
Construct a new ObjectDrawer with a default color ( Qt::blue ), width ( -1 ), shown state ( true )...
Definition: object_drawer.cc:159
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
ObjectDrawer::getCopyPointStyle
ObjectDrawer * getCopyPointStyle(int p) const
returns a new ObjectDrawer that is identical to this one, except that the pointStyle state is set to ...
Definition: object_drawer.cc:110
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ObjectDrawer::getCopyColor
ObjectDrawer * getCopyColor(const QColor &c) const
returns a new ObjectDrawer that is identical to this one, except that the color is set to c ...
Definition: object_drawer.cc:74
ObjectDrawer::contains
bool contains(const ObjectImp &imp, const Coordinate &pt, const KigWidget &w, bool nv=false) const
returns whether the object imp contains coordinate p .
Definition: object_drawer.cc:46
ObjectDrawer::width
int width() const
return the width of the object
Definition: object_drawer.cc:134
ObjectDrawer::pointStyleFromString
static int pointStyleFromString(const QString &style)
Note that this returns a valid point style in every case, even if the given style string is unknown...
Definition: object_drawer.cc:169
ObjectDrawer::styleToString
QString styleToString() const
return style transformed in a string
Definition: object_drawer.cc:215
ObjectDrawer
A class holding some information about how a certain object is drawn on the window.
Definition: object_drawer.h:47
ObjectDrawer::pointStyle
int pointStyle() const
return pointStyle for points
Definition: object_drawer.cc:144
ObjectDrawer::styleFromString
static Qt::PenStyle styleFromString(const QString &style)
Note that this returns a valid style in every case, even if the given style string is unknown...
Definition: object_drawer.cc:200
ObjectDrawer::color
QColor color() const
returns the color that the object will be drawn in
Definition: object_drawer.cc:57
ObjectDrawer::getCopyFont
ObjectDrawer * getCopyFont(const QFont &f) const
returns a new ObjectDrawer that is identical to this one, except that the font state is set to f ...
Definition: object_drawer.cc:122
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
ObjectDrawer::style
Qt::PenStyle style() const
return PenStyle for all objects except points
Definition: object_drawer.cc:139
ObjectDrawer::getCopyWidth
ObjectDrawer * getCopyWidth(int w) const
returns a new ObjectDrawer that is identical to this one, except that the width is set to w ...
Definition: object_drawer.cc:86
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