|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.NotificationWidget</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.NotificationWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a Notification widget. |
|
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="#NotificationFrame">NotificationFrame</a></td> |
|
25 <td>Class implementing a Notification widget.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#NotificationTypes">NotificationTypes</a></td> |
|
29 <td>Class implementing the notification types.</td> |
|
30 </tr> |
|
31 <tr> |
|
32 <td><a href="#NotificationWidget">NotificationWidget</a></td> |
|
33 <td>Class implementing a Notification list widget.</td> |
|
34 </tr> |
|
35 </table> |
|
36 <h3>Functions</h3> |
|
37 |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /> |
|
42 <hr /> |
|
43 <a NAME="NotificationFrame" ID="NotificationFrame"></a> |
|
44 <h2>NotificationFrame</h2> |
|
45 |
|
46 <p> |
|
47 Class implementing a Notification widget. |
|
48 </p> |
|
49 <h3>Derived from</h3> |
|
50 QFrame, Ui_NotificationFrame |
|
51 <h3>Class Attributes</h3> |
|
52 |
|
53 <table> |
|
54 <tr><td>NotificationStyleSheetTemplate</td></tr> |
|
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 |
|
58 <table> |
|
59 |
|
60 <tr> |
|
61 <td><a href="#NotificationFrame.getIcon">getIcon</a></td> |
|
62 <td>Class method to get the icon for a specific notification kind.</td> |
|
63 </tr> |
|
64 <tr> |
|
65 <td><a href="#NotificationFrame.getStyleSheet">getStyleSheet</a></td> |
|
66 <td>Class method to get a style sheet for specific notification kind.</td> |
|
67 </tr> |
|
68 </table> |
|
69 <h3>Methods</h3> |
|
70 |
|
71 <table> |
|
72 |
|
73 <tr> |
|
74 <td><a href="#NotificationFrame.__init__">NotificationFrame</a></td> |
|
75 <td>Constructor</td> |
|
76 </tr> |
|
77 </table> |
|
78 <h3>Static Methods</h3> |
|
79 |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 |
|
84 <a NAME="NotificationFrame.getIcon" ID="NotificationFrame.getIcon"></a> |
|
85 <h4>NotificationFrame.getIcon (class method)</h4> |
|
86 <b>getIcon</b>(<i>kind</i>) |
|
87 |
|
88 <p> |
|
89 Class method to get the icon for a specific notification kind. |
|
90 </p> |
|
91 <dl> |
|
92 |
|
93 <dt><i>kind</i> (NotificationTypes)</dt> |
|
94 <dd> |
|
95 notification kind |
|
96 </dd> |
|
97 </dl> |
|
98 <dl> |
|
99 <dt>Return:</dt> |
|
100 <dd> |
|
101 icon for the notification kind |
|
102 </dd> |
|
103 </dl> |
|
104 <dl> |
|
105 <dt>Return Type:</dt> |
|
106 <dd> |
|
107 QPixmap |
|
108 </dd> |
|
109 </dl> |
|
110 <a NAME="NotificationFrame.getStyleSheet" ID="NotificationFrame.getStyleSheet"></a> |
|
111 <h4>NotificationFrame.getStyleSheet (class method)</h4> |
|
112 <b>getStyleSheet</b>(<i>kind</i>) |
|
113 |
|
114 <p> |
|
115 Class method to get a style sheet for specific notification kind. |
|
116 </p> |
|
117 <dl> |
|
118 |
|
119 <dt><i>kind</i> (NotificationTypes)</dt> |
|
120 <dd> |
|
121 notification kind |
|
122 </dd> |
|
123 </dl> |
|
124 <dl> |
|
125 <dt>Return:</dt> |
|
126 <dd> |
|
127 string containing the style sheet for the notification kind |
|
128 </dd> |
|
129 </dl> |
|
130 <dl> |
|
131 <dt>Return Type:</dt> |
|
132 <dd> |
|
133 str |
|
134 </dd> |
|
135 </dl> |
|
136 <a NAME="NotificationFrame.__init__" ID="NotificationFrame.__init__"></a> |
|
137 <h4>NotificationFrame (Constructor)</h4> |
|
138 <b>NotificationFrame</b>(<i>icon, heading, text, kind=NotificationTypes.INFORMATION, parent=None</i>) |
|
139 |
|
140 <p> |
|
141 Constructor |
|
142 </p> |
|
143 <dl> |
|
144 |
|
145 <dt><i>icon</i> (QPixmap)</dt> |
|
146 <dd> |
|
147 icon to be used |
|
148 </dd> |
|
149 <dt><i>heading</i> (str)</dt> |
|
150 <dd> |
|
151 heading to be used |
|
152 </dd> |
|
153 <dt><i>text</i> (str)</dt> |
|
154 <dd> |
|
155 text to be used |
|
156 </dd> |
|
157 <dt><i>kind</i> (NotificationTypes)</dt> |
|
158 <dd> |
|
159 kind of notification to be shown |
|
160 </dd> |
|
161 <dt><i>parent</i> (QWidget)</dt> |
|
162 <dd> |
|
163 reference to the parent widget |
|
164 </dd> |
|
165 </dl> |
|
166 <div align="right"><a href="#top">Up</a></div> |
|
167 <hr /> |
|
168 <hr /> |
|
169 <a NAME="NotificationTypes" ID="NotificationTypes"></a> |
|
170 <h2>NotificationTypes</h2> |
|
171 |
|
172 <p> |
|
173 Class implementing the notification types. |
|
174 </p> |
|
175 <h3>Derived from</h3> |
|
176 enum.Enum |
|
177 <h3>Class Attributes</h3> |
|
178 |
|
179 <table> |
|
180 <tr><td>CRITICAL</td></tr><tr><td>INFORMATION</td></tr><tr><td>OTHER</td></tr><tr><td>WARNING</td></tr> |
|
181 </table> |
|
182 <h3>Class Methods</h3> |
|
183 |
|
184 <table> |
|
185 <tr><td>None</td></tr> |
|
186 </table> |
|
187 <h3>Methods</h3> |
|
188 |
|
189 <table> |
|
190 <tr><td>None</td></tr> |
|
191 </table> |
|
192 <h3>Static Methods</h3> |
|
193 |
|
194 <table> |
|
195 <tr><td>None</td></tr> |
|
196 </table> |
|
197 |
|
198 <div align="right"><a href="#top">Up</a></div> |
|
199 <hr /> |
|
200 <hr /> |
|
201 <a NAME="NotificationWidget" ID="NotificationWidget"></a> |
|
202 <h2>NotificationWidget</h2> |
|
203 |
|
204 <p> |
|
205 Class implementing a Notification list widget. |
|
206 </p> |
|
207 <h3>Derived from</h3> |
|
208 QWidget |
|
209 <h3>Class Attributes</h3> |
|
210 |
|
211 <table> |
|
212 <tr><td>None</td></tr> |
|
213 </table> |
|
214 <h3>Class Methods</h3> |
|
215 |
|
216 <table> |
|
217 <tr><td>None</td></tr> |
|
218 </table> |
|
219 <h3>Methods</h3> |
|
220 |
|
221 <table> |
|
222 |
|
223 <tr> |
|
224 <td><a href="#NotificationWidget.__init__">NotificationWidget</a></td> |
|
225 <td>Constructor</td> |
|
226 </tr> |
|
227 <tr> |
|
228 <td><a href="#NotificationWidget.__adjustSizeAndPosition">__adjustSizeAndPosition</a></td> |
|
229 <td>Private slot to adjust the notification list widget size and position.</td> |
|
230 </tr> |
|
231 <tr> |
|
232 <td><a href="#NotificationWidget.__removeNotification">__removeNotification</a></td> |
|
233 <td>Private method to remove a notification from the list.</td> |
|
234 </tr> |
|
235 <tr> |
|
236 <td><a href="#NotificationWidget.mouseMoveEvent">mouseMoveEvent</a></td> |
|
237 <td>Protected method to handle dragging the window.</td> |
|
238 </tr> |
|
239 <tr> |
|
240 <td><a href="#NotificationWidget.mousePressEvent">mousePressEvent</a></td> |
|
241 <td>Protected method to handle presses of a mouse button.</td> |
|
242 </tr> |
|
243 <tr> |
|
244 <td><a href="#NotificationWidget.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
245 <td>Protected method to handle releases of a mouse button.</td> |
|
246 </tr> |
|
247 <tr> |
|
248 <td><a href="#NotificationWidget.showNotification">showNotification</a></td> |
|
249 <td>Public method to show a notification.</td> |
|
250 </tr> |
|
251 </table> |
|
252 <h3>Static Methods</h3> |
|
253 |
|
254 <table> |
|
255 <tr><td>None</td></tr> |
|
256 </table> |
|
257 |
|
258 <a NAME="NotificationWidget.__init__" ID="NotificationWidget.__init__"></a> |
|
259 <h4>NotificationWidget (Constructor)</h4> |
|
260 <b>NotificationWidget</b>(<i>parent=None, setPosition=False</i>) |
|
261 |
|
262 <p> |
|
263 Constructor |
|
264 </p> |
|
265 <dl> |
|
266 |
|
267 <dt><i>parent</i> (QWidget)</dt> |
|
268 <dd> |
|
269 reference to the parent widget |
|
270 </dd> |
|
271 <dt><i>setPosition</i> (bool)</dt> |
|
272 <dd> |
|
273 flag indicating to set the display |
|
274 position interactively |
|
275 </dd> |
|
276 </dl> |
|
277 <a NAME="NotificationWidget.__adjustSizeAndPosition" ID="NotificationWidget.__adjustSizeAndPosition"></a> |
|
278 <h4>NotificationWidget.__adjustSizeAndPosition</h4> |
|
279 <b>__adjustSizeAndPosition</b>(<i></i>) |
|
280 |
|
281 <p> |
|
282 Private slot to adjust the notification list widget size and position. |
|
283 </p> |
|
284 <a NAME="NotificationWidget.__removeNotification" ID="NotificationWidget.__removeNotification"></a> |
|
285 <h4>NotificationWidget.__removeNotification</h4> |
|
286 <b>__removeNotification</b>(<i>notification</i>) |
|
287 |
|
288 <p> |
|
289 Private method to remove a notification from the list. |
|
290 </p> |
|
291 <dl> |
|
292 |
|
293 <dt><i>notification</i> (NotificationFrame)</dt> |
|
294 <dd> |
|
295 reference to the notification to be removed |
|
296 </dd> |
|
297 </dl> |
|
298 <a NAME="NotificationWidget.mouseMoveEvent" ID="NotificationWidget.mouseMoveEvent"></a> |
|
299 <h4>NotificationWidget.mouseMoveEvent</h4> |
|
300 <b>mouseMoveEvent</b>(<i>evt</i>) |
|
301 |
|
302 <p> |
|
303 Protected method to handle dragging the window. |
|
304 </p> |
|
305 <dl> |
|
306 |
|
307 <dt><i>evt</i></dt> |
|
308 <dd> |
|
309 reference to the mouse event (QMouseEvent) |
|
310 </dd> |
|
311 </dl> |
|
312 <a NAME="NotificationWidget.mousePressEvent" ID="NotificationWidget.mousePressEvent"></a> |
|
313 <h4>NotificationWidget.mousePressEvent</h4> |
|
314 <b>mousePressEvent</b>(<i>evt</i>) |
|
315 |
|
316 <p> |
|
317 Protected method to handle presses of a mouse button. |
|
318 </p> |
|
319 <dl> |
|
320 |
|
321 <dt><i>evt</i></dt> |
|
322 <dd> |
|
323 reference to the mouse event (QMouseEvent) |
|
324 </dd> |
|
325 </dl> |
|
326 <a NAME="NotificationWidget.mouseReleaseEvent" ID="NotificationWidget.mouseReleaseEvent"></a> |
|
327 <h4>NotificationWidget.mouseReleaseEvent</h4> |
|
328 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
329 |
|
330 <p> |
|
331 Protected method to handle releases of a mouse button. |
|
332 </p> |
|
333 <dl> |
|
334 |
|
335 <dt><i>evt</i></dt> |
|
336 <dd> |
|
337 reference to the mouse event (QMouseEvent) |
|
338 </dd> |
|
339 </dl> |
|
340 <a NAME="NotificationWidget.showNotification" ID="NotificationWidget.showNotification"></a> |
|
341 <h4>NotificationWidget.showNotification</h4> |
|
342 <b>showNotification</b>(<i>icon, heading, text, kind=NotificationTypes.INFORMATION, timeout=0</i>) |
|
343 |
|
344 <p> |
|
345 Public method to show a notification. |
|
346 </p> |
|
347 <dl> |
|
348 |
|
349 <dt><i>icon</i> (QPixmap)</dt> |
|
350 <dd> |
|
351 icon to be used |
|
352 </dd> |
|
353 <dt><i>heading</i> (str)</dt> |
|
354 <dd> |
|
355 heading to be used |
|
356 </dd> |
|
357 <dt><i>text</i> (str)</dt> |
|
358 <dd> |
|
359 text to be used |
|
360 </dd> |
|
361 <dt><i>kind</i> (NotificationTypes)</dt> |
|
362 <dd> |
|
363 kind of notification to be shown |
|
364 </dd> |
|
365 <dt><i>timeout</i> (int)</dt> |
|
366 <dd> |
|
367 timeout in seconds after which the notification is |
|
368 to be removed (0 = do not remove until it is clicked on) |
|
369 </dd> |
|
370 </dl> |
|
371 <div align="right"><a href="#top">Up</a></div> |
|
372 <hr /> |
|
373 </body></html> |