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