|
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="#DocumentationViewerWidget">DocumentationViewerWidget</a></td> |
|
38 <td>Class implementing a rich text documentation viewer.</td> |
|
39 </tr> |
|
40 </table> |
|
41 <h3>Functions</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <hr /><hr /> |
|
46 <a NAME="CodeDocumentationViewer" ID="CodeDocumentationViewer"></a> |
|
47 <h2>CodeDocumentationViewer</h2> |
|
48 <p> |
|
49 Class implementing a widget to show some source code information provided |
|
50 by plug-ins. |
|
51 </p><h3>Signals</h3> |
|
52 <dl> |
|
53 <dt>providerAdded()</dt> |
|
54 <dd> |
|
55 emitted to indicate the availability of a new |
|
56 provider |
|
57 </dd><dt>providerRemoved()</dt> |
|
58 <dd> |
|
59 emitted to indicate the removal of a provider |
|
60 </dd> |
|
61 </dl> |
|
62 <h3>Derived from</h3> |
|
63 QWidget |
|
64 <h3>Class Attributes</h3> |
|
65 <table> |
|
66 <tr><td>None</td></tr> |
|
67 </table> |
|
68 <h3>Class Methods</h3> |
|
69 <table> |
|
70 <tr><td>None</td></tr> |
|
71 </table> |
|
72 <h3>Methods</h3> |
|
73 <table> |
|
74 <tr> |
|
75 <td><a href="#CodeDocumentationViewer.__init__">CodeDocumentationViewer</a></td> |
|
76 <td>Constructor</td> |
|
77 </tr><tr> |
|
78 <td><a href="#CodeDocumentationViewer.__selectProvider">__selectProvider</a></td> |
|
79 <td>Private method to select a provider programmatically.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#CodeDocumentationViewer.__setupUi">__setupUi</a></td> |
|
82 <td>Private method to generate the UI layout.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#CodeDocumentationViewer.__showDisabledMessage">__showDisabledMessage</a></td> |
|
85 <td>Private method to show a message giving the reason for being disabled.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#CodeDocumentationViewer.__unregisterTimerTimeout">__unregisterTimerTimeout</a></td> |
|
88 <td>Private slot handling the timeout signal of the unregister timer.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#CodeDocumentationViewer.documentationReady">documentationReady</a></td> |
|
91 <td>Public method to provide the documentation info to the viewer.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#CodeDocumentationViewer.finalizeSetup">finalizeSetup</a></td> |
|
94 <td>Public method to finalize the setup of the documentation viewer.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#CodeDocumentationViewer.getProviders">getProviders</a></td> |
|
97 <td>Public method to get a list of providers and their visible strings.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#CodeDocumentationViewer.isSupportedLanguage">isSupportedLanguage</a></td> |
|
100 <td>Public method to check, if the given language is supported by the selected provider.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#CodeDocumentationViewer.on_providerComboBox_currentIndexChanged">on_providerComboBox_currentIndexChanged</a></td> |
|
103 <td>Private slot to handle the selection of a provider.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#CodeDocumentationViewer.preferencesChanged">preferencesChanged</a></td> |
|
106 <td>Public slot to handle a change of preferences.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#CodeDocumentationViewer.registerProvider">registerProvider</a></td> |
|
109 <td>Public method register a source docu provider.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#CodeDocumentationViewer.showInfo">showInfo</a></td> |
|
112 <td>Public method to request code documentation data from a provider.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#CodeDocumentationViewer.shutdown">shutdown</a></td> |
|
115 <td>Public method to perform shutdown actions.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#CodeDocumentationViewer.unregisterProvider">unregisterProvider</a></td> |
|
118 <td>Public method register a source docu provider.</td> |
|
119 </tr> |
|
120 </table> |
|
121 <h3>Static Methods</h3> |
|
122 <table> |
|
123 <tr><td>None</td></tr> |
|
124 </table> |
|
125 <a NAME="CodeDocumentationViewer.__init__" ID="CodeDocumentationViewer.__init__"></a> |
|
126 <h4>CodeDocumentationViewer (Constructor)</h4> |
|
127 <b>CodeDocumentationViewer</b>(<i>parent=None</i>) |
|
128 <p> |
|
129 Constructor |
|
130 </p><dl> |
|
131 <dt><i>parent</i> (QWidget)</dt> |
|
132 <dd> |
|
133 reference to the parent widget |
|
134 </dd> |
|
135 </dl><a NAME="CodeDocumentationViewer.__selectProvider" ID="CodeDocumentationViewer.__selectProvider"></a> |
|
136 <h4>CodeDocumentationViewer.__selectProvider</h4> |
|
137 <b>__selectProvider</b>(<i>provider</i>) |
|
138 <p> |
|
139 Private method to select a provider programmatically. |
|
140 </p><dl> |
|
141 <dt><i>provider</i> (str)</dt> |
|
142 <dd> |
|
143 name of the provider to be selected |
|
144 </dd> |
|
145 </dl><a NAME="CodeDocumentationViewer.__setupUi" ID="CodeDocumentationViewer.__setupUi"></a> |
|
146 <h4>CodeDocumentationViewer.__setupUi</h4> |
|
147 <b>__setupUi</b>(<i></i>) |
|
148 <p> |
|
149 Private method to generate the UI layout. |
|
150 </p><a NAME="CodeDocumentationViewer.__showDisabledMessage" ID="CodeDocumentationViewer.__showDisabledMessage"></a> |
|
151 <h4>CodeDocumentationViewer.__showDisabledMessage</h4> |
|
152 <b>__showDisabledMessage</b>(<i></i>) |
|
153 <p> |
|
154 Private method to show a message giving the reason for being disabled. |
|
155 </p><a NAME="CodeDocumentationViewer.__unregisterTimerTimeout" ID="CodeDocumentationViewer.__unregisterTimerTimeout"></a> |
|
156 <h4>CodeDocumentationViewer.__unregisterTimerTimeout</h4> |
|
157 <b>__unregisterTimerTimeout</b>(<i></i>) |
|
158 <p> |
|
159 Private slot handling the timeout signal of the unregister timer. |
|
160 </p><a NAME="CodeDocumentationViewer.documentationReady" ID="CodeDocumentationViewer.documentationReady"></a> |
|
161 <h4>CodeDocumentationViewer.documentationReady</h4> |
|
162 <b>documentationReady</b>(<i>documentationInfo, isWarning=False, isDocWarning=False</i>) |
|
163 <p> |
|
164 Public method to provide the documentation info to the viewer. |
|
165 </p><p> |
|
166 If documentationInfo is a dictionary, it should contain these |
|
167 (optional) keys and data: |
|
168 </p><p> |
|
169 name: the name of the inspected object |
|
170 argspec: its arguments specification |
|
171 note: A phrase describing the type of object (function or method) and |
|
172 the module it belongs to. |
|
173 docstring: its documentation string |
|
174 typ: its type information |
|
175 </p><dl> |
|
176 <dt><i>documentationInfo</i> (dict or str)</dt> |
|
177 <dd> |
|
178 dictionary containing the source docu data |
|
179 </dd><dt><i>isWarning</i> (bool)</dt> |
|
180 <dd> |
|
181 flag indicating a warning page |
|
182 </dd><dt><i>isDocWarning</i> (bool)</dt> |
|
183 <dd> |
|
184 flag indicating a documentation warning page |
|
185 </dd> |
|
186 </dl><a NAME="CodeDocumentationViewer.finalizeSetup" ID="CodeDocumentationViewer.finalizeSetup"></a> |
|
187 <h4>CodeDocumentationViewer.finalizeSetup</h4> |
|
188 <b>finalizeSetup</b>(<i></i>) |
|
189 <p> |
|
190 Public method to finalize the setup of the documentation viewer. |
|
191 </p><a NAME="CodeDocumentationViewer.getProviders" ID="CodeDocumentationViewer.getProviders"></a> |
|
192 <h4>CodeDocumentationViewer.getProviders</h4> |
|
193 <b>getProviders</b>(<i></i>) |
|
194 <p> |
|
195 Public method to get a list of providers and their visible strings. |
|
196 </p><dl> |
|
197 <dt>Returns:</dt> |
|
198 <dd> |
|
199 list containing the providers and their visible strings |
|
200 </dd> |
|
201 </dl><dl> |
|
202 <dt>Return Type:</dt> |
|
203 <dd> |
|
204 list of tuple of (str,str) |
|
205 </dd> |
|
206 </dl><a NAME="CodeDocumentationViewer.isSupportedLanguage" ID="CodeDocumentationViewer.isSupportedLanguage"></a> |
|
207 <h4>CodeDocumentationViewer.isSupportedLanguage</h4> |
|
208 <b>isSupportedLanguage</b>(<i>language</i>) |
|
209 <p> |
|
210 Public method to check, if the given language is supported by the |
|
211 selected provider. |
|
212 </p><dl> |
|
213 <dt><i>language</i> (str)</dt> |
|
214 <dd> |
|
215 editor programming language to check |
|
216 </dd> |
|
217 </dl><dl> |
|
218 <dt>Returns:</dt> |
|
219 <dd> |
|
220 flag indicating the support status |
|
221 </dd> |
|
222 </dl><dl> |
|
223 <dt>Return Type:</dt> |
|
224 <dd> |
|
225 bool |
|
226 </dd> |
|
227 </dl><a NAME="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" ID="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged"></a> |
|
228 <h4>CodeDocumentationViewer.on_providerComboBox_currentIndexChanged</h4> |
|
229 <b>on_providerComboBox_currentIndexChanged</b>(<i>index</i>) |
|
230 <p> |
|
231 Private slot to handle the selection of a provider. |
|
232 </p><dl> |
|
233 <dt><i>index</i> (int)</dt> |
|
234 <dd> |
|
235 index of the selected provider |
|
236 </dd> |
|
237 </dl><a NAME="CodeDocumentationViewer.preferencesChanged" ID="CodeDocumentationViewer.preferencesChanged"></a> |
|
238 <h4>CodeDocumentationViewer.preferencesChanged</h4> |
|
239 <b>preferencesChanged</b>(<i></i>) |
|
240 <p> |
|
241 Public slot to handle a change of preferences. |
|
242 </p><a NAME="CodeDocumentationViewer.registerProvider" ID="CodeDocumentationViewer.registerProvider"></a> |
|
243 <h4>CodeDocumentationViewer.registerProvider</h4> |
|
244 <b>registerProvider</b>(<i>providerName, providerDisplay, provider, supported</i>) |
|
245 <p> |
|
246 Public method register a source docu provider. |
|
247 </p><dl> |
|
248 <dt><i>providerName</i> (str)</dt> |
|
249 <dd> |
|
250 name of the provider (must be unique) |
|
251 </dd><dt><i>providerDisplay</i> (str)</dt> |
|
252 <dd> |
|
253 visible name of the provider |
|
254 </dd><dt><i>provider</i> (function(editor))</dt> |
|
255 <dd> |
|
256 function to be called to determine source docu |
|
257 </dd><dt><i>supported</i> (function(language))</dt> |
|
258 <dd> |
|
259 function to be called to determine, if a language is |
|
260 supported |
|
261 </dd> |
|
262 </dl><dl> |
|
263 <dt>Raises <b>KeyError</b>:</dt> |
|
264 <dd> |
|
265 raised if a provider with the given name was |
|
266 already registered |
|
267 </dd> |
|
268 </dl><a NAME="CodeDocumentationViewer.showInfo" ID="CodeDocumentationViewer.showInfo"></a> |
|
269 <h4>CodeDocumentationViewer.showInfo</h4> |
|
270 <b>showInfo</b>(<i>editor</i>) |
|
271 <p> |
|
272 Public method to request code documentation data from a provider. |
|
273 </p><dl> |
|
274 <dt><i>editor</i> (Editor)</dt> |
|
275 <dd> |
|
276 reference to the editor to request code docu for |
|
277 </dd> |
|
278 </dl><a NAME="CodeDocumentationViewer.shutdown" ID="CodeDocumentationViewer.shutdown"></a> |
|
279 <h4>CodeDocumentationViewer.shutdown</h4> |
|
280 <b>shutdown</b>(<i></i>) |
|
281 <p> |
|
282 Public method to perform shutdown actions. |
|
283 </p><a NAME="CodeDocumentationViewer.unregisterProvider" ID="CodeDocumentationViewer.unregisterProvider"></a> |
|
284 <h4>CodeDocumentationViewer.unregisterProvider</h4> |
|
285 <b>unregisterProvider</b>(<i>providerName</i>) |
|
286 <p> |
|
287 Public method register a source docu provider. |
|
288 </p><dl> |
|
289 <dt><i>providerName</i> (str)</dt> |
|
290 <dd> |
|
291 name of the provider (must be unique) |
|
292 </dd> |
|
293 </dl> |
|
294 <div align="right"><a href="#top">Up</a></div> |
|
295 <hr /><hr /> |
|
296 <a NAME="DocumentationViewerWidget" ID="DocumentationViewerWidget"></a> |
|
297 <h2>DocumentationViewerWidget</h2> |
|
298 <p> |
|
299 Class implementing a rich text documentation viewer. |
|
300 </p> |
|
301 <h3>Derived from</h3> |
|
302 QWidget |
|
303 <h3>Class Attributes</h3> |
|
304 <table> |
|
305 <tr><td>None</td></tr> |
|
306 </table> |
|
307 <h3>Class Methods</h3> |
|
308 <table> |
|
309 <tr><td>None</td></tr> |
|
310 </table> |
|
311 <h3>Methods</h3> |
|
312 <table> |
|
313 <tr> |
|
314 <td><a href="#DocumentationViewerWidget.__init__">DocumentationViewerWidget</a></td> |
|
315 <td>Constructor</td> |
|
316 </tr><tr> |
|
317 <td><a href="#DocumentationViewerWidget.__showLink">__showLink</a></td> |
|
318 <td>Private slot to show the hovered link in a tooltip.</td> |
|
319 </tr><tr> |
|
320 <td><a href="#DocumentationViewerWidget.clear">clear</a></td> |
|
321 <td>Public method to clear the shown contents.</td> |
|
322 </tr><tr> |
|
323 <td><a href="#DocumentationViewerWidget.setHtml">setHtml</a></td> |
|
324 <td>Public method to set the HTML text of the widget.</td> |
|
325 </tr> |
|
326 </table> |
|
327 <h3>Static Methods</h3> |
|
328 <table> |
|
329 <tr><td>None</td></tr> |
|
330 </table> |
|
331 <a NAME="DocumentationViewerWidget.__init__" ID="DocumentationViewerWidget.__init__"></a> |
|
332 <h4>DocumentationViewerWidget (Constructor)</h4> |
|
333 <b>DocumentationViewerWidget</b>(<i>parent=None</i>) |
|
334 <p> |
|
335 Constructor |
|
336 </p><dl> |
|
337 <dt><i>parent</i> (QWidget)</dt> |
|
338 <dd> |
|
339 reference to the parent widget |
|
340 </dd> |
|
341 </dl><a NAME="DocumentationViewerWidget.__showLink" ID="DocumentationViewerWidget.__showLink"></a> |
|
342 <h4>DocumentationViewerWidget.__showLink</h4> |
|
343 <b>__showLink</b>(<i>urlStr</i>) |
|
344 <p> |
|
345 Private slot to show the hovered link in a tooltip. |
|
346 </p><dl> |
|
347 <dt><i>urlStr</i> (str)</dt> |
|
348 <dd> |
|
349 hovered URL |
|
350 </dd> |
|
351 </dl><a NAME="DocumentationViewerWidget.clear" ID="DocumentationViewerWidget.clear"></a> |
|
352 <h4>DocumentationViewerWidget.clear</h4> |
|
353 <b>clear</b>(<i></i>) |
|
354 <p> |
|
355 Public method to clear the shown contents. |
|
356 </p><a NAME="DocumentationViewerWidget.setHtml" ID="DocumentationViewerWidget.setHtml"></a> |
|
357 <h4>DocumentationViewerWidget.setHtml</h4> |
|
358 <b>setHtml</b>(<i>html</i>) |
|
359 <p> |
|
360 Public method to set the HTML text of the widget. |
|
361 </p><dl> |
|
362 <dt><i>html</i> (str)</dt> |
|
363 <dd> |
|
364 HTML text to be shown |
|
365 </dd> |
|
366 </dl> |
|
367 <div align="right"><a href="#top">Up</a></div> |
|
368 <hr /> |
|
369 </body></html> |