• 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
  • modes
moving.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 MOVING_H
19 #define MOVING_H
20 
21 #include "mode.h"
22 
23 #include "../misc/coordinate.h"
24 #include "../objects/object_calcer.h"
25 
26 class ObjectType;
27 class Coordinate;
28 class NormalPoint;
29 class KigWidget;
30 class MonitorDataObjects;
31 
39 class MovingModeBase
40  : public KigMode
41 {
42 protected:
43  KigWidget& mview;
44 private:
45  // all moving objects: these objects are all of the objects that
46  // need to be redrawn every time the cursor moves, and after calc is
47  // called.
48  std::vector<ObjectCalcer*> mcalcable;
49  std::vector<ObjectHolder*> mdrawable;
50 protected:
51  MovingModeBase( KigPart& doc, KigWidget& v );
52  ~MovingModeBase();
53 
59  void initScreen( const std::vector<ObjectCalcer*>& amo );
60 
61  // in these functions, subclasses should do the equivalent of
62  // Object::stopMove() and moveTo()... Note that no calc()'ing or
63  // drawing is to be done..
64  virtual void stopMove() = 0;
65  virtual void moveTo( const Coordinate& o, bool snaptogrid ) = 0;
66 
67 public:
68  void leftReleased( QMouseEvent*, KigWidget* );
69  void leftMouseMoved( QMouseEvent*, KigWidget* );
70  void mouseMoved( QMouseEvent*, KigWidget* );
71 };
72 
73 class MovingMode
74  : public MovingModeBase
75 {
76  class Private;
77  Private* d;
78  void stopMove();
79  void moveTo( const Coordinate& o, bool snaptogrid );
80 public:
81  MovingMode( const std::vector<ObjectHolder*>& objects, const Coordinate& c,
82  KigWidget&, KigPart& );
83  ~MovingMode();
84 };
85 
86 class PointRedefineMode
87  : public MovingModeBase
88 {
89  ObjectHolder* mp;
90  std::vector<ObjectCalcer::shared_ptr> moldparents;
91  const ObjectType* moldtype;
92  MonitorDataObjects* mmon;
93  void stopMove();
94  void moveTo( const Coordinate& o, bool snaptogrid );
95 public:
96  PointRedefineMode( ObjectHolder* p, KigPart& d, KigWidget& v );
97  ~PointRedefineMode();
98 };
99 
100 #endif
MovingModeBase::leftReleased
void leftReleased(QMouseEvent *, KigWidget *)
Definition: moving.cc:69
MovingModeBase::leftMouseMoved
void leftMouseMoved(QMouseEvent *, KigWidget *)
this means: mouse moved with left mouse button down (in case that wasn't clear...) ...
Definition: moving.cc:212
MovingMode::~MovingMode
~MovingMode()
Definition: moving.cc:217
MovingModeBase::stopMove
virtual void stopMove()=0
MovingModeBase::initScreen
void initScreen(const std::vector< ObjectCalcer * > &amo)
Subclasses should call this in their constructor, when they know which objects will be moving around...
Definition: moving.cc:39
KigMode
this is an ABC of a class containing the current "Mode" of the Kig document...
Definition: mode.h:37
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
MovingModeBase::mview
KigWidget & mview
Definition: moving.h:43
MovingModeBase::~MovingModeBase
~MovingModeBase()
Definition: moving.cc:208
MovingModeBase::mouseMoved
void mouseMoved(QMouseEvent *, KigWidget *)
mouse moved without any buttons down...
Definition: moving.cc:85
MovingMode
Definition: moving.h:73
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
MonitorDataObjects
this class monitors a set of DataObjects for changes and returns an appropriate ChangeObjectImpsComma...
Definition: kig_commands.h:153
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
MovingModeBase::moveTo
virtual void moveTo(const Coordinate &o, bool snaptogrid)=0
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
MovingMode::MovingMode
MovingMode(const std::vector< ObjectHolder * > &objects, const Coordinate &c, KigWidget &, KigPart &)
Definition: moving.cc:120
MovingModeBase::MovingModeBase
MovingModeBase(KigPart &doc, KigWidget &v)
Definition: moving.cc:203
PointRedefineMode
Definition: moving.h:86
PointRedefineMode::~PointRedefineMode
~PointRedefineMode()
Definition: moving.cc:199
PointRedefineMode::PointRedefineMode
PointRedefineMode(ObjectHolder *p, KigPart &d, KigWidget &v)
Definition: moving.cc:175
KigPart
This is a "Part".
Definition: kig_part.h:68
mode.h
MovingModeBase
"Template method" pattern ( see the Design patterns book ): This is a base class for two modes: norma...
Definition: moving.h:39
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