|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.CodeDocumentationViewer</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.UI.CodeDocumentationViewer</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a widget to show some source code information provided by |
|
27 plug-ins. |
|
28 </p> |
|
29 <h3>Global Attributes</h3> |
|
30 |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <h3>Classes</h3> |
|
35 |
|
36 <table> |
|
37 |
|
38 <tr> |
|
39 <td><a href="#CodeDocumentationViewer">CodeDocumentationViewer</a></td> |
|
40 <td>Class implementing a widget to show some source code information provided by plug-ins.</td> |
|
41 </tr> |
|
42 <tr> |
|
43 <td><a href="#DocumentationViewerWidget">DocumentationViewerWidget</a></td> |
|
44 <td>Class implementing a rich text documentation viewer.</td> |
|
45 </tr> |
|
46 </table> |
|
47 <h3>Functions</h3> |
|
48 |
|
49 <table> |
|
50 <tr><td>None</td></tr> |
|
51 </table> |
|
52 <hr /> |
|
53 <hr /> |
|
54 <a NAME="CodeDocumentationViewer" ID="CodeDocumentationViewer"></a> |
|
55 <h2>CodeDocumentationViewer</h2> |
|
56 |
|
57 <p> |
|
58 Class implementing a widget to show some source code information provided |
|
59 by plug-ins. |
|
60 </p> |
|
61 <h3>Signals</h3> |
|
62 <dl> |
|
63 |
|
64 <dt>providerAdded()</dt> |
|
65 <dd> |
|
66 emitted to indicate the availability of a new |
|
67 provider |
|
68 </dd> |
|
69 <dt>providerRemoved()</dt> |
|
70 <dd> |
|
71 emitted to indicate the removal of a provider |
|
72 </dd> |
|
73 </dl> |
|
74 <h3>Derived from</h3> |
|
75 QWidget |
|
76 <h3>Class Attributes</h3> |
|
77 |
|
78 <table> |
|
79 <tr><td>None</td></tr> |
|
80 </table> |
|
81 <h3>Class Methods</h3> |
|
82 |
|
83 <table> |
|
84 <tr><td>None</td></tr> |
|
85 </table> |
|
86 <h3>Methods</h3> |
|
87 |
|
88 <table> |
|
89 |
|
90 <tr> |
|
91 <td><a href="#CodeDocumentationViewer.__init__">CodeDocumentationViewer</a></td> |
|
92 <td>Constructor</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#CodeDocumentationViewer.__selectProvider">__selectProvider</a></td> |
|
96 <td>Private method to select a provider programmatically.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#CodeDocumentationViewer.__setupUi">__setupUi</a></td> |
|
100 <td>Private method to generate the UI layout.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#CodeDocumentationViewer.__showDisabledMessage">__showDisabledMessage</a></td> |
|
104 <td>Private method to show a message giving the reason for being disabled.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#CodeDocumentationViewer.__unregisterTimerTimeout">__unregisterTimerTimeout</a></td> |
|
108 <td>Private slot handling the timeout signal of the unregister timer.</td> |
|
109 </tr> |
|
110 <tr> |
|
111 <td><a href="#CodeDocumentationViewer.documentationReady">documentationReady</a></td> |
|
112 <td>Public method to provide the documentation info to the viewer.</td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td><a href="#CodeDocumentationViewer.finalizeSetup">finalizeSetup</a></td> |
|
116 <td>Public method to finalize the setup of the documentation viewer.</td> |
|
117 </tr> |
|
118 <tr> |
|
119 <td><a href="#CodeDocumentationViewer.getProviders">getProviders</a></td> |
|
120 <td>Public method to get a list of providers and their visible strings.</td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><a href="#CodeDocumentationViewer.isSupportedLanguage">isSupportedLanguage</a></td> |
|
124 <td>Public method to check, if the given language is supported by the selected provider.</td> |
|
125 </tr> |
|
126 <tr> |
|
127 <td><a href="#CodeDocumentationViewer.on_providerComboBox_currentIndexChanged">on_providerComboBox_currentIndexChanged</a></td> |
|
128 <td>Private slot to handle the selection of a provider.</td> |
|
129 </tr> |
|
130 <tr> |
|
131 <td><a href="#CodeDocumentationViewer.preferencesChanged">preferencesChanged</a></td> |
|
132 <td>Public slot to handle a change of preferences.</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td><a href="#CodeDocumentationViewer.registerProvider">registerProvider</a></td> |
|
136 <td>Public method register a source docu provider.</td> |
|
137 </tr> |
|
138 <tr> |
|
139 <td><a href="#CodeDocumentationViewer.showInfo">showInfo</a></td> |
|
140 <td>Public method to request code documentation data from a provider.</td> |
|
141 </tr> |
|
142 <tr> |
|
143 <td><a href="#CodeDocumentationViewer.shutdown">shutdown</a></td> |
|
144 <td>Public method to perform shutdown actions.</td> |
|
145 </tr> |
|
146 <tr> |
|
147 <td><a href="#CodeDocumentationViewer.unregisterProvider">unregisterProvider</a></td> |
|
148 <td>Public method register a source docu provider.</td> |
|
149 </tr> |
|
150 </table> |
|
151 <h3>Static Methods</h3> |
|
152 |
|
153 <table> |
|
154 <tr><td>None</td></tr> |
|
155 </table> |
|
156 |
|
157 <a NAME="CodeDocumentationViewer.__init__" ID="CodeDocumentationViewer.__init__"></a> |
|
158 <h4>CodeDocumentationViewer (Constructor)</h4> |
|
159 <b>CodeDocumentationViewer</b>(<i>parent=None</i>) |
|
160 |
|
161 <p> |
|
162 Constructor |
|
163 </p> |
|
164 <dl> |
|
165 |
|
166 <dt><i>parent</i> (QWidget)</dt> |
|
167 <dd> |
|
168 reference to the parent widget |
|
169 </dd> |
|
170 </dl> |
|
171 <a NAME="CodeDocumentationViewer.__selectProvider" ID="CodeDocumentationViewer.__selectProvider"></a> |
|
172 <h4>CodeDocumentationViewer.__selectProvider</h4> |
|
173 <b>__selectProvider</b>(<i>provider</i>) |
|
174 |
|
175 <p> |
|
176 Private method to select a provider programmatically. |
|
177 </p> |
|
178 <dl> |
|
179 |
|
180 <dt><i>provider</i> (str)</dt> |
|
181 <dd> |
|
182 name of the provider to be selected |
|
183 </dd> |
|
184 </dl> |
|
185 <a NAME="CodeDocumentationViewer.__setupUi" ID="CodeDocumentationViewer.__setupUi"></a> |
|
186 <h4>CodeDocumentationViewer.__setupUi</h4> |
|
187 <b>__setupUi</b>(<i></i>) |
|
188 |
|
189 <p> |
|
190 Private method to generate the UI layout. |
|
191 </p> |
|
192 <a NAME="CodeDocumentationViewer.__showDisabledMessage" ID="CodeDocumentationViewer.__showDisabledMessage"></a> |
|
193 <h4>CodeDocumentationViewer.__showDisabledMessage</h4> |
|
194 <b>__showDisabledMessage</b>(<i></i>) |
|
195 |
|
196 <p> |
|
197 Private method to show a message giving the reason for being disabled. |
|
198 </p> |
|
199 <a NAME="CodeDocumentationViewer.__unregisterTimerTimeout" ID="CodeDocumentationViewer.__unregisterTimerTimeout"></a> |
|
200 <h4>CodeDocumentationViewer.__unregisterTimerTimeout</h4> |
|
201 <b>__unregisterTimerTimeout</b>(<i></i>) |
|
202 |
|
203 <p> |
|
204 Private slot handling the timeout signal of the unregister timer. |
|
205 </p> |
|
206 <a NAME="CodeDocumentationViewer.documentationReady" ID="CodeDocumentationViewer.documentationReady"></a> |
|
207 <h4>CodeDocumentationViewer.documentationReady</h4> |
|
208 <b>documentationReady</b>(<i>documentationInfo, isWarning=False, isDocWarning=False</i>) |
|
209 |
|
210 <p> |
|
211 Public method to provide the documentation info to the viewer. |
|
212 </p> |
|
213 <p> |
|
214 If documentationInfo is a dictionary, it should contain these |
|
215 (optional) keys and data: |
|
216 </p> |
|
217 <p> |
|
218 name: the name of the inspected object |
|
219 argspec: its arguments specification |
|
220 note: A phrase describing the type of object (function or method) and |
|
221 the module it belongs to. |
|
222 docstring: its documentation string |
|
223 typ: its type information |
|
224 </p> |
|
225 <dl> |
|
226 |
|
227 <dt><i>documentationInfo</i> (dict or str)</dt> |
|
228 <dd> |
|
229 dictionary containing the source docu data |
|
230 </dd> |
|
231 <dt><i>isWarning</i> (bool)</dt> |
|
232 <dd> |
|
233 flag indicating a warning page |
|
234 </dd> |
|
235 <dt><i>isDocWarning</i> (bool)</dt> |
|
236 <dd> |
|
237 flag indicating a documentation warning page |
|
238 </dd> |
|
239 </dl> |
|
240 <a NAME="CodeDocumentationViewer.finalizeSetup" ID="CodeDocumentationViewer.finalizeSetup"></a> |
|
241 <h4>CodeDocumentationViewer.finalizeSetup</h4> |
|
242 <b>finalizeSetup</b>(<i></i>) |
|
243 |
|
244 <p> |
|
245 Public method to finalize the setup of the documentation viewer. |
|
246 </p> |
|
247 <a NAME="CodeDocumentationViewer.getProviders" ID="CodeDocumentationViewer.getProviders"></a> |
|
248 <h4>CodeDocumentationViewer.getProviders</h4> |
|
249 <b>getProviders</b>(<i></i>) |
|
250 |
|
251 <p> |
|
252 Public method to get a list of providers and their visible strings. |
|
253 </p> |
|
254 <dl> |
|
255 <dt>Return:</dt> |
|
256 <dd> |
|
257 list containing the providers and their visible strings |
|
258 </dd> |
|
259 </dl> |
|
260 <dl> |
|
261 <dt>Return Type:</dt> |
|
262 <dd> |
|
263 list of tuple of (str,str) |
|
264 </dd> |
|
265 </dl> |
|
266 <a NAME="CodeDocumentationViewer.isSupportedLanguage" ID="CodeDocumentationViewer.isSupportedLanguage"></a> |
|
267 <h4>CodeDocumentationViewer.isSupportedLanguage</h4> |
|
268 <b>isSupportedLanguage</b>(<i>language</i>) |
|
269 |
|
270 <p> |
|
271 Public method to check, if the given language is supported by the |
|
272 selected provider. |
|
273 </p> |
|
274 <dl> |
|
275 |
|
276 <dt><i>language</i> (str)</dt> |
|
277 <dd> |
|
278 editor programming language to check |
|
279 </dd> |
|
280 </dl> |
|
281 <dl> |
|
282 <dt>Return:</dt> |
|
283 <dd> |
|
284 flag indicating the support status |
|
285 </dd> |
|
286 </dl> |
|
287 <dl> |
|
288 <dt>Return Type:</dt> |
|
289 <dd> |
|
290 bool |
|
291 </dd> |
|
292 </dl> |
|
293 <a NAME="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" ID="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged"></a> |
|
294 <h4>CodeDocumentationViewer.on_providerComboBox_currentIndexChanged</h4> |
|
295 <b>on_providerComboBox_currentIndexChanged</b>(<i>index</i>) |
|
296 |
|
297 <p> |
|
298 Private slot to handle the selection of a provider. |
|
299 </p> |
|
300 <dl> |
|
301 |
|
302 <dt><i>index</i> (int)</dt> |
|
303 <dd> |
|
304 index of the selected provider |
|
305 </dd> |
|
306 </dl> |
|
307 <a NAME="CodeDocumentationViewer.preferencesChanged" ID="CodeDocumentationViewer.preferencesChanged"></a> |
|
308 <h4>CodeDocumentationViewer.preferencesChanged</h4> |
|
309 <b>preferencesChanged</b>(<i></i>) |
|
310 |
|
311 <p> |
|
312 Public slot to handle a change of preferences. |
|
313 </p> |
|
314 <a NAME="CodeDocumentationViewer.registerProvider" ID="CodeDocumentationViewer.registerProvider"></a> |
|
315 <h4>CodeDocumentationViewer.registerProvider</h4> |
|
316 <b>registerProvider</b>(<i>providerName, providerDisplay, provider, supported</i>) |
|
317 |
|
318 <p> |
|
319 Public method register a source docu provider. |
|
320 </p> |
|
321 <dl> |
|
322 |
|
323 <dt><i>providerName</i> (str)</dt> |
|
324 <dd> |
|
325 name of the provider (must be unique) |
|
326 </dd> |
|
327 <dt><i>providerDisplay</i> (str)</dt> |
|
328 <dd> |
|
329 visible name of the provider |
|
330 </dd> |
|
331 <dt><i>provider</i> (function(editor))</dt> |
|
332 <dd> |
|
333 function to be called to determine source docu |
|
334 </dd> |
|
335 <dt><i>supported</i> (function(language))</dt> |
|
336 <dd> |
|
337 function to be called to determine, if a language is |
|
338 supported |
|
339 </dd> |
|
340 </dl> |
|
341 <dl> |
|
342 |
|
343 <dt>Raises <b>KeyError</b>:</dt> |
|
344 <dd> |
|
345 raised if a provider with the given name was |
|
346 already registered |
|
347 </dd> |
|
348 </dl> |
|
349 <a NAME="CodeDocumentationViewer.showInfo" ID="CodeDocumentationViewer.showInfo"></a> |
|
350 <h4>CodeDocumentationViewer.showInfo</h4> |
|
351 <b>showInfo</b>(<i>editor</i>) |
|
352 |
|
353 <p> |
|
354 Public method to request code documentation data from a provider. |
|
355 </p> |
|
356 <dl> |
|
357 |
|
358 <dt><i>editor</i> (Editor)</dt> |
|
359 <dd> |
|
360 reference to the editor to request code docu for |
|
361 </dd> |
|
362 </dl> |
|
363 <a NAME="CodeDocumentationViewer.shutdown" ID="CodeDocumentationViewer.shutdown"></a> |
|
364 <h4>CodeDocumentationViewer.shutdown</h4> |
|
365 <b>shutdown</b>(<i></i>) |
|
366 |
|
367 <p> |
|
368 Public method to perform shutdown actions. |
|
369 </p> |
|
370 <a NAME="CodeDocumentationViewer.unregisterProvider" ID="CodeDocumentationViewer.unregisterProvider"></a> |
|
371 <h4>CodeDocumentationViewer.unregisterProvider</h4> |
|
372 <b>unregisterProvider</b>(<i>providerName</i>) |
|
373 |
|
374 <p> |
|
375 Public method register a source docu provider. |
|
376 </p> |
|
377 <dl> |
|
378 |
|
379 <dt><i>providerName</i> (str)</dt> |
|
380 <dd> |
|
381 name of the provider (must be unique) |
|
382 </dd> |
|
383 </dl> |
|
384 <div align="right"><a href="#top">Up</a></div> |
|
385 <hr /> |
|
386 <hr /> |
|
387 <a NAME="DocumentationViewerWidget" ID="DocumentationViewerWidget"></a> |
|
388 <h2>DocumentationViewerWidget</h2> |
|
389 |
|
390 <p> |
|
391 Class implementing a rich text documentation viewer. |
|
392 </p> |
|
393 <h3>Derived from</h3> |
|
394 QWidget |
|
395 <h3>Class Attributes</h3> |
|
396 |
|
397 <table> |
|
398 <tr><td>EmpytDocument_Dark</td></tr><tr><td>EmpytDocument_Light</td></tr> |
|
399 </table> |
|
400 <h3>Class Methods</h3> |
|
401 |
|
402 <table> |
|
403 <tr><td>None</td></tr> |
|
404 </table> |
|
405 <h3>Methods</h3> |
|
406 |
|
407 <table> |
|
408 |
|
409 <tr> |
|
410 <td><a href="#DocumentationViewerWidget.__init__">DocumentationViewerWidget</a></td> |
|
411 <td>Constructor</td> |
|
412 </tr> |
|
413 <tr> |
|
414 <td><a href="#DocumentationViewerWidget.__showLink">__showLink</a></td> |
|
415 <td>Private slot to show the hovered link in a tooltip.</td> |
|
416 </tr> |
|
417 <tr> |
|
418 <td><a href="#DocumentationViewerWidget.clear">clear</a></td> |
|
419 <td>Public method to clear the shown contents.</td> |
|
420 </tr> |
|
421 <tr> |
|
422 <td><a href="#DocumentationViewerWidget.setHtml">setHtml</a></td> |
|
423 <td>Public method to set the HTML text of the widget.</td> |
|
424 </tr> |
|
425 </table> |
|
426 <h3>Static Methods</h3> |
|
427 |
|
428 <table> |
|
429 <tr><td>None</td></tr> |
|
430 </table> |
|
431 |
|
432 <a NAME="DocumentationViewerWidget.__init__" ID="DocumentationViewerWidget.__init__"></a> |
|
433 <h4>DocumentationViewerWidget (Constructor)</h4> |
|
434 <b>DocumentationViewerWidget</b>(<i>parent=None</i>) |
|
435 |
|
436 <p> |
|
437 Constructor |
|
438 </p> |
|
439 <dl> |
|
440 |
|
441 <dt><i>parent</i> (QWidget)</dt> |
|
442 <dd> |
|
443 reference to the parent widget |
|
444 </dd> |
|
445 </dl> |
|
446 <a NAME="DocumentationViewerWidget.__showLink" ID="DocumentationViewerWidget.__showLink"></a> |
|
447 <h4>DocumentationViewerWidget.__showLink</h4> |
|
448 <b>__showLink</b>(<i>urlStr</i>) |
|
449 |
|
450 <p> |
|
451 Private slot to show the hovered link in a tooltip. |
|
452 </p> |
|
453 <dl> |
|
454 |
|
455 <dt><i>urlStr</i> (str)</dt> |
|
456 <dd> |
|
457 hovered URL |
|
458 </dd> |
|
459 </dl> |
|
460 <a NAME="DocumentationViewerWidget.clear" ID="DocumentationViewerWidget.clear"></a> |
|
461 <h4>DocumentationViewerWidget.clear</h4> |
|
462 <b>clear</b>(<i></i>) |
|
463 |
|
464 <p> |
|
465 Public method to clear the shown contents. |
|
466 </p> |
|
467 <a NAME="DocumentationViewerWidget.setHtml" ID="DocumentationViewerWidget.setHtml"></a> |
|
468 <h4>DocumentationViewerWidget.setHtml</h4> |
|
469 <b>setHtml</b>(<i>html</i>) |
|
470 |
|
471 <p> |
|
472 Public method to set the HTML text of the widget. |
|
473 </p> |
|
474 <dl> |
|
475 |
|
476 <dt><i>html</i> (str)</dt> |
|
477 <dd> |
|
478 HTML text to be shown |
|
479 </dd> |
|
480 </dl> |
|
481 <div align="right"><a href="#top">Up</a></div> |
|
482 <hr /> |
|
483 </body></html> |