| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 25 matching lines...) Expand all Loading... |
| 36 return name;\ | 36 return name;\ |
| 37 }\ | 37 }\ |
| 38 void BINDINGS_EXPORTED setter(param_type value)\ | 38 void BINDINGS_EXPORTED setter(param_type value)\ |
| 39 {\ | 39 {\ |
| 40 if (name != value)\ | 40 if (name != value)\ |
| 41 {\ | 41 {\ |
| 42 name = value;\ | 42 name = value;\ |
| 43 if (FilterNotifier::Topic::topic != FilterNotifier::Topic::NONE)\ | 43 if (FilterNotifier::Topic::topic != FilterNotifier::Topic::NONE)\ |
| 44 {\ | 44 {\ |
| 45 FilterNotifier::SubscriptionChange(FilterNotifier::Topic::topic,\ | 45 FilterNotifier::SubscriptionChange(FilterNotifier::Topic::topic,\ |
| 46 this);\ | 46 *this);\ |
| 47 }\ | 47 }\ |
| 48 }\ | 48 }\ |
| 49 } | 49 } |
| 50 | 50 |
| 51 #define SUBSCRIPTION_PROPERTY(type, name, topic, getter, setter) \ | 51 #define SUBSCRIPTION_PROPERTY(type, name, topic, getter, setter) \ |
| 52 static_assert(std::is_arithmetic<type>::value, "SUBSCRIPTION_PROPERTY macro
can only be used with arithmetic types");\ | 52 static_assert(std::is_arithmetic<type>::value, "SUBSCRIPTION_PROPERTY macro
can only be used with arithmetic types");\ |
| 53 SUBSCRIPTION_PROPERTY_INTERNAL(type, type, name, topic, getter, setter) | 53 SUBSCRIPTION_PROPERTY_INTERNAL(type, type, name, topic, getter, setter) |
| 54 | 54 |
| 55 #define SUBSCRIPTION_STRING_PROPERTY(name, topic, getter, setter) \ | 55 #define SUBSCRIPTION_STRING_PROPERTY(name, topic, getter, setter) \ |
| 56 SUBSCRIPTION_PROPERTY_INTERNAL(OwnedString, const String&, name, topic, gett
er, setter) | 56 SUBSCRIPTION_PROPERTY_INTERNAL(OwnedString, const String&, name, topic, gett
er, setter) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 SUBSCRIPTION_PROPERTY(bool, mDisabled, SUBSCRIPTION_DISABLED, | 86 SUBSCRIPTION_PROPERTY(bool, mDisabled, SUBSCRIPTION_DISABLED, |
| 87 GetDisabled, SetDisabled); | 87 GetDisabled, SetDisabled); |
| 88 SUBSCRIPTION_PROPERTY(bool, mListed, NONE, GetListed, SetListed); | 88 SUBSCRIPTION_PROPERTY(bool, mListed, NONE, GetListed, SetListed); |
| 89 | 89 |
| 90 Filters::size_type BINDINGS_EXPORTED GetFilterCount() const | 90 Filters::size_type BINDINGS_EXPORTED GetFilterCount() const |
| 91 { | 91 { |
| 92 return mFilters.size(); | 92 return mFilters.size(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 Filter* BINDINGS_EXPORTED FilterAt(Filters::size_type index); | 95 Filter* BINDINGS_EXPORTED FilterAt(Filters::size_type index); |
| 96 int BINDINGS_EXPORTED IndexOfFilter(Filter* filter); | 96 int BINDINGS_EXPORTED IndexOfFilter(const Filter& filter); |
| 97 OwnedString BINDINGS_EXPORTED Serialize() const; | 97 OwnedString BINDINGS_EXPORTED Serialize() const; |
| 98 OwnedString BINDINGS_EXPORTED SerializeFilters() const; | 98 OwnedString BINDINGS_EXPORTED SerializeFilters() const; |
| 99 | 99 |
| 100 static Subscription* BINDINGS_EXPORTED FromID(const String& id); | 100 static Subscription* BINDINGS_EXPORTED FromID(const String& id); |
| 101 | 101 |
| 102 template<typename T> | 102 template<typename T> |
| 103 T* As(); | 103 T* As(); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 typedef intrusive_ptr<Subscription> SubscriptionPtr; | 106 typedef intrusive_ptr<Subscription> SubscriptionPtr; |
| OLD | NEW |