|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Helpviewer.AdBlock.AdBlockManager</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.Helpviewer.AdBlock.AdBlockManager</h1> |
|
23 <p> |
|
24 Module implementing the AdBlock manager. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#AdBlockManager">AdBlockManager</a></td> |
|
34 <td>Class implementing the AdBlock manager.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="AdBlockManager" ID="AdBlockManager"></a> |
|
43 <h2>AdBlockManager</h2> |
|
44 <p> |
|
45 Class implementing the AdBlock manager. |
|
46 </p><h3>Signals</h3> |
|
47 <dl> |
|
48 <dt>requiredSubscriptionLoaded(subscription)</dt> |
|
49 <dd> |
|
50 emitted to indicate |
|
51 loading of a required subscription is finished (AdBlockSubscription) |
|
52 </dd><dt>rulesChanged()</dt> |
|
53 <dd> |
|
54 emitted after some rule has changed |
|
55 </dd> |
|
56 </dl> |
|
57 <h3>Derived from</h3> |
|
58 QObject |
|
59 <h3>Class Attributes</h3> |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Class Methods</h3> |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 <table> |
|
69 <tr> |
|
70 <td><a href="#AdBlockManager.__init__">AdBlockManager</a></td> |
|
71 <td>Constructor</td> |
|
72 </tr><tr> |
|
73 <td><a href="#AdBlockManager.__customSubscriptionLocation">__customSubscriptionLocation</a></td> |
|
74 <td>Private method to generate the path for custom subscriptions.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#AdBlockManager.__customSubscriptionUrl">__customSubscriptionUrl</a></td> |
|
77 <td>Private method to generate the URL for custom subscriptions.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#AdBlockManager.__loadSubscriptions">__loadSubscriptions</a></td> |
|
80 <td>Private method to load the set of subscriptions.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#AdBlockManager.addException">addException</a></td> |
|
83 <td>Public method to add an exception.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#AdBlockManager.addSubscription">addSubscription</a></td> |
|
86 <td>Public method to add an AdBlock subscription.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#AdBlockManager.close">close</a></td> |
|
89 <td>Public method to close the open search engines manager.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#AdBlockManager.customRules">customRules</a></td> |
|
92 <td>Public method to get a subscription for custom rules.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#AdBlockManager.elementHidingRules">elementHidingRules</a></td> |
|
95 <td>Public method to get the element hiding rules.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#AdBlockManager.elementHidingRulesForDomain">elementHidingRulesForDomain</a></td> |
|
98 <td>Public method to get the element hiding rules for a domain.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#AdBlockManager.exceptions">exceptions</a></td> |
|
101 <td>Public method to get a list of excepted hosts.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#AdBlockManager.getRequiresSubscriptions">getRequiresSubscriptions</a></td> |
|
104 <td>Public method to get a list of subscriptions, that require the given one.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#AdBlockManager.isEnabled">isEnabled</a></td> |
|
107 <td>Public method to check, if blocking ads is enabled.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#AdBlockManager.isHostExcepted">isHostExcepted</a></td> |
|
110 <td>Public slot to check, if a host is excepted.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#AdBlockManager.load">load</a></td> |
|
113 <td>Public method to load the AdBlock subscriptions.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#AdBlockManager.loadRequiredSubscription">loadRequiredSubscription</a></td> |
|
116 <td>Public method to load a subscription required by another one.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#AdBlockManager.network">network</a></td> |
|
119 <td>Public method to get a reference to the network block object.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#AdBlockManager.page">page</a></td> |
|
122 <td>Public method to get a reference to the page block object.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#AdBlockManager.removeException">removeException</a></td> |
|
125 <td>Public method to remove an exception.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#AdBlockManager.removeSubscription">removeSubscription</a></td> |
|
128 <td>Public method to remove an AdBlock subscription.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#AdBlockManager.save">save</a></td> |
|
131 <td>Public method to save the AdBlock subscriptions.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#AdBlockManager.setEnabled">setEnabled</a></td> |
|
134 <td>Public slot to set the enabled state.</td> |
|
135 </tr><tr> |
|
136 <td><a href="#AdBlockManager.setExceptions">setExceptions</a></td> |
|
137 <td>Public method to set the list of excepted hosts.</td> |
|
138 </tr><tr> |
|
139 <td><a href="#AdBlockManager.showDialog">showDialog</a></td> |
|
140 <td>Public slot to show the AdBlock subscription management dialog.</td> |
|
141 </tr><tr> |
|
142 <td><a href="#AdBlockManager.showExceptionsDialog">showExceptionsDialog</a></td> |
|
143 <td>Public method to show the AdBlock Exceptions dialog.</td> |
|
144 </tr><tr> |
|
145 <td><a href="#AdBlockManager.showRule">showRule</a></td> |
|
146 <td>Public slot to show an AdBlock rule.</td> |
|
147 </tr><tr> |
|
148 <td><a href="#AdBlockManager.subscription">subscription</a></td> |
|
149 <td>Public method to get a subscription based on its location.</td> |
|
150 </tr><tr> |
|
151 <td><a href="#AdBlockManager.subscriptions">subscriptions</a></td> |
|
152 <td>Public method to get all subscriptions.</td> |
|
153 </tr><tr> |
|
154 <td><a href="#AdBlockManager.updateAllSubscriptions">updateAllSubscriptions</a></td> |
|
155 <td>Public method to update all subscriptions.</td> |
|
156 </tr> |
|
157 </table> |
|
158 <h3>Static Methods</h3> |
|
159 <table> |
|
160 <tr><td>None</td></tr> |
|
161 </table> |
|
162 <a NAME="AdBlockManager.__init__" ID="AdBlockManager.__init__"></a> |
|
163 <h4>AdBlockManager (Constructor)</h4> |
|
164 <b>AdBlockManager</b>(<i>parent=None</i>) |
|
165 <p> |
|
166 Constructor |
|
167 </p><dl> |
|
168 <dt><i>parent</i></dt> |
|
169 <dd> |
|
170 reference to the parent object (QObject) |
|
171 </dd> |
|
172 </dl><a NAME="AdBlockManager.__customSubscriptionLocation" ID="AdBlockManager.__customSubscriptionLocation"></a> |
|
173 <h4>AdBlockManager.__customSubscriptionLocation</h4> |
|
174 <b>__customSubscriptionLocation</b>(<i></i>) |
|
175 <p> |
|
176 Private method to generate the path for custom subscriptions. |
|
177 </p><dl> |
|
178 <dt>Returns:</dt> |
|
179 <dd> |
|
180 URL for custom subscriptions (QUrl) |
|
181 </dd> |
|
182 </dl><a NAME="AdBlockManager.__customSubscriptionUrl" ID="AdBlockManager.__customSubscriptionUrl"></a> |
|
183 <h4>AdBlockManager.__customSubscriptionUrl</h4> |
|
184 <b>__customSubscriptionUrl</b>(<i></i>) |
|
185 <p> |
|
186 Private method to generate the URL for custom subscriptions. |
|
187 </p><dl> |
|
188 <dt>Returns:</dt> |
|
189 <dd> |
|
190 URL for custom subscriptions (QUrl) |
|
191 </dd> |
|
192 </dl><a NAME="AdBlockManager.__loadSubscriptions" ID="AdBlockManager.__loadSubscriptions"></a> |
|
193 <h4>AdBlockManager.__loadSubscriptions</h4> |
|
194 <b>__loadSubscriptions</b>(<i></i>) |
|
195 <p> |
|
196 Private method to load the set of subscriptions. |
|
197 </p><a NAME="AdBlockManager.addException" ID="AdBlockManager.addException"></a> |
|
198 <h4>AdBlockManager.addException</h4> |
|
199 <b>addException</b>(<i>host</i>) |
|
200 <p> |
|
201 Public method to add an exception. |
|
202 </p><dl> |
|
203 <dt><i>host</i></dt> |
|
204 <dd> |
|
205 to be excepted (string) |
|
206 </dd> |
|
207 </dl><a NAME="AdBlockManager.addSubscription" ID="AdBlockManager.addSubscription"></a> |
|
208 <h4>AdBlockManager.addSubscription</h4> |
|
209 <b>addSubscription</b>(<i>subscription</i>) |
|
210 <p> |
|
211 Public method to add an AdBlock subscription. |
|
212 </p><dl> |
|
213 <dt><i>subscription</i></dt> |
|
214 <dd> |
|
215 AdBlock subscription to be added |
|
216 (AdBlockSubscription) |
|
217 </dd> |
|
218 </dl><a NAME="AdBlockManager.close" ID="AdBlockManager.close"></a> |
|
219 <h4>AdBlockManager.close</h4> |
|
220 <b>close</b>(<i></i>) |
|
221 <p> |
|
222 Public method to close the open search engines manager. |
|
223 </p><a NAME="AdBlockManager.customRules" ID="AdBlockManager.customRules"></a> |
|
224 <h4>AdBlockManager.customRules</h4> |
|
225 <b>customRules</b>(<i></i>) |
|
226 <p> |
|
227 Public method to get a subscription for custom rules. |
|
228 </p><dl> |
|
229 <dt>Returns:</dt> |
|
230 <dd> |
|
231 subscription object for custom rules (AdBlockSubscription) |
|
232 </dd> |
|
233 </dl><a NAME="AdBlockManager.elementHidingRules" ID="AdBlockManager.elementHidingRules"></a> |
|
234 <h4>AdBlockManager.elementHidingRules</h4> |
|
235 <b>elementHidingRules</b>(<i></i>) |
|
236 <p> |
|
237 Public method to get the element hiding rules. |
|
238 </p><dl> |
|
239 <dt>Returns:</dt> |
|
240 <dd> |
|
241 element hiding rules (string) |
|
242 </dd> |
|
243 </dl><a NAME="AdBlockManager.elementHidingRulesForDomain" ID="AdBlockManager.elementHidingRulesForDomain"></a> |
|
244 <h4>AdBlockManager.elementHidingRulesForDomain</h4> |
|
245 <b>elementHidingRulesForDomain</b>(<i>url</i>) |
|
246 <p> |
|
247 Public method to get the element hiding rules for a domain. |
|
248 </p><dl> |
|
249 <dt><i>url</i></dt> |
|
250 <dd> |
|
251 URL to get hiding rules for (QUrl) |
|
252 </dd> |
|
253 </dl><dl> |
|
254 <dt>Returns:</dt> |
|
255 <dd> |
|
256 element hiding rules (string) |
|
257 </dd> |
|
258 </dl><a NAME="AdBlockManager.exceptions" ID="AdBlockManager.exceptions"></a> |
|
259 <h4>AdBlockManager.exceptions</h4> |
|
260 <b>exceptions</b>(<i></i>) |
|
261 <p> |
|
262 Public method to get a list of excepted hosts. |
|
263 </p><dl> |
|
264 <dt>Returns:</dt> |
|
265 <dd> |
|
266 list of excepted hosts (list of string) |
|
267 </dd> |
|
268 </dl><a NAME="AdBlockManager.getRequiresSubscriptions" ID="AdBlockManager.getRequiresSubscriptions"></a> |
|
269 <h4>AdBlockManager.getRequiresSubscriptions</h4> |
|
270 <b>getRequiresSubscriptions</b>(<i>subscription</i>) |
|
271 <p> |
|
272 Public method to get a list of subscriptions, that require the given |
|
273 one. |
|
274 </p><dl> |
|
275 <dt><i>subscription</i></dt> |
|
276 <dd> |
|
277 subscription to check for (AdBlockSubscription) |
|
278 </dd> |
|
279 </dl><dl> |
|
280 <dt>Returns:</dt> |
|
281 <dd> |
|
282 list of subscription requiring the given one (list of |
|
283 AdBlockSubscription) |
|
284 </dd> |
|
285 </dl><a NAME="AdBlockManager.isEnabled" ID="AdBlockManager.isEnabled"></a> |
|
286 <h4>AdBlockManager.isEnabled</h4> |
|
287 <b>isEnabled</b>(<i></i>) |
|
288 <p> |
|
289 Public method to check, if blocking ads is enabled. |
|
290 </p><dl> |
|
291 <dt>Returns:</dt> |
|
292 <dd> |
|
293 flag indicating the enabled state (boolean) |
|
294 </dd> |
|
295 </dl><a NAME="AdBlockManager.isHostExcepted" ID="AdBlockManager.isHostExcepted"></a> |
|
296 <h4>AdBlockManager.isHostExcepted</h4> |
|
297 <b>isHostExcepted</b>(<i>host</i>) |
|
298 <p> |
|
299 Public slot to check, if a host is excepted. |
|
300 </p><dl> |
|
301 <dt><i>host</i></dt> |
|
302 <dd> |
|
303 host to check (string) |
|
304 </dd> |
|
305 </dl><dl> |
|
306 <dt>Returns:</dt> |
|
307 <dd> |
|
308 flag indicating an exception (boolean) |
|
309 </dd> |
|
310 </dl><a NAME="AdBlockManager.load" ID="AdBlockManager.load"></a> |
|
311 <h4>AdBlockManager.load</h4> |
|
312 <b>load</b>(<i></i>) |
|
313 <p> |
|
314 Public method to load the AdBlock subscriptions. |
|
315 </p><a NAME="AdBlockManager.loadRequiredSubscription" ID="AdBlockManager.loadRequiredSubscription"></a> |
|
316 <h4>AdBlockManager.loadRequiredSubscription</h4> |
|
317 <b>loadRequiredSubscription</b>(<i>location, title</i>) |
|
318 <p> |
|
319 Public method to load a subscription required by another one. |
|
320 </p><dl> |
|
321 <dt><i>location</i></dt> |
|
322 <dd> |
|
323 location of the required subscription (string) |
|
324 </dd><dt><i>title</i></dt> |
|
325 <dd> |
|
326 title of the required subscription (string) |
|
327 </dd> |
|
328 </dl><a NAME="AdBlockManager.network" ID="AdBlockManager.network"></a> |
|
329 <h4>AdBlockManager.network</h4> |
|
330 <b>network</b>(<i></i>) |
|
331 <p> |
|
332 Public method to get a reference to the network block object. |
|
333 </p><dl> |
|
334 <dt>Returns:</dt> |
|
335 <dd> |
|
336 reference to the network block object (AdBlockNetwork) |
|
337 </dd> |
|
338 </dl><a NAME="AdBlockManager.page" ID="AdBlockManager.page"></a> |
|
339 <h4>AdBlockManager.page</h4> |
|
340 <b>page</b>(<i></i>) |
|
341 <p> |
|
342 Public method to get a reference to the page block object. |
|
343 </p><dl> |
|
344 <dt>Returns:</dt> |
|
345 <dd> |
|
346 reference to the page block object (AdBlockPage) |
|
347 </dd> |
|
348 </dl><a NAME="AdBlockManager.removeException" ID="AdBlockManager.removeException"></a> |
|
349 <h4>AdBlockManager.removeException</h4> |
|
350 <b>removeException</b>(<i>host</i>) |
|
351 <p> |
|
352 Public method to remove an exception. |
|
353 </p><dl> |
|
354 <dt><i>host</i></dt> |
|
355 <dd> |
|
356 to be removed from the list of exceptions (string) |
|
357 </dd> |
|
358 </dl><a NAME="AdBlockManager.removeSubscription" ID="AdBlockManager.removeSubscription"></a> |
|
359 <h4>AdBlockManager.removeSubscription</h4> |
|
360 <b>removeSubscription</b>(<i>subscription, emitSignal=True</i>) |
|
361 <p> |
|
362 Public method to remove an AdBlock subscription. |
|
363 </p><dl> |
|
364 <dt><i>subscription</i></dt> |
|
365 <dd> |
|
366 AdBlock subscription to be removed |
|
367 (AdBlockSubscription) |
|
368 </dd><dt><i>emitSignal</i></dt> |
|
369 <dd> |
|
370 flag indicating to send a signal (boolean) |
|
371 </dd> |
|
372 </dl><a NAME="AdBlockManager.save" ID="AdBlockManager.save"></a> |
|
373 <h4>AdBlockManager.save</h4> |
|
374 <b>save</b>(<i></i>) |
|
375 <p> |
|
376 Public method to save the AdBlock subscriptions. |
|
377 </p><a NAME="AdBlockManager.setEnabled" ID="AdBlockManager.setEnabled"></a> |
|
378 <h4>AdBlockManager.setEnabled</h4> |
|
379 <b>setEnabled</b>(<i>enabled</i>) |
|
380 <p> |
|
381 Public slot to set the enabled state. |
|
382 </p><dl> |
|
383 <dt><i>enabled</i></dt> |
|
384 <dd> |
|
385 flag indicating the enabled state (boolean) |
|
386 </dd> |
|
387 </dl><a NAME="AdBlockManager.setExceptions" ID="AdBlockManager.setExceptions"></a> |
|
388 <h4>AdBlockManager.setExceptions</h4> |
|
389 <b>setExceptions</b>(<i>hosts</i>) |
|
390 <p> |
|
391 Public method to set the list of excepted hosts. |
|
392 </p><dl> |
|
393 <dt><i>hosts</i></dt> |
|
394 <dd> |
|
395 list of excepted hosts (list of string) |
|
396 </dd> |
|
397 </dl><a NAME="AdBlockManager.showDialog" ID="AdBlockManager.showDialog"></a> |
|
398 <h4>AdBlockManager.showDialog</h4> |
|
399 <b>showDialog</b>(<i></i>) |
|
400 <p> |
|
401 Public slot to show the AdBlock subscription management dialog. |
|
402 </p><dl> |
|
403 <dt>Returns:</dt> |
|
404 <dd> |
|
405 reference to the dialog (AdBlockDialog) |
|
406 </dd> |
|
407 </dl><a NAME="AdBlockManager.showExceptionsDialog" ID="AdBlockManager.showExceptionsDialog"></a> |
|
408 <h4>AdBlockManager.showExceptionsDialog</h4> |
|
409 <b>showExceptionsDialog</b>(<i></i>) |
|
410 <p> |
|
411 Public method to show the AdBlock Exceptions dialog. |
|
412 </p><dl> |
|
413 <dt>Returns:</dt> |
|
414 <dd> |
|
415 reference to the exceptions dialog (AdBlockExceptionsDialog) |
|
416 </dd> |
|
417 </dl><a NAME="AdBlockManager.showRule" ID="AdBlockManager.showRule"></a> |
|
418 <h4>AdBlockManager.showRule</h4> |
|
419 <b>showRule</b>(<i>act</i>) |
|
420 <p> |
|
421 Public slot to show an AdBlock rule. |
|
422 </p><dl> |
|
423 <dt><i>act</i> (QAction)</dt> |
|
424 <dd> |
|
425 reference to the action |
|
426 </dd> |
|
427 </dl><a NAME="AdBlockManager.subscription" ID="AdBlockManager.subscription"></a> |
|
428 <h4>AdBlockManager.subscription</h4> |
|
429 <b>subscription</b>(<i>location</i>) |
|
430 <p> |
|
431 Public method to get a subscription based on its location. |
|
432 </p><dl> |
|
433 <dt><i>location</i></dt> |
|
434 <dd> |
|
435 location of the subscription to search for (string) |
|
436 </dd> |
|
437 </dl><dl> |
|
438 <dt>Returns:</dt> |
|
439 <dd> |
|
440 subscription or None (AdBlockSubscription) |
|
441 </dd> |
|
442 </dl><a NAME="AdBlockManager.subscriptions" ID="AdBlockManager.subscriptions"></a> |
|
443 <h4>AdBlockManager.subscriptions</h4> |
|
444 <b>subscriptions</b>(<i></i>) |
|
445 <p> |
|
446 Public method to get all subscriptions. |
|
447 </p><dl> |
|
448 <dt>Returns:</dt> |
|
449 <dd> |
|
450 list of subscriptions (list of AdBlockSubscription) |
|
451 </dd> |
|
452 </dl><a NAME="AdBlockManager.updateAllSubscriptions" ID="AdBlockManager.updateAllSubscriptions"></a> |
|
453 <h4>AdBlockManager.updateAllSubscriptions</h4> |
|
454 <b>updateAllSubscriptions</b>(<i></i>) |
|
455 <p> |
|
456 Public method to update all subscriptions. |
|
457 </p> |
|
458 <div align="right"><a href="#top">Up</a></div> |
|
459 <hr /> |
|
460 </body></html> |