• 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_holder.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_HOLDER_H
19 #define KIG_OBJECTS_OBJECT_HOLDER_H
20 
21 #include "object_calcer.h"
22 
23 #include <qstring.h>
24 
40 class ObjectHolder
41 {
42  ObjectCalcer::shared_ptr mcalcer;
43  ObjectDrawer* mdrawer;
44  ObjectConstCalcer::shared_ptr mnamecalcer;
45 
46 public:
51  ObjectHolder( ObjectCalcer* calcer, ObjectDrawer* drawer, ObjectConstCalcer* namecalcer );
56  ObjectHolder( ObjectCalcer* calcer, ObjectDrawer* drawer );
61  ObjectHolder( ObjectCalcer* calcer );
62  ~ObjectHolder();
63 
64  const ObjectImp* imp() const;
65  const ObjectCalcer* calcer() const;
66  ObjectCalcer* calcer();
67  const ObjectDrawer* drawer() const;
68  ObjectDrawer* drawer();
69  // the following two return zero if no name is set.
70  const ObjectConstCalcer* nameCalcer() const;
71  ObjectConstCalcer* nameCalcer();
77  void setNameCalcer( ObjectConstCalcer* namecalcer );
78 
82  const QString name() const;
87  void setDrawer( ObjectDrawer* d );
92  ObjectDrawer* switchDrawer( ObjectDrawer* d );
93 
97  void calc( const KigDocument& );
102  void draw( KigPainter& p, bool selected ) const;
106  bool contains( const Coordinate& p, const KigWidget& w, bool nv = false ) const;
110  bool inRect( const Rect& r, const KigWidget& w ) const;
114  bool shown() const;
115 
120  const Coordinate moveReferencePoint() const;
125  void move( const Coordinate& to, const KigDocument& );
130  bool canMove() const;
135  bool isFreelyTranslatable() const;
136 
142  QString selectStatement() const;
143 };
144 
145 #endif
ObjectHolder::shown
bool shown() const
Returns whether this object is shown.
Definition: object_holder.cc:135
ObjectHolder::isFreelyTranslatable
bool isFreelyTranslatable() const
This call is simply forwarded to the ObjectCalcer.
Definition: object_holder.cc:123
ObjectConstCalcer
This is an ObjectCalcer that keeps an ObjectImp, and never calculates a new one.
Definition: object_calcer.h:232
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
ObjectHolder::drawer
const ObjectDrawer * drawer() const
Definition: object_holder.cc:58
ObjectHolder::nameCalcer
const ObjectConstCalcer * nameCalcer() const
Definition: object_holder.cc:63
myboost::intrusive_ptr< ObjectCalcer >
ObjectHolder::name
const QString name() const
returns a null QString if no name is set.
Definition: object_holder.cc:140
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
ObjectHolder::calc
void calc(const KigDocument &)
Make our ObjectCalcer recalculate its ObjectImp.
Definition: object_holder.cc:73
ObjectHolder::~ObjectHolder
~ObjectHolder()
Definition: object_holder.cc:43
ObjectHolder::setDrawer
void setDrawer(ObjectDrawer *d)
Set the ObjectDrawer of this ObjectHolder to d , the old ObjectDrawer is deleted. ...
Definition: object_holder.cc:68
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
ObjectCalcer
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
ObjectHolder::canMove
bool canMove() const
This call is simply forwarded to the ObjectCalcer.
Definition: object_holder.cc:118
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ObjectHolder::setNameCalcer
void setNameCalcer(ObjectConstCalcer *namecalcer)
Setting the namecalcer is only allowed if previously none was set.
Definition: object_holder.cc:151
object_calcer.h
ObjectHolder::imp
const ObjectImp * imp() const
Definition: object_holder.cc:48
ObjectHolder::calcer
const ObjectCalcer * calcer() const
Definition: object_holder.cc:53
ObjectHolder::selectStatement
QString selectStatement() const
Return a statement saying something like "select this segment" or "select segment ab" depending on wh...
Definition: object_holder.cc:157
ObjectHolder::contains
bool contains(const Coordinate &p, const KigWidget &w, bool nv=false) const
Returns whether this object contains the point p .
Definition: object_holder.cc:83
ObjectDrawer
A class holding some information about how a certain object is drawn on the window.
Definition: object_drawer.h:47
ObjectHolder::draw
void draw(KigPainter &p, bool selected) const
Draw this object on the given KigPainter.
Definition: object_holder.cc:78
ObjectHolder::moveReferencePoint
const Coordinate moveReferencePoint() const
This call is simply forwarded to the ObjectCalcer.
Definition: object_holder.cc:108
ObjectHolder::switchDrawer
ObjectDrawer * switchDrawer(ObjectDrawer *d)
Set the ObjectDrawer of this ObjectHolder to d , the old ObjectDrawer is not deleted, but returned.
Definition: object_holder.cc:128
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
ObjectHolder::ObjectHolder
ObjectHolder(ObjectCalcer *calcer, ObjectDrawer *drawer, ObjectConstCalcer *namecalcer)
Construct a new ObjectHolder with a given ObjectCalcer and ObjectDrawer, with a given name calcer...
Definition: object_holder.cc:31
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
ObjectHolder::move
void move(const Coordinate &to, const KigDocument &)
This call is simply forwarded to the ObjectCalcer.
Definition: object_holder.cc:113
ObjectHolder::inRect
bool inRect(const Rect &r, const KigWidget &w) const
Returns whether this object is in the rectangle r .
Definition: object_holder.cc:88
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