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