OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 21 matching lines...) Expand all Loading... |
32 typedef std::shared_ptr<FilterEngine> FilterEnginePtr; | 32 typedef std::shared_ptr<FilterEngine> FilterEnginePtr; |
33 | 33 |
34 /** | 34 /** |
35 * Wrapper for an Adblock Plus filter object. | 35 * Wrapper for an Adblock Plus filter object. |
36 * There are no accessors for most | 36 * There are no accessors for most |
37 * [filter properties](https://adblockplus.org/jsdoc/adblockpluscore/Filter.ht
ml), | 37 * [filter properties](https://adblockplus.org/jsdoc/adblockpluscore/Filter.ht
ml), |
38 * use `GetProperty()` to retrieve them by name. | 38 * use `GetProperty()` to retrieve them by name. |
39 */ | 39 */ |
40 class Filter : public JsValue | 40 class Filter : public JsValue |
41 { | 41 { |
| 42 friend class FilterEngine; |
42 public: | 43 public: |
| 44 Filter(const Filter& src); |
| 45 Filter(Filter&& src); |
| 46 Filter& operator=(const Filter& src); |
| 47 Filter& operator=(Filter&& src); |
| 48 |
43 /** | 49 /** |
44 * Filter types, see https://adblockplus.org/en/filters. | 50 * Filter types, see https://adblockplus.org/en/filters. |
45 */ | 51 */ |
46 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, | 52 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, |
47 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION, | 53 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION, |
48 TYPE_COMMENT, TYPE_INVALID}; | 54 TYPE_COMMENT, TYPE_INVALID}; |
49 | 55 |
50 /** | 56 /** |
51 * Retrieves the type of this filter. | 57 * Retrieves the type of this filter. |
52 * @return Type of this filter. | 58 * @return Type of this filter. |
(...skipping 11 matching lines...) Expand all Loading... |
64 */ | 70 */ |
65 void AddToList(); | 71 void AddToList(); |
66 | 72 |
67 /** | 73 /** |
68 * Removes this filter from the list of custom filters. | 74 * Removes this filter from the list of custom filters. |
69 */ | 75 */ |
70 void RemoveFromList(); | 76 void RemoveFromList(); |
71 | 77 |
72 bool operator==(const Filter& filter) const; | 78 bool operator==(const Filter& filter) const; |
73 | 79 |
| 80 protected: |
74 /** | 81 /** |
75 * Creates a wrapper for an existing JavaScript filter object. | 82 * Creates a wrapper for an existing JavaScript filter object. |
76 * Normally you shouldn't call this directly, but use | 83 * Normally you shouldn't call this directly, but use |
77 * FilterEngine::GetFilter() instead. | 84 * FilterEngine::GetFilter() instead. |
78 * @param value JavaScript filter object. | 85 * @param value JavaScript filter object. |
79 */ | 86 */ |
80 Filter(JsValue&& value); | 87 Filter(JsValue&& value); |
81 }; | 88 }; |
82 | 89 |
83 /** | 90 /** |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 const JsValueList& param) const; | 547 const JsValueList& param) const; |
541 FilterPtr GetWhitelistingFilter(const std::string& url, | 548 FilterPtr GetWhitelistingFilter(const std::string& url, |
542 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; | 549 ContentTypeMask contentTypeMask, const std::string& documentUrl) const; |
543 FilterPtr GetWhitelistingFilter(const std::string& url, | 550 FilterPtr GetWhitelistingFilter(const std::string& url, |
544 ContentTypeMask contentTypeMask, | 551 ContentTypeMask contentTypeMask, |
545 const std::vector<std::string>& documentUrls) const; | 552 const std::vector<std::string>& documentUrls) const; |
546 }; | 553 }; |
547 } | 554 } |
548 | 555 |
549 #endif | 556 #endif |
OLD | NEW |