|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.SpeedDial.SpeedDial</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.WebBrowser.SpeedDial.SpeedDial</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the speed dial. |
|
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="#SpeedDial">SpeedDial</a></td> |
|
25 <td>Class implementing the speed dial.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="SpeedDial" ID="SpeedDial"></a> |
|
36 <h2>SpeedDial</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the speed dial. |
|
40 </p> |
|
41 <h3>Signals</h3> |
|
42 <dl> |
|
43 |
|
44 <dt>pageTitleLoaded(url, title)</dt> |
|
45 <dd> |
|
46 emitted after a title was loaded |
|
47 </dd> |
|
48 <dt>pagesChanged()</dt> |
|
49 <dd> |
|
50 emitted after the list of pages changed |
|
51 </dd> |
|
52 <dt>speedDialSaved()</dt> |
|
53 <dd> |
|
54 emitted after the speed dial data was saved |
|
55 </dd> |
|
56 <dt>thumbnailLoaded(url, src)</dt> |
|
57 <dd> |
|
58 emitted after a thumbnail was loaded |
|
59 </dd> |
|
60 </dl> |
|
61 <h3>Derived from</h3> |
|
62 QObject |
|
63 <h3>Class Attributes</h3> |
|
64 |
|
65 <table> |
|
66 <tr><td>None</td></tr> |
|
67 </table> |
|
68 <h3>Class Methods</h3> |
|
69 |
|
70 <table> |
|
71 <tr><td>None</td></tr> |
|
72 </table> |
|
73 <h3>Methods</h3> |
|
74 |
|
75 <table> |
|
76 |
|
77 <tr> |
|
78 <td><a href="#SpeedDial.__init__">SpeedDial</a></td> |
|
79 <td>Constructor</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#SpeedDial.__escapeTitle">__escapeTitle</a></td> |
|
83 <td>Private method to escape a title string.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#SpeedDial.__escapeUrl">__escapeUrl</a></td> |
|
87 <td>Private method to escape an URL string.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#SpeedDial.__imageFileName">__imageFileName</a></td> |
|
91 <td>Private method to generate the image file name for a URL.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#SpeedDial.__initialize">__initialize</a></td> |
|
95 <td>Private method to initialize the speed dial.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#SpeedDial.__load">__load</a></td> |
|
99 <td>Private method to load the speed dial configuration.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#SpeedDial.__thumbnailCreated">__thumbnailCreated</a></td> |
|
103 <td>Private slot to handle the creation of a thumbnail image.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#SpeedDial.addPage">addPage</a></td> |
|
107 <td>Public method to add a page for the given data.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#SpeedDial.changed">changed</a></td> |
|
111 <td>Public slot to react on changed pages.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#SpeedDial.close">close</a></td> |
|
115 <td>Public method to close the user agents manager.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#SpeedDial.getFileName">getFileName</a></td> |
|
119 <td>Public method to get the file name of the user agents file.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#SpeedDial.initialScript">initialScript</a></td> |
|
123 <td>Public method to get the 'initial' JavaScript script.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#SpeedDial.loadThumbnail">loadThumbnail</a></td> |
|
127 <td>Public slot to load a thumbnail of the given URL.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#SpeedDial.pageForUrl">pageForUrl</a></td> |
|
131 <td>Public method to get the page for the given URL.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#SpeedDial.pagesInRow">pagesInRow</a></td> |
|
135 <td>Public method to get the number of dials per row.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#SpeedDial.reload">reload</a></td> |
|
139 <td>Public method to reload the speed dial data.</td> |
|
140 </tr> |
|
141 <tr> |
|
142 <td><a href="#SpeedDial.removeImageForUrl">removeImageForUrl</a></td> |
|
143 <td>Public slot to remove the image for a URL.</td> |
|
144 </tr> |
|
145 <tr> |
|
146 <td><a href="#SpeedDial.removePage">removePage</a></td> |
|
147 <td>Public method to remove a page.</td> |
|
148 </tr> |
|
149 <tr> |
|
150 <td><a href="#SpeedDial.resetDials">resetDials</a></td> |
|
151 <td>Public method to reset the speed dials to the default values.</td> |
|
152 </tr> |
|
153 <tr> |
|
154 <td><a href="#SpeedDial.save">save</a></td> |
|
155 <td>Public method to save the speed dial configuration.</td> |
|
156 </tr> |
|
157 <tr> |
|
158 <td><a href="#SpeedDial.sdSize">sdSize</a></td> |
|
159 <td>Public method to get the speed dial size.</td> |
|
160 </tr> |
|
161 <tr> |
|
162 <td><a href="#SpeedDial.setPagesInRow">setPagesInRow</a></td> |
|
163 <td>Public slot to set the number of pages per row.</td> |
|
164 </tr> |
|
165 <tr> |
|
166 <td><a href="#SpeedDial.setSdSize">setSdSize</a></td> |
|
167 <td>Public slot to set the size of the speed dial.</td> |
|
168 </tr> |
|
169 <tr> |
|
170 <td><a href="#SpeedDial.urlForShortcut">urlForShortcut</a></td> |
|
171 <td>Public method to get the URL for the given shortcut key.</td> |
|
172 </tr> |
|
173 <tr> |
|
174 <td><a href="#SpeedDial.urlFromUserInput">urlFromUserInput</a></td> |
|
175 <td>Public slot to get the URL from user input.</td> |
|
176 </tr> |
|
177 </table> |
|
178 <h3>Static Methods</h3> |
|
179 |
|
180 <table> |
|
181 <tr><td>None</td></tr> |
|
182 </table> |
|
183 |
|
184 <a NAME="SpeedDial.__init__" ID="SpeedDial.__init__"></a> |
|
185 <h4>SpeedDial (Constructor)</h4> |
|
186 <b>SpeedDial</b>(<i>parent=None</i>) |
|
187 |
|
188 <p> |
|
189 Constructor |
|
190 </p> |
|
191 <dl> |
|
192 |
|
193 <dt><i>parent</i></dt> |
|
194 <dd> |
|
195 reference to the parent object (QObject) |
|
196 </dd> |
|
197 </dl> |
|
198 <a NAME="SpeedDial.__escapeTitle" ID="SpeedDial.__escapeTitle"></a> |
|
199 <h4>SpeedDial.__escapeTitle</h4> |
|
200 <b>__escapeTitle</b>(<i>title</i>) |
|
201 |
|
202 <p> |
|
203 Private method to escape a title string. |
|
204 </p> |
|
205 <dl> |
|
206 |
|
207 <dt><i>title</i> (str)</dt> |
|
208 <dd> |
|
209 title string to be escaped |
|
210 </dd> |
|
211 </dl> |
|
212 <dl> |
|
213 <dt>Return:</dt> |
|
214 <dd> |
|
215 escaped title string |
|
216 </dd> |
|
217 </dl> |
|
218 <dl> |
|
219 <dt>Return Type:</dt> |
|
220 <dd> |
|
221 str |
|
222 </dd> |
|
223 </dl> |
|
224 <a NAME="SpeedDial.__escapeUrl" ID="SpeedDial.__escapeUrl"></a> |
|
225 <h4>SpeedDial.__escapeUrl</h4> |
|
226 <b>__escapeUrl</b>(<i>url</i>) |
|
227 |
|
228 <p> |
|
229 Private method to escape an URL string. |
|
230 </p> |
|
231 <dl> |
|
232 |
|
233 <dt><i>url</i> (str)</dt> |
|
234 <dd> |
|
235 URL to be escaped |
|
236 </dd> |
|
237 </dl> |
|
238 <dl> |
|
239 <dt>Return:</dt> |
|
240 <dd> |
|
241 escaped URL string |
|
242 </dd> |
|
243 </dl> |
|
244 <dl> |
|
245 <dt>Return Type:</dt> |
|
246 <dd> |
|
247 str |
|
248 </dd> |
|
249 </dl> |
|
250 <a NAME="SpeedDial.__imageFileName" ID="SpeedDial.__imageFileName"></a> |
|
251 <h4>SpeedDial.__imageFileName</h4> |
|
252 <b>__imageFileName</b>(<i>url</i>) |
|
253 |
|
254 <p> |
|
255 Private method to generate the image file name for a URL. |
|
256 </p> |
|
257 <dl> |
|
258 |
|
259 <dt><i>url</i></dt> |
|
260 <dd> |
|
261 URL to generate the file name from (string) |
|
262 </dd> |
|
263 </dl> |
|
264 <dl> |
|
265 <dt>Return:</dt> |
|
266 <dd> |
|
267 name of the image file (string) |
|
268 </dd> |
|
269 </dl> |
|
270 <a NAME="SpeedDial.__initialize" ID="SpeedDial.__initialize"></a> |
|
271 <h4>SpeedDial.__initialize</h4> |
|
272 <b>__initialize</b>(<i></i>) |
|
273 |
|
274 <p> |
|
275 Private method to initialize the speed dial. |
|
276 </p> |
|
277 <a NAME="SpeedDial.__load" ID="SpeedDial.__load"></a> |
|
278 <h4>SpeedDial.__load</h4> |
|
279 <b>__load</b>(<i></i>) |
|
280 |
|
281 <p> |
|
282 Private method to load the speed dial configuration. |
|
283 </p> |
|
284 <a NAME="SpeedDial.__thumbnailCreated" ID="SpeedDial.__thumbnailCreated"></a> |
|
285 <h4>SpeedDial.__thumbnailCreated</h4> |
|
286 <b>__thumbnailCreated</b>(<i>image, thumbnailer</i>) |
|
287 |
|
288 <p> |
|
289 Private slot to handle the creation of a thumbnail image. |
|
290 </p> |
|
291 <dl> |
|
292 |
|
293 <dt><i>image</i> (QPixmap)</dt> |
|
294 <dd> |
|
295 thumbnail image |
|
296 </dd> |
|
297 <dt><i>thumbnailer</i> (PageThumbnailer)</dt> |
|
298 <dd> |
|
299 reference to the page thumbnailer |
|
300 </dd> |
|
301 </dl> |
|
302 <a NAME="SpeedDial.addPage" ID="SpeedDial.addPage"></a> |
|
303 <h4>SpeedDial.addPage</h4> |
|
304 <b>addPage</b>(<i>url, title</i>) |
|
305 |
|
306 <p> |
|
307 Public method to add a page for the given data. |
|
308 </p> |
|
309 <dl> |
|
310 |
|
311 <dt><i>url</i></dt> |
|
312 <dd> |
|
313 URL of the page (QUrl) |
|
314 </dd> |
|
315 <dt><i>title</i></dt> |
|
316 <dd> |
|
317 title of the page (string) |
|
318 </dd> |
|
319 </dl> |
|
320 <a NAME="SpeedDial.changed" ID="SpeedDial.changed"></a> |
|
321 <h4>SpeedDial.changed</h4> |
|
322 <b>changed</b>(<i>allPages</i>) |
|
323 |
|
324 <p> |
|
325 Public slot to react on changed pages. |
|
326 </p> |
|
327 <dl> |
|
328 |
|
329 <dt><i>allPages</i></dt> |
|
330 <dd> |
|
331 string giving all pages (string) |
|
332 </dd> |
|
333 </dl> |
|
334 <a NAME="SpeedDial.close" ID="SpeedDial.close"></a> |
|
335 <h4>SpeedDial.close</h4> |
|
336 <b>close</b>(<i></i>) |
|
337 |
|
338 <p> |
|
339 Public method to close the user agents manager. |
|
340 </p> |
|
341 <a NAME="SpeedDial.getFileName" ID="SpeedDial.getFileName"></a> |
|
342 <h4>SpeedDial.getFileName</h4> |
|
343 <b>getFileName</b>(<i></i>) |
|
344 |
|
345 <p> |
|
346 Public method to get the file name of the user agents file. |
|
347 </p> |
|
348 <dl> |
|
349 <dt>Return:</dt> |
|
350 <dd> |
|
351 name of the user agents file (string) |
|
352 </dd> |
|
353 </dl> |
|
354 <a NAME="SpeedDial.initialScript" ID="SpeedDial.initialScript"></a> |
|
355 <h4>SpeedDial.initialScript</h4> |
|
356 <b>initialScript</b>(<i></i>) |
|
357 |
|
358 <p> |
|
359 Public method to get the 'initial' JavaScript script. |
|
360 </p> |
|
361 <dl> |
|
362 <dt>Return:</dt> |
|
363 <dd> |
|
364 initial JavaScript script (string) |
|
365 </dd> |
|
366 </dl> |
|
367 <a NAME="SpeedDial.loadThumbnail" ID="SpeedDial.loadThumbnail"></a> |
|
368 <h4>SpeedDial.loadThumbnail</h4> |
|
369 <b>loadThumbnail</b>(<i>url, loadTitle</i>) |
|
370 |
|
371 <p> |
|
372 Public slot to load a thumbnail of the given URL. |
|
373 </p> |
|
374 <dl> |
|
375 |
|
376 <dt><i>url</i></dt> |
|
377 <dd> |
|
378 URL of the thumbnail (string) |
|
379 </dd> |
|
380 <dt><i>loadTitle</i></dt> |
|
381 <dd> |
|
382 flag indicating to get the title for the thumbnail |
|
383 from the site (boolean) |
|
384 </dd> |
|
385 </dl> |
|
386 <a NAME="SpeedDial.pageForUrl" ID="SpeedDial.pageForUrl"></a> |
|
387 <h4>SpeedDial.pageForUrl</h4> |
|
388 <b>pageForUrl</b>(<i>url</i>) |
|
389 |
|
390 <p> |
|
391 Public method to get the page for the given URL. |
|
392 </p> |
|
393 <dl> |
|
394 |
|
395 <dt><i>url</i></dt> |
|
396 <dd> |
|
397 URL to be searched for (QUrl) |
|
398 </dd> |
|
399 </dl> |
|
400 <dl> |
|
401 <dt>Return:</dt> |
|
402 <dd> |
|
403 page for the URL (Page) |
|
404 </dd> |
|
405 </dl> |
|
406 <a NAME="SpeedDial.pagesInRow" ID="SpeedDial.pagesInRow"></a> |
|
407 <h4>SpeedDial.pagesInRow</h4> |
|
408 <b>pagesInRow</b>(<i></i>) |
|
409 |
|
410 <p> |
|
411 Public method to get the number of dials per row. |
|
412 </p> |
|
413 <dl> |
|
414 <dt>Return:</dt> |
|
415 <dd> |
|
416 number of dials per row (integer) |
|
417 </dd> |
|
418 </dl> |
|
419 <a NAME="SpeedDial.reload" ID="SpeedDial.reload"></a> |
|
420 <h4>SpeedDial.reload</h4> |
|
421 <b>reload</b>(<i></i>) |
|
422 |
|
423 <p> |
|
424 Public method to reload the speed dial data. |
|
425 </p> |
|
426 <a NAME="SpeedDial.removeImageForUrl" ID="SpeedDial.removeImageForUrl"></a> |
|
427 <h4>SpeedDial.removeImageForUrl</h4> |
|
428 <b>removeImageForUrl</b>(<i>url</i>) |
|
429 |
|
430 <p> |
|
431 Public slot to remove the image for a URL. |
|
432 </p> |
|
433 <dl> |
|
434 |
|
435 <dt><i>url</i></dt> |
|
436 <dd> |
|
437 URL to remove the image for (string) |
|
438 </dd> |
|
439 </dl> |
|
440 <a NAME="SpeedDial.removePage" ID="SpeedDial.removePage"></a> |
|
441 <h4>SpeedDial.removePage</h4> |
|
442 <b>removePage</b>(<i>url</i>) |
|
443 |
|
444 <p> |
|
445 Public method to remove a page. |
|
446 </p> |
|
447 <dl> |
|
448 |
|
449 <dt><i>url</i></dt> |
|
450 <dd> |
|
451 URL of the page (QUrl) |
|
452 </dd> |
|
453 </dl> |
|
454 <a NAME="SpeedDial.resetDials" ID="SpeedDial.resetDials"></a> |
|
455 <h4>SpeedDial.resetDials</h4> |
|
456 <b>resetDials</b>(<i></i>) |
|
457 |
|
458 <p> |
|
459 Public method to reset the speed dials to the default values. |
|
460 </p> |
|
461 <a NAME="SpeedDial.save" ID="SpeedDial.save"></a> |
|
462 <h4>SpeedDial.save</h4> |
|
463 <b>save</b>(<i></i>) |
|
464 |
|
465 <p> |
|
466 Public method to save the speed dial configuration. |
|
467 </p> |
|
468 <a NAME="SpeedDial.sdSize" ID="SpeedDial.sdSize"></a> |
|
469 <h4>SpeedDial.sdSize</h4> |
|
470 <b>sdSize</b>(<i></i>) |
|
471 |
|
472 <p> |
|
473 Public method to get the speed dial size. |
|
474 </p> |
|
475 <dl> |
|
476 <dt>Return:</dt> |
|
477 <dd> |
|
478 speed dial size (integer) |
|
479 </dd> |
|
480 </dl> |
|
481 <a NAME="SpeedDial.setPagesInRow" ID="SpeedDial.setPagesInRow"></a> |
|
482 <h4>SpeedDial.setPagesInRow</h4> |
|
483 <b>setPagesInRow</b>(<i>count</i>) |
|
484 |
|
485 <p> |
|
486 Public slot to set the number of pages per row. |
|
487 </p> |
|
488 <dl> |
|
489 |
|
490 <dt><i>count</i></dt> |
|
491 <dd> |
|
492 number of pages per row (integer) |
|
493 </dd> |
|
494 </dl> |
|
495 <a NAME="SpeedDial.setSdSize" ID="SpeedDial.setSdSize"></a> |
|
496 <h4>SpeedDial.setSdSize</h4> |
|
497 <b>setSdSize</b>(<i>size</i>) |
|
498 |
|
499 <p> |
|
500 Public slot to set the size of the speed dial. |
|
501 </p> |
|
502 <dl> |
|
503 |
|
504 <dt><i>size</i></dt> |
|
505 <dd> |
|
506 size of the speed dial (integer) |
|
507 </dd> |
|
508 </dl> |
|
509 <a NAME="SpeedDial.urlForShortcut" ID="SpeedDial.urlForShortcut"></a> |
|
510 <h4>SpeedDial.urlForShortcut</h4> |
|
511 <b>urlForShortcut</b>(<i>key</i>) |
|
512 |
|
513 <p> |
|
514 Public method to get the URL for the given shortcut key. |
|
515 </p> |
|
516 <dl> |
|
517 |
|
518 <dt><i>key</i></dt> |
|
519 <dd> |
|
520 shortcut key (integer) |
|
521 </dd> |
|
522 </dl> |
|
523 <dl> |
|
524 <dt>Return:</dt> |
|
525 <dd> |
|
526 URL for the key (QUrl) |
|
527 </dd> |
|
528 </dl> |
|
529 <a NAME="SpeedDial.urlFromUserInput" ID="SpeedDial.urlFromUserInput"></a> |
|
530 <h4>SpeedDial.urlFromUserInput</h4> |
|
531 <b>urlFromUserInput</b>(<i>url</i>) |
|
532 |
|
533 <p> |
|
534 Public slot to get the URL from user input. |
|
535 </p> |
|
536 <dl> |
|
537 |
|
538 <dt><i>url</i></dt> |
|
539 <dd> |
|
540 URL entered by the user (string) |
|
541 </dd> |
|
542 </dl> |
|
543 <dl> |
|
544 <dt>Return:</dt> |
|
545 <dd> |
|
546 sanitized URL (string) |
|
547 </dd> |
|
548 </dl> |
|
549 <div align="right"><a href="#top">Up</a></div> |
|
550 <hr /> |
|
551 </body></html> |