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