|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.Helpviewer.AdBlock.AdBlockSubscription</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.Helpviewer.AdBlock.AdBlockSubscription</h1> |
|
12 <p> |
|
13 Module implementing the AdBlock subscription class. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#AdBlockSubscription">AdBlockSubscription</a></td> |
|
23 <td>Class implementing the AdBlock subscription.</td> |
|
24 </tr> |
|
25 </table> |
|
26 <h3>Functions</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <hr /><hr /> |
|
31 <a NAME="AdBlockSubscription" ID="AdBlockSubscription"></a> |
|
32 <h2>AdBlockSubscription</h2> |
|
33 <p> |
|
34 Class implementing the AdBlock subscription. |
|
35 </p><h4>Signals</h4> |
|
36 <dl> |
|
37 <dt>changed()</dt> |
|
38 <dd> |
|
39 emitted after the subscription has changed |
|
40 </dd><dt>rulesChanged()</dt> |
|
41 <dd> |
|
42 emitted after the subscription's rules have changed |
|
43 </dd> |
|
44 </dl> |
|
45 <h3>Derived from</h3> |
|
46 QObject |
|
47 <h3>Class Attributes</h3> |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 <h3>Methods</h3> |
|
52 <table> |
|
53 <tr> |
|
54 <td><a href="#AdBlockSubscription.__init__">AdBlockSubscription</a></td> |
|
55 <td>Constructor</td> |
|
56 </tr><tr> |
|
57 <td><a href="#AdBlockSubscription.__loadRules">__loadRules</a></td> |
|
58 <td>Private method to load the rules of the subscription.</td> |
|
59 </tr><tr> |
|
60 <td><a href="#AdBlockSubscription.__parseUrl">__parseUrl</a></td> |
|
61 <td>Private method to parse the AdBlock URL for the subscription.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#AdBlockSubscription.__populateCache">__populateCache</a></td> |
|
64 <td>Private method to populate the various rule caches.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#AdBlockSubscription.__rulesDownloaded">__rulesDownloaded</a></td> |
|
67 <td>Private slot to deal with the downloaded rules.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#AdBlockSubscription.addRule">addRule</a></td> |
|
70 <td>Public method to add a rule.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#AdBlockSubscription.allRules">allRules</a></td> |
|
73 <td>Public method to get the list of rules.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#AdBlockSubscription.allow">allow</a></td> |
|
76 <td>Public method to check, if the given URL is allowed.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#AdBlockSubscription.block">block</a></td> |
|
79 <td>Public method to check, if the given URL should be blocked.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#AdBlockSubscription.isEnabled">isEnabled</a></td> |
|
82 <td>Public method to check, if the subscription is enabled.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#AdBlockSubscription.lastUpdate">lastUpdate</a></td> |
|
85 <td>Public method to get the date and time of the last update.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#AdBlockSubscription.location">location</a></td> |
|
88 <td>Public method to get the subscription location.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#AdBlockSubscription.pageRules">pageRules</a></td> |
|
91 <td>Public method to get the page rules of the subscription.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#AdBlockSubscription.removeRule">removeRule</a></td> |
|
94 <td>Public method to remove a rule given the offset.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#AdBlockSubscription.replaceRule">replaceRule</a></td> |
|
97 <td>Public method to replace a rule given the offset.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#AdBlockSubscription.rulesFileName">rulesFileName</a></td> |
|
100 <td>Public method to get the name of the rules file.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#AdBlockSubscription.saveRules">saveRules</a></td> |
|
103 <td>Public method to save the subscription rules.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#AdBlockSubscription.setEnabled">setEnabled</a></td> |
|
106 <td>Public method to set the enabled status.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#AdBlockSubscription.setLocation">setLocation</a></td> |
|
109 <td>Public method to set the subscription location.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#AdBlockSubscription.setTitle">setTitle</a></td> |
|
112 <td>Public method to set the subscription title.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#AdBlockSubscription.title">title</a></td> |
|
115 <td>Public method to get the subscription title.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#AdBlockSubscription.updateNow">updateNow</a></td> |
|
118 <td>Public method to update the subscription immediately.</td> |
|
119 </tr><tr> |
|
120 <td><a href="#AdBlockSubscription.url">url</a></td> |
|
121 <td>Public method to generate the url for this subscription.</td> |
|
122 </tr> |
|
123 </table> |
|
124 <a NAME="AdBlockSubscription.__init__" ID="AdBlockSubscription.__init__"></a> |
|
125 <h4>AdBlockSubscription (Constructor)</h4> |
|
126 <b>AdBlockSubscription</b>(<i>url, parent = None</i>) |
|
127 <p> |
|
128 Constructor |
|
129 </p><dl> |
|
130 <dt><i>url</i></dt> |
|
131 <dd> |
|
132 AdBlock URL for the subscription (QUrl) |
|
133 </dd><dt><i>parent</i></dt> |
|
134 <dd> |
|
135 reference to the parent object (QObject) |
|
136 </dd> |
|
137 </dl><a NAME="AdBlockSubscription.__loadRules" ID="AdBlockSubscription.__loadRules"></a> |
|
138 <h4>AdBlockSubscription.__loadRules</h4> |
|
139 <b>__loadRules</b>(<i></i>) |
|
140 <p> |
|
141 Private method to load the rules of the subscription. |
|
142 </p><a NAME="AdBlockSubscription.__parseUrl" ID="AdBlockSubscription.__parseUrl"></a> |
|
143 <h4>AdBlockSubscription.__parseUrl</h4> |
|
144 <b>__parseUrl</b>(<i>url</i>) |
|
145 <p> |
|
146 Private method to parse the AdBlock URL for the subscription. |
|
147 </p><dl> |
|
148 <dt><i>url</i></dt> |
|
149 <dd> |
|
150 AdBlock URL for the subscription (QUrl) |
|
151 </dd> |
|
152 </dl><a NAME="AdBlockSubscription.__populateCache" ID="AdBlockSubscription.__populateCache"></a> |
|
153 <h4>AdBlockSubscription.__populateCache</h4> |
|
154 <b>__populateCache</b>(<i></i>) |
|
155 <p> |
|
156 Private method to populate the various rule caches. |
|
157 </p><a NAME="AdBlockSubscription.__rulesDownloaded" ID="AdBlockSubscription.__rulesDownloaded"></a> |
|
158 <h4>AdBlockSubscription.__rulesDownloaded</h4> |
|
159 <b>__rulesDownloaded</b>(<i></i>) |
|
160 <p> |
|
161 Private slot to deal with the downloaded rules. |
|
162 </p><a NAME="AdBlockSubscription.addRule" ID="AdBlockSubscription.addRule"></a> |
|
163 <h4>AdBlockSubscription.addRule</h4> |
|
164 <b>addRule</b>(<i>rule</i>) |
|
165 <p> |
|
166 Public method to add a rule. |
|
167 </p><dl> |
|
168 <dt><i>rule</i></dt> |
|
169 <dd> |
|
170 reference to the rule to add (AdBlockRule) |
|
171 </dd> |
|
172 </dl><a NAME="AdBlockSubscription.allRules" ID="AdBlockSubscription.allRules"></a> |
|
173 <h4>AdBlockSubscription.allRules</h4> |
|
174 <b>allRules</b>(<i></i>) |
|
175 <p> |
|
176 Public method to get the list of rules. |
|
177 </p><dl> |
|
178 <dt>Returns:</dt> |
|
179 <dd> |
|
180 list of rules (list of AdBlockRule) |
|
181 </dd> |
|
182 </dl><a NAME="AdBlockSubscription.allow" ID="AdBlockSubscription.allow"></a> |
|
183 <h4>AdBlockSubscription.allow</h4> |
|
184 <b>allow</b>(<i>urlString</i>) |
|
185 <p> |
|
186 Public method to check, if the given URL is allowed. |
|
187 </p><dl> |
|
188 <dt>Returns:</dt> |
|
189 <dd> |
|
190 reference to the rule object or None (AdBlockRule) |
|
191 </dd> |
|
192 </dl><a NAME="AdBlockSubscription.block" ID="AdBlockSubscription.block"></a> |
|
193 <h4>AdBlockSubscription.block</h4> |
|
194 <b>block</b>(<i>urlString</i>) |
|
195 <p> |
|
196 Public method to check, if the given URL should be blocked. |
|
197 </p><dl> |
|
198 <dt>Returns:</dt> |
|
199 <dd> |
|
200 reference to the rule object or None (AdBlockRule) |
|
201 </dd> |
|
202 </dl><a NAME="AdBlockSubscription.isEnabled" ID="AdBlockSubscription.isEnabled"></a> |
|
203 <h4>AdBlockSubscription.isEnabled</h4> |
|
204 <b>isEnabled</b>(<i></i>) |
|
205 <p> |
|
206 Public method to check, if the subscription is enabled. |
|
207 </p><dl> |
|
208 <dt>Returns:</dt> |
|
209 <dd> |
|
210 flag indicating the enabled status (boolean) |
|
211 </dd> |
|
212 </dl><a NAME="AdBlockSubscription.lastUpdate" ID="AdBlockSubscription.lastUpdate"></a> |
|
213 <h4>AdBlockSubscription.lastUpdate</h4> |
|
214 <b>lastUpdate</b>(<i></i>) |
|
215 <p> |
|
216 Public method to get the date and time of the last update. |
|
217 </p><dl> |
|
218 <dt>Returns:</dt> |
|
219 <dd> |
|
220 date and time of the last update (QDateTime) |
|
221 </dd> |
|
222 </dl><a NAME="AdBlockSubscription.location" ID="AdBlockSubscription.location"></a> |
|
223 <h4>AdBlockSubscription.location</h4> |
|
224 <b>location</b>(<i></i>) |
|
225 <p> |
|
226 Public method to get the subscription location. |
|
227 </p><dl> |
|
228 <dt>Returns:</dt> |
|
229 <dd> |
|
230 URL of the subscription location (QUrl) |
|
231 </dd> |
|
232 </dl><a NAME="AdBlockSubscription.pageRules" ID="AdBlockSubscription.pageRules"></a> |
|
233 <h4>AdBlockSubscription.pageRules</h4> |
|
234 <b>pageRules</b>(<i></i>) |
|
235 <p> |
|
236 Public method to get the page rules of the subscription. |
|
237 </p><dl> |
|
238 <dt>Returns:</dt> |
|
239 <dd> |
|
240 list of rule objects (list of AdBlockRule) |
|
241 </dd> |
|
242 </dl><a NAME="AdBlockSubscription.removeRule" ID="AdBlockSubscription.removeRule"></a> |
|
243 <h4>AdBlockSubscription.removeRule</h4> |
|
244 <b>removeRule</b>(<i>offset</i>) |
|
245 <p> |
|
246 Public method to remove a rule given the offset. |
|
247 </p><dl> |
|
248 <dt><i>offset</i></dt> |
|
249 <dd> |
|
250 offset of the rule to remove (integer) |
|
251 </dd> |
|
252 </dl><a NAME="AdBlockSubscription.replaceRule" ID="AdBlockSubscription.replaceRule"></a> |
|
253 <h4>AdBlockSubscription.replaceRule</h4> |
|
254 <b>replaceRule</b>(<i>rule, offset</i>) |
|
255 <p> |
|
256 Public method to replace a rule given the offset. |
|
257 </p><dl> |
|
258 <dt><i>rule</i></dt> |
|
259 <dd> |
|
260 reference to the rule to set (AdBlockRule) |
|
261 </dd><dt><i>offset</i></dt> |
|
262 <dd> |
|
263 offset of the rule to remove (integer) |
|
264 </dd> |
|
265 </dl><a NAME="AdBlockSubscription.rulesFileName" ID="AdBlockSubscription.rulesFileName"></a> |
|
266 <h4>AdBlockSubscription.rulesFileName</h4> |
|
267 <b>rulesFileName</b>(<i></i>) |
|
268 <p> |
|
269 Public method to get the name of the rules file. |
|
270 </p><dl> |
|
271 <dt>Returns:</dt> |
|
272 <dd> |
|
273 name of the rules file (string) |
|
274 </dd> |
|
275 </dl><a NAME="AdBlockSubscription.saveRules" ID="AdBlockSubscription.saveRules"></a> |
|
276 <h4>AdBlockSubscription.saveRules</h4> |
|
277 <b>saveRules</b>(<i></i>) |
|
278 <p> |
|
279 Public method to save the subscription rules. |
|
280 </p><a NAME="AdBlockSubscription.setEnabled" ID="AdBlockSubscription.setEnabled"></a> |
|
281 <h4>AdBlockSubscription.setEnabled</h4> |
|
282 <b>setEnabled</b>(<i>enabled</i>) |
|
283 <p> |
|
284 Public method to set the enabled status. |
|
285 </p><dl> |
|
286 <dt><i>enabled</i></dt> |
|
287 <dd> |
|
288 flag indicating the enabled status (boolean) |
|
289 </dd> |
|
290 </dl><a NAME="AdBlockSubscription.setLocation" ID="AdBlockSubscription.setLocation"></a> |
|
291 <h4>AdBlockSubscription.setLocation</h4> |
|
292 <b>setLocation</b>(<i>url</i>) |
|
293 <p> |
|
294 Public method to set the subscription location. |
|
295 </p><dl> |
|
296 <dt><i>url</i></dt> |
|
297 <dd> |
|
298 URL of the subscription location (QUrl) |
|
299 </dd> |
|
300 </dl><a NAME="AdBlockSubscription.setTitle" ID="AdBlockSubscription.setTitle"></a> |
|
301 <h4>AdBlockSubscription.setTitle</h4> |
|
302 <b>setTitle</b>(<i>title</i>) |
|
303 <p> |
|
304 Public method to set the subscription title. |
|
305 </p><dl> |
|
306 <dt><i>title</i></dt> |
|
307 <dd> |
|
308 subscription title (string) |
|
309 </dd> |
|
310 </dl><a NAME="AdBlockSubscription.title" ID="AdBlockSubscription.title"></a> |
|
311 <h4>AdBlockSubscription.title</h4> |
|
312 <b>title</b>(<i></i>) |
|
313 <p> |
|
314 Public method to get the subscription title. |
|
315 </p><dl> |
|
316 <dt>Returns:</dt> |
|
317 <dd> |
|
318 subscription title (string) |
|
319 </dd> |
|
320 </dl><a NAME="AdBlockSubscription.updateNow" ID="AdBlockSubscription.updateNow"></a> |
|
321 <h4>AdBlockSubscription.updateNow</h4> |
|
322 <b>updateNow</b>(<i></i>) |
|
323 <p> |
|
324 Public method to update the subscription immediately. |
|
325 </p><a NAME="AdBlockSubscription.url" ID="AdBlockSubscription.url"></a> |
|
326 <h4>AdBlockSubscription.url</h4> |
|
327 <b>url</b>(<i></i>) |
|
328 <p> |
|
329 Public method to generate the url for this subscription. |
|
330 </p><dl> |
|
331 <dt>Returns:</dt> |
|
332 <dd> |
|
333 AdBlock URL for the subscription (QUrl) |
|
334 </dd> |
|
335 </dl> |
|
336 <div align="right"><a href="#top">Up</a></div> |
|
337 <hr /> |
|
338 </body></html> |