src/eric7/Documentation/Source/eric7.PdfViewer.PdfView.html

branch
eric7
changeset 9730
00cf7289d899
child 10229
e50bbf250343
equal deleted inserted replaced
9729:f17d787ca4fa 9730:00cf7289d899
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.PdfViewer.PdfView</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.PdfViewer.PdfView</h1>
10
11 <p>
12 Module implementing a specialized PDF view class.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#PdfMarker">PdfMarker</a></td>
25 <td>Class defining the data structure for markers.</td>
26 </tr>
27 <tr>
28 <td><a href="#PdfMarkerGeometry">PdfMarkerGeometry</a></td>
29 <td>Class defining the data structure for marker geometries.</td>
30 </tr>
31 <tr>
32 <td><a href="#PdfMarkerType">PdfMarkerType</a></td>
33 <td>Class defining the various marker types.</td>
34 </tr>
35 <tr>
36 <td><a href="#PdfView">PdfView</a></td>
37 <td>Class implementing a specialized PDF view.</td>
38 </tr>
39 </table>
40 <h3>Functions</h3>
41
42 <table>
43 <tr><td>None</td></tr>
44 </table>
45 <hr />
46 <hr />
47 <a NAME="PdfMarker" ID="PdfMarker"></a>
48 <h2>PdfMarker</h2>
49
50 <p>
51 Class defining the data structure for markers.
52 </p>
53 <h3>Derived from</h3>
54 None
55 <h3>Class Attributes</h3>
56
57 <table>
58 <tr><td>None</td></tr>
59 </table>
60 <h3>Class Methods</h3>
61
62 <table>
63 <tr><td>None</td></tr>
64 </table>
65 <h3>Methods</h3>
66
67 <table>
68 <tr><td>None</td></tr>
69 </table>
70 <h3>Static Methods</h3>
71
72 <table>
73 <tr><td>None</td></tr>
74 </table>
75
76 <div align="right"><a href="#top">Up</a></div>
77 <hr />
78 <hr />
79 <a NAME="PdfMarkerGeometry" ID="PdfMarkerGeometry"></a>
80 <h2>PdfMarkerGeometry</h2>
81
82 <p>
83 Class defining the data structure for marker geometries.
84 </p>
85 <h3>Derived from</h3>
86 None
87 <h3>Class Attributes</h3>
88
89 <table>
90 <tr><td>None</td></tr>
91 </table>
92 <h3>Class Methods</h3>
93
94 <table>
95 <tr><td>None</td></tr>
96 </table>
97 <h3>Methods</h3>
98
99 <table>
100 <tr><td>None</td></tr>
101 </table>
102 <h3>Static Methods</h3>
103
104 <table>
105 <tr><td>None</td></tr>
106 </table>
107
108 <div align="right"><a href="#top">Up</a></div>
109 <hr />
110 <hr />
111 <a NAME="PdfMarkerType" ID="PdfMarkerType"></a>
112 <h2>PdfMarkerType</h2>
113
114 <p>
115 Class defining the various marker types.
116 </p>
117 <h3>Derived from</h3>
118 enum.Enum
119 <h3>Class Attributes</h3>
120
121 <table>
122 <tr><td>SEARCHRESULT</td></tr><tr><td>SELECTION</td></tr>
123 </table>
124 <h3>Class Methods</h3>
125
126 <table>
127 <tr><td>None</td></tr>
128 </table>
129 <h3>Methods</h3>
130
131 <table>
132 <tr><td>None</td></tr>
133 </table>
134 <h3>Static Methods</h3>
135
136 <table>
137 <tr><td>None</td></tr>
138 </table>
139
140 <div align="right"><a href="#top">Up</a></div>
141 <hr />
142 <hr />
143 <a NAME="PdfView" ID="PdfView"></a>
144 <h2>PdfView</h2>
145
146 <p>
147 Class implementing a specialized PDF view.
148 </p>
149 <h3>Signals</h3>
150 <dl>
151
152 <dt>selectionAvailable(bool)</dt>
153 <dd>
154 emitted to indicate the availability of a selection
155 </dd>
156 </dl>
157 <h3>Derived from</h3>
158 QPdfView
159 <h3>Class Attributes</h3>
160
161 <table>
162 <tr><td>MarkerColors</td></tr>
163 </table>
164 <h3>Class Methods</h3>
165
166 <table>
167 <tr><td>None</td></tr>
168 </table>
169 <h3>Methods</h3>
170
171 <table>
172
173 <tr>
174 <td><a href="#PdfView.__init__">PdfView</a></td>
175 <td>Constructor</td>
176 </tr>
177 <tr>
178 <td><a href="#PdfView.__calculateDocumentLayout">__calculateDocumentLayout</a></td>
179 <td>Private slot to calculate the document layout data.</td>
180 </tr>
181 <tr>
182 <td><a href="#PdfView.__calculateDocumentViewport">__calculateDocumentViewport</a></td>
183 <td>Private method to calculate the document viewport.</td>
184 </tr>
185 <tr>
186 <td><a href="#PdfView.__calculateMarkerGeometries">__calculateMarkerGeometries</a></td>
187 <td>Private method to calculate the marker geometries.</td>
188 </tr>
189 <tr>
190 <td><a href="#PdfView.__currentPageChanged">__currentPageChanged</a></td>
191 <td>Private slot to handle a change of the current page.</td>
192 </tr>
193 <tr>
194 <td><a href="#PdfView.__updateView">__updateView</a></td>
195 <td>Private method to update the view.</td>
196 </tr>
197 <tr>
198 <td><a href="#PdfView.__zoomFactorForMode">__zoomFactorForMode</a></td>
199 <td>Private method to calculate the zoom factor iaw.</td>
200 </tr>
201 <tr>
202 <td><a href="#PdfView.__zoomInOut">__zoomInOut</a></td>
203 <td>Private method to zoom into or out of the view.</td>
204 </tr>
205 <tr>
206 <td><a href="#PdfView.addMarker">addMarker</a></td>
207 <td>Public slot to add a marker.</td>
208 </tr>
209 <tr>
210 <td><a href="#PdfView.addSearchMarker">addSearchMarker</a></td>
211 <td>Public slot to add a search marker given a PDF link.</td>
212 </tr>
213 <tr>
214 <td><a href="#PdfView.clearAllMarkers">clearAllMarkers</a></td>
215 <td>Public slot to clear all markers.</td>
216 </tr>
217 <tr>
218 <td><a href="#PdfView.clearMarkers">clearMarkers</a></td>
219 <td>Public slot to clear the markers of a specific type.</td>
220 </tr>
221 <tr>
222 <td><a href="#PdfView.clearSearchMarkers">clearSearchMarkers</a></td>
223 <td>Public slot to clear the search markers.</td>
224 </tr>
225 <tr>
226 <td><a href="#PdfView.clearSelection">clearSelection</a></td>
227 <td>Public slot to clear the current selection.</td>
228 </tr>
229 <tr>
230 <td><a href="#PdfView.event">event</a></td>
231 <td>Public method handling events.</td>
232 </tr>
233 <tr>
234 <td><a href="#PdfView.gestureEvent">gestureEvent</a></td>
235 <td>Protected method handling gesture events.</td>
236 </tr>
237 <tr>
238 <td><a href="#PdfView.getSelection">getSelection</a></td>
239 <td>Public method to get a PDF selection object.</td>
240 </tr>
241 <tr>
242 <td><a href="#PdfView.hasSelection">hasSelection</a></td>
243 <td>Public method to check the presence of a selection.</td>
244 </tr>
245 <tr>
246 <td><a href="#PdfView.keyPressEvent">keyPressEvent</a></td>
247 <td>Protected method handling key press events.</td>
248 </tr>
249 <tr>
250 <td><a href="#PdfView.mouseMoveEvent">mouseMoveEvent</a></td>
251 <td>Protected method to handle mouse move events.</td>
252 </tr>
253 <tr>
254 <td><a href="#PdfView.mousePressEvent">mousePressEvent</a></td>
255 <td>Protected method to handle mouse press events.</td>
256 </tr>
257 <tr>
258 <td><a href="#PdfView.mouseReleaseEvent">mouseReleaseEvent</a></td>
259 <td>Protected method to handle mouse release events.</td>
260 </tr>
261 <tr>
262 <td><a href="#PdfView.paintEvent">paintEvent</a></td>
263 <td>Protected method to paint the view.</td>
264 </tr>
265 <tr>
266 <td><a href="#PdfView.resizeEvent">resizeEvent</a></td>
267 <td>Protected method to handle a widget resize.</td>
268 </tr>
269 <tr>
270 <td><a href="#PdfView.scrollContentsBy">scrollContentsBy</a></td>
271 <td>Public method called when the scrollbars are moved.</td>
272 </tr>
273 <tr>
274 <td><a href="#PdfView.setDocument">setDocument</a></td>
275 <td>Public method to set the PDF document.</td>
276 </tr>
277 <tr>
278 <td><a href="#PdfView.wheelEvent">wheelEvent</a></td>
279 <td>Protected method to handle wheel events.</td>
280 </tr>
281 <tr>
282 <td><a href="#PdfView.zoomIn">zoomIn</a></td>
283 <td>Public slot to zoom into the view.</td>
284 </tr>
285 <tr>
286 <td><a href="#PdfView.zoomOut">zoomOut</a></td>
287 <td>Public slot to zoom out of the view.</td>
288 </tr>
289 <tr>
290 <td><a href="#PdfView.zoomReset">zoomReset</a></td>
291 <td>Public slot to reset the zoom factor of the view.</td>
292 </tr>
293 </table>
294 <h3>Static Methods</h3>
295
296 <table>
297 <tr><td>None</td></tr>
298 </table>
299
300 <a NAME="PdfView.__init__" ID="PdfView.__init__"></a>
301 <h4>PdfView (Constructor)</h4>
302 <b>PdfView</b>(<i>parent</i>)
303
304 <p>
305 Constructor
306 </p>
307 <dl>
308
309 <dt><i>parent</i> (QWidget)</dt>
310 <dd>
311 reference to the parent widget
312 </dd>
313 </dl>
314 <a NAME="PdfView.__calculateDocumentLayout" ID="PdfView.__calculateDocumentLayout"></a>
315 <h4>PdfView.__calculateDocumentLayout</h4>
316 <b>__calculateDocumentLayout</b>(<i></i>)
317
318 <p>
319 Private slot to calculate the document layout data.
320 </p>
321 <p>
322 This is a PyQt implementation of the code found in the QPdfView class
323 because it is calculated in a private part and not accessible.
324 </p>
325 <a NAME="PdfView.__calculateDocumentViewport" ID="PdfView.__calculateDocumentViewport"></a>
326 <h4>PdfView.__calculateDocumentViewport</h4>
327 <b>__calculateDocumentViewport</b>(<i></i>)
328
329 <p>
330 Private method to calculate the document viewport.
331 </p>
332 <p>
333 This is a PyQt implementation of the code found in the QPdfView class
334 because it is calculated in a private part and not accessible.
335 </p>
336 <a NAME="PdfView.__calculateMarkerGeometries" ID="PdfView.__calculateMarkerGeometries"></a>
337 <h4>PdfView.__calculateMarkerGeometries</h4>
338 <b>__calculateMarkerGeometries</b>(<i>page, offset</i>)
339
340 <p>
341 Private method to calculate the marker geometries.
342 </p>
343 <dl>
344
345 <dt><i>page</i> (int)</dt>
346 <dd>
347 page number
348 </dd>
349 <dt><i>offset</i> (QPoint or QPointF)</dt>
350 <dd>
351 page offset
352 </dd>
353 </dl>
354 <a NAME="PdfView.__currentPageChanged" ID="PdfView.__currentPageChanged"></a>
355 <h4>PdfView.__currentPageChanged</h4>
356 <b>__currentPageChanged</b>(<i></i>)
357
358 <p>
359 Private slot to handle a change of the current page.
360 </p>
361 <a NAME="PdfView.__updateView" ID="PdfView.__updateView"></a>
362 <h4>PdfView.__updateView</h4>
363 <b>__updateView</b>(<i></i>)
364
365 <p>
366 Private method to update the view.
367 </p>
368 <a NAME="PdfView.__zoomFactorForMode" ID="PdfView.__zoomFactorForMode"></a>
369 <h4>PdfView.__zoomFactorForMode</h4>
370 <b>__zoomFactorForMode</b>(<i>zoomMode</i>)
371
372 <p>
373 Private method to calculate the zoom factor iaw. the current zoom mode.
374 </p>
375 <dl>
376
377 <dt><i>zoomMode</i> (QPdfView.ZoomMode)</dt>
378 <dd>
379 zoom mode to get the zoom factor for
380 </dd>
381 </dl>
382 <dl>
383 <dt>Return:</dt>
384 <dd>
385 zoom factor
386 </dd>
387 </dl>
388 <dl>
389 <dt>Return Type:</dt>
390 <dd>
391 float
392 </dd>
393 </dl>
394 <a NAME="PdfView.__zoomInOut" ID="PdfView.__zoomInOut"></a>
395 <h4>PdfView.__zoomInOut</h4>
396 <b>__zoomInOut</b>(<i>zoomIn</i>)
397
398 <p>
399 Private method to zoom into or out of the view.
400 </p>
401 <dl>
402
403 <dt><i>zoomIn</i> (bool)</dt>
404 <dd>
405 flag indicating to zoom into the view
406 </dd>
407 </dl>
408 <a NAME="PdfView.addMarker" ID="PdfView.addMarker"></a>
409 <h4>PdfView.addMarker</h4>
410 <b>addMarker</b>(<i>page, rect, markerType</i>)
411
412 <p>
413 Public slot to add a marker.
414 </p>
415 <dl>
416
417 <dt><i>page</i> (int)</dt>
418 <dd>
419 page number for the marker
420 </dd>
421 <dt><i>rect</i> (QRect or QRectF)</dt>
422 <dd>
423 marker rectangle
424 </dd>
425 <dt><i>markerType</i> (PdfMarkerType)</dt>
426 <dd>
427 type of the marker
428 </dd>
429 </dl>
430 <a NAME="PdfView.addSearchMarker" ID="PdfView.addSearchMarker"></a>
431 <h4>PdfView.addSearchMarker</h4>
432 <b>addSearchMarker</b>(<i>link</i>)
433
434 <p>
435 Public slot to add a search marker given a PDF link.
436 </p>
437 <dl>
438
439 <dt><i>link</i> (QPdfLink)</dt>
440 <dd>
441 reference to the PDF link object
442 </dd>
443 </dl>
444 <a NAME="PdfView.clearAllMarkers" ID="PdfView.clearAllMarkers"></a>
445 <h4>PdfView.clearAllMarkers</h4>
446 <b>clearAllMarkers</b>(<i></i>)
447
448 <p>
449 Public slot to clear all markers.
450 </p>
451 <a NAME="PdfView.clearMarkers" ID="PdfView.clearMarkers"></a>
452 <h4>PdfView.clearMarkers</h4>
453 <b>clearMarkers</b>(<i>markerType</i>)
454
455 <p>
456 Public slot to clear the markers of a specific type.
457 </p>
458 <dl>
459
460 <dt><i>markerType</i> (PdfMarkerType)</dt>
461 <dd>
462 type of the marker
463 </dd>
464 </dl>
465 <a NAME="PdfView.clearSearchMarkers" ID="PdfView.clearSearchMarkers"></a>
466 <h4>PdfView.clearSearchMarkers</h4>
467 <b>clearSearchMarkers</b>(<i></i>)
468
469 <p>
470 Public slot to clear the search markers.
471 </p>
472 <a NAME="PdfView.clearSelection" ID="PdfView.clearSelection"></a>
473 <h4>PdfView.clearSelection</h4>
474 <b>clearSelection</b>(<i></i>)
475
476 <p>
477 Public slot to clear the current selection.
478 </p>
479 <a NAME="PdfView.event" ID="PdfView.event"></a>
480 <h4>PdfView.event</h4>
481 <b>event</b>(<i>evt</i>)
482
483 <p>
484 Public method handling events.
485 </p>
486 <dl>
487
488 <dt><i>evt</i> (QEvent)</dt>
489 <dd>
490 reference to the event
491 </dd>
492 </dl>
493 <dl>
494 <dt>Return:</dt>
495 <dd>
496 flag indicating, if the event was handled
497 </dd>
498 </dl>
499 <dl>
500 <dt>Return Type:</dt>
501 <dd>
502 bool
503 </dd>
504 </dl>
505 <a NAME="PdfView.gestureEvent" ID="PdfView.gestureEvent"></a>
506 <h4>PdfView.gestureEvent</h4>
507 <b>gestureEvent</b>(<i>evt</i>)
508
509 <p>
510 Protected method handling gesture events.
511 </p>
512 <dl>
513
514 <dt><i>evt</i> (QGestureEvent)</dt>
515 <dd>
516 reference to the gesture event
517 </dd>
518 </dl>
519 <a NAME="PdfView.getSelection" ID="PdfView.getSelection"></a>
520 <h4>PdfView.getSelection</h4>
521 <b>getSelection</b>(<i></i>)
522
523 <p>
524 Public method to get a PDF selection object.
525 </p>
526 <dl>
527 <dt>Return:</dt>
528 <dd>
529 reference to the PDF selection object
530 </dd>
531 </dl>
532 <dl>
533 <dt>Return Type:</dt>
534 <dd>
535 QPdfSelection
536 </dd>
537 </dl>
538 <a NAME="PdfView.hasSelection" ID="PdfView.hasSelection"></a>
539 <h4>PdfView.hasSelection</h4>
540 <b>hasSelection</b>(<i></i>)
541
542 <p>
543 Public method to check the presence of a selection.
544 </p>
545 <dl>
546 <dt>Return:</dt>
547 <dd>
548 flag indicating the presence of a selection
549 </dd>
550 </dl>
551 <dl>
552 <dt>Return Type:</dt>
553 <dd>
554 bool
555 </dd>
556 </dl>
557 <a NAME="PdfView.keyPressEvent" ID="PdfView.keyPressEvent"></a>
558 <h4>PdfView.keyPressEvent</h4>
559 <b>keyPressEvent</b>(<i>evt</i>)
560
561 <p>
562 Protected method handling key press events.
563 </p>
564 <dl>
565
566 <dt><i>evt</i> (QKeyEvent)</dt>
567 <dd>
568 reference to the key event
569 </dd>
570 </dl>
571 <a NAME="PdfView.mouseMoveEvent" ID="PdfView.mouseMoveEvent"></a>
572 <h4>PdfView.mouseMoveEvent</h4>
573 <b>mouseMoveEvent</b>(<i>evt</i>)
574
575 <p>
576 Protected method to handle mouse move events.
577 </p>
578 <dl>
579
580 <dt><i>evt</i> (QMouseEvent)</dt>
581 <dd>
582 reference to the mouse event
583 </dd>
584 </dl>
585 <a NAME="PdfView.mousePressEvent" ID="PdfView.mousePressEvent"></a>
586 <h4>PdfView.mousePressEvent</h4>
587 <b>mousePressEvent</b>(<i>evt</i>)
588
589 <p>
590 Protected method to handle mouse press events.
591 </p>
592 <dl>
593
594 <dt><i>evt</i> (QMouseEvent)</dt>
595 <dd>
596 reference to the mouse event
597 </dd>
598 </dl>
599 <a NAME="PdfView.mouseReleaseEvent" ID="PdfView.mouseReleaseEvent"></a>
600 <h4>PdfView.mouseReleaseEvent</h4>
601 <b>mouseReleaseEvent</b>(<i>evt</i>)
602
603 <p>
604 Protected method to handle mouse release events.
605 </p>
606 <dl>
607
608 <dt><i>evt</i> (QMouseEvent)</dt>
609 <dd>
610 reference to the mouse event
611 </dd>
612 </dl>
613 <a NAME="PdfView.paintEvent" ID="PdfView.paintEvent"></a>
614 <h4>PdfView.paintEvent</h4>
615 <b>paintEvent</b>(<i>evt</i>)
616
617 <p>
618 Protected method to paint the view.
619 </p>
620 <p>
621 This event handler calls the original paint event handler of the super class
622 and paints the markers on top of the result.
623 </p>
624 <dl>
625
626 <dt><i>evt</i> (QPaintEvent)</dt>
627 <dd>
628 reference to the paint event
629 </dd>
630 </dl>
631 <a NAME="PdfView.resizeEvent" ID="PdfView.resizeEvent"></a>
632 <h4>PdfView.resizeEvent</h4>
633 <b>resizeEvent</b>(<i>evt</i>)
634
635 <p>
636 Protected method to handle a widget resize.
637 </p>
638 <dl>
639
640 <dt><i>evt</i> (QResizeEvent)</dt>
641 <dd>
642 reference to the resize event
643 </dd>
644 </dl>
645 <a NAME="PdfView.scrollContentsBy" ID="PdfView.scrollContentsBy"></a>
646 <h4>PdfView.scrollContentsBy</h4>
647 <b>scrollContentsBy</b>(<i>dx, dy</i>)
648
649 <p>
650 Public method called when the scrollbars are moved.
651 </p>
652 <dl>
653
654 <dt><i>dx</i> (int)</dt>
655 <dd>
656 change of the horizontal scroll bar
657 </dd>
658 <dt><i>dy</i> (int)</dt>
659 <dd>
660 change of the vertical scroll bar
661 </dd>
662 </dl>
663 <a NAME="PdfView.setDocument" ID="PdfView.setDocument"></a>
664 <h4>PdfView.setDocument</h4>
665 <b>setDocument</b>(<i>document</i>)
666
667 <p>
668 Public method to set the PDF document.
669 </p>
670 <dl>
671
672 <dt><i>document</i> (QPdfDocument)</dt>
673 <dd>
674 reference to the PDF document object
675 </dd>
676 </dl>
677 <a NAME="PdfView.wheelEvent" ID="PdfView.wheelEvent"></a>
678 <h4>PdfView.wheelEvent</h4>
679 <b>wheelEvent</b>(<i>evt</i>)
680
681 <p>
682 Protected method to handle wheel events.
683 </p>
684 <dl>
685
686 <dt><i>evt</i> (QWheelEvent)</dt>
687 <dd>
688 reference to the wheel event
689 </dd>
690 </dl>
691 <a NAME="PdfView.zoomIn" ID="PdfView.zoomIn"></a>
692 <h4>PdfView.zoomIn</h4>
693 <b>zoomIn</b>(<i></i>)
694
695 <p>
696 Public slot to zoom into the view.
697 </p>
698 <a NAME="PdfView.zoomOut" ID="PdfView.zoomOut"></a>
699 <h4>PdfView.zoomOut</h4>
700 <b>zoomOut</b>(<i></i>)
701
702 <p>
703 Public slot to zoom out of the view.
704 </p>
705 <a NAME="PdfView.zoomReset" ID="PdfView.zoomReset"></a>
706 <h4>PdfView.zoomReset</h4>
707 <b>zoomReset</b>(<i></i>)
708
709 <p>
710 Public slot to reset the zoom factor of the view.
711 </p>
712 <div align="right"><a href="#top">Up</a></div>
713 <hr />
714 </body></html>

eric ide

mercurial