• 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
  • kig
kig_view.h
Go to the documentation of this file.
1 
22 #ifndef KIG_VIEW_H
23 #define KIG_VIEW_H
24 
25 #include <qwidget.h>
26 #include <qpixmap.h>
27 
28 #include <kparts/part.h>
29 
30 #include <vector>
31 
32 #include "../objects/object_holder.h"
33 #include "../misc/rect.h"
34 #include "../misc/screeninfo.h"
35 
36 class QGridLayout;
37 class QScrollBar;
38 
39 class KigDocument;
40 class KigView;
41 
50 class KigWidget : public QWidget
51 {
52  Q_OBJECT
53 
54  KigPart* mpart;
55  KigView* mview;
56 
57  // we reimplement these from QWidget to suit our needs
58  void mousePressEvent( QMouseEvent* e );
59  void mouseMoveEvent( QMouseEvent* e );
60  void mouseReleaseEvent( QMouseEvent* e );
61  void paintEvent( QPaintEvent* e );
62  void wheelEvent( QWheelEvent* e );
63  void resizeEvent( QResizeEvent* );
64  QSize sizeHint() const;
65 
71  Rect matchScreenShape( const Rect& r ) const;
72 
73 public:
79  QPixmap stillPix;
84  QPixmap curPix;
85 
86 protected:
87  std::vector<QRect> oldOverlay;
88 
93  ScreenInfo msi;
94 
98  bool misfullscreen;
99 
100  bool mispainting;
101 
102  bool malreadyresized;
103 
104 public:
109  KigWidget( KigPart* doc,
110  KigView* view,
111  QWidget* parent = 0,
112  bool fullscreen = false
113  );
114  ~KigWidget();
115 
116  bool isFullScreen() const;
117  void setFullScreen( bool f );
118 
119  const KigView* view() const {
120  return mview;
121  }
122 
123  KigView* view() {
124  return mview;
125  }
126 
155  void clearStillPix();
159  void updateCurPix( const std::vector<QRect>& = std::vector<QRect>());
160 
164  void updateWidget( const std::vector<QRect>& = std::vector<QRect>() );
165  void updateEntireWidget();
166 
177  const Rect showingRect() const;
178  void setShowingRect( const Rect& r );
179 
180  const Coordinate fromScreen( const QPoint& p );
181  const Rect fromScreen( const QRect& r );
182  double pixelWidth() const;
183 
189  const ScreenInfo& screenInfo() const;
190 
191  Rect entireDocumentRect() const;
192 
193  void updateScrollBars();
194 
195  void scrollSetBottom( double rhs );
196  void scrollSetLeft( double rhs );
197 
198  const KigDocument& document() const;
199 
200 public:
205  void recenterScreen();
211  void slotRecenterScreen();
212 
213  // called when the user clicks the appropriate buttons..
214  void slotZoomIn();
215  void slotZoomOut();
216 
217  void zoomRect();
218  void zoomArea();
219 
220  void redrawScreen( const std::vector<ObjectHolder*>& selection, bool paintOnWidget = true );
221 };
222 
229 class KigView
230  : public QWidget
231 {
232  Q_OBJECT
233 
234  QGridLayout* mlayout;
235  QScrollBar* mrightscroll;
236  QScrollBar* mbottomscroll;
237 
242  bool mupdatingscrollbars;
243 
244  KigWidget* mrealwidget;
245  KigPart* mpart;
246 
247 public:
248  explicit KigView( KigPart* part,
249  bool fullscreen = false,
250  QWidget* parent = 0
251  );
252  ~KigView();
253 
254  void setupActions();
255 
256  const ScreenInfo& screenInfo() const;
257 
258  KigWidget* realWidget() const;
259  void scrollHorizontal( int delta );
260  void scrollVertical( int delta );
261 
262 public slots:
263  void updateScrollBars();
264  void slotZoomIn();
265  void slotZoomOut();
266  void zoomRect();
267  void zoomArea();
268  void slotInternalRecenterScreen();
269  void slotRecenterScreen();
270  void toggleFullScreen();
271 
272 private slots:
273  void slotRightScrollValueChanged( int );
274  void slotBottomScrollValueChanged( int );
275 };
276 #endif
KigWidget::misfullscreen
bool misfullscreen
is this a full-screen widget ?
Definition: kig_view.h:98
KigView::slotInternalRecenterScreen
void slotInternalRecenterScreen()
Definition: kig_view.cpp:575
KigView::realWidget
KigWidget * realWidget() const
Definition: kig_view.cpp:455
KigWidget::updateEntireWidget
void updateEntireWidget()
Definition: kig_view.cpp:149
KigWidget::zoomArea
void zoomArea()
Definition: kig_view.cpp:580
KigView::~KigView
~KigView()
Definition: kig_view.cpp:451
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
QWidget
KigWidget::mispainting
bool mispainting
Definition: kig_view.h:100
KigWidget::malreadyresized
bool malreadyresized
Definition: kig_view.h:102
KigWidget::entireDocumentRect
Rect entireDocumentRect() const
Definition: kig_view.cpp:398
KigWidget::view
KigView * view()
Definition: kig_view.h:123
KigWidget::slotZoomIn
void slotZoomIn()
Definition: kig_view.cpp:212
KigWidget::~KigWidget
~KigWidget()
Definition: kig_view.cpp:71
KigWidget::recenterScreen
void recenterScreen()
this recenters the screen, that is, resets the shown rect to mpart->document().suggestedRect().
Definition: kig_view.cpp:202
KigView::scrollVertical
void scrollVertical(int delta)
Definition: kig_view.cpp:490
ScreenInfo
ScreenInfo is a simple utility class that maps a region of the document onto a region of the screen...
Definition: screeninfo.h:31
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
KigWidget::updateScrollBars
void updateScrollBars()
Definition: kig_view.cpp:298
KigWidget::screenInfo
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
KigView
This class is a wrapper for KigWidget.
Definition: kig_view.h:229
KigView::zoomArea
void zoomArea()
Definition: kig_view.cpp:608
KigWidget::slotZoomOut
void slotZoomOut()
Definition: kig_view.cpp:225
KigWidget::setShowingRect
void setShowingRect(const Rect &r)
Definition: kig_view.cpp:565
KigWidget::oldOverlay
std::vector< QRect > oldOverlay
Definition: kig_view.h:87
KigWidget::view
const KigView * view() const
Definition: kig_view.h:119
KigWidget::fromScreen
const Coordinate fromScreen(const QPoint &p)
Definition: kig_view.cpp:282
KigWidget::slotRecenterScreen
void slotRecenterScreen()
this gets called if the user clicks the recenter screen button.
Definition: kig_view.cpp:515
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
KigView::screenInfo
const ScreenInfo & screenInfo() const
Definition: kig_view.cpp:446
KigWidget::document
const KigDocument & document() const
Definition: kig_view.cpp:460
KigWidget::scrollSetLeft
void scrollSetLeft(double rhs)
Definition: kig_view.cpp:436
KigWidget::updateCurPix
void updateCurPix(const std::vector< QRect > &=std::vector< QRect >())
update curPix (bitBlt stillPix onto curPix..)
Definition: kig_view.cpp:187
KigView::slotZoomIn
void slotZoomIn()
Definition: kig_view.cpp:505
KigWidget::zoomRect
void zoomRect()
Definition: kig_view.cpp:540
KigWidget::KigWidget
KigWidget(KigPart *doc, KigView *view, QWidget *parent=0, bool fullscreen=false)
standard qwidget constructor.
Definition: kig_view.cpp:45
KigWidget::isFullScreen
bool isFullScreen() const
Definition: kig_view.cpp:500
KigView::zoomRect
void zoomRect()
Definition: kig_view.cpp:560
KigWidget::curPix
QPixmap curPix
temporary, gets bitBlt'd (copied) onto the widget (to avoid flickering)
Definition: kig_view.h:84
KigWidget::clearStillPix
void clearStillPix()
The following are functions used by KigMode's to tell us to draw stuff...
Definition: kig_view.cpp:245
KigView::toggleFullScreen
void toggleFullScreen()
Definition: kig_view.cpp:526
KigView::KigView
KigView(KigPart *part, bool fullscreen=false, QWidget *parent=0)
Definition: kig_view.cpp:303
KigView::scrollHorizontal
void scrollHorizontal(int delta)
Definition: kig_view.cpp:480
KigWidget::updateWidget
void updateWidget(const std::vector< QRect > &=std::vector< QRect >())
this means bitBlting curPix on the actual widget...
Definition: kig_view.cpp:115
KigView::setupActions
void setupActions()
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
KigView::slotZoomOut
void slotZoomOut()
Definition: kig_view.cpp:510
KigView::updateScrollBars
void updateScrollBars()
Definition: kig_view.cpp:342
KigPart
This is a "Part".
Definition: kig_part.h:68
KigWidget::pixelWidth
double pixelWidth() const
Definition: kig_view.cpp:287
KigWidget::setFullScreen
void setFullScreen(bool f)
Definition: kig_view.cpp:535
KigWidget::redrawScreen
void redrawScreen(const std::vector< ObjectHolder * > &selection, bool paintOnWidget=true)
Definition: kig_view.cpp:252
KigView::slotRecenterScreen
void slotRecenterScreen()
Definition: kig_view.cpp:570
KigWidget::msi
ScreenInfo msi
this is a class that maps from our widget coordinates to the document's coordinates ( and back )...
Definition: kig_view.h:93
KigWidget::stillPix
QPixmap stillPix
what do the still objects look like wondering if this is appropriate, maybe it should be part of Movi...
Definition: kig_view.h:79
KigWidget::showingRect
const Rect showingRect() const
Mapping between Internal Coordinate Systems there are two coordinate systems: 1 the widget's coordina...
Definition: kig_view.cpp:277
KigWidget::scrollSetBottom
void scrollSetBottom(double rhs)
Definition: kig_view.cpp:426
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