LEFT | RIGHT |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 #pragma once | 18 #pragma once |
19 | 19 |
20 #include <cstdio> | 20 #include <cstdio> |
21 | 21 |
| 22 #include "library.h" |
22 #include "String.h" | 23 #include "String.h" |
23 | 24 |
24 class Filter; | 25 class Filter; |
25 class Subscription; | 26 class Subscription; |
26 | 27 |
27 namespace FilterNotifier | 28 namespace FilterNotifier |
28 { | 29 { |
29 enum class Topic | 30 enum class Topic |
30 { | 31 { |
31 NONE, | 32 NONE, |
(...skipping 21 matching lines...) Expand all Loading... |
53 printf(" [%i, 'subscription.disabled'],\n", Topic::SUBSCRIPTION_DISABLED); | 54 printf(" [%i, 'subscription.disabled'],\n", Topic::SUBSCRIPTION_DISABLED); |
54 printf(" [%i, 'subscription.fixedTitle'],\n", Topic::SUBSCRIPTION_FIXEDTITL
E); | 55 printf(" [%i, 'subscription.fixedTitle'],\n", Topic::SUBSCRIPTION_FIXEDTITL
E); |
55 printf(" [%i, 'subscription.homepage'],\n", Topic::SUBSCRIPTION_HOMEPAGE); | 56 printf(" [%i, 'subscription.homepage'],\n", Topic::SUBSCRIPTION_HOMEPAGE); |
56 printf(" [%i, 'subscription.lastCheck'],\n", Topic::SUBSCRIPTION_LASTCHECK)
; | 57 printf(" [%i, 'subscription.lastCheck'],\n", Topic::SUBSCRIPTION_LASTCHECK)
; |
57 printf(" [%i, 'subscription.lastDownload'],\n", Topic::SUBSCRIPTION_LASTDOW
NLOAD); | 58 printf(" [%i, 'subscription.lastDownload'],\n", Topic::SUBSCRIPTION_LASTDOW
NLOAD); |
58 printf(" [%i, 'subscription.downloadStatus'],\n", Topic::SUBSCRIPTION_DOWNL
OADSTATUS); | 59 printf(" [%i, 'subscription.downloadStatus'],\n", Topic::SUBSCRIPTION_DOWNL
OADSTATUS); |
59 printf(" [%i, 'subscription.errors'],\n", Topic::SUBSCRIPTION_ERRORS); | 60 printf(" [%i, 'subscription.errors'],\n", Topic::SUBSCRIPTION_ERRORS); |
60 printf("]);"); | 61 printf("]);"); |
61 } | 62 } |
62 | 63 |
63 extern "C" { | |
64 void JSNotifyFilterChange(Topic topic, Filter* filter); | |
65 void JSNotifySubscriptionChange(Topic topic, | |
66 Subscription* subscription); | |
67 } | |
68 | |
69 inline void FilterChange(Topic topic, Filter* filter) | 64 inline void FilterChange(Topic topic, Filter* filter) |
70 { | 65 { |
71 JSNotifyFilterChange(topic, filter); | 66 JSNotifyFilterChange(topic, filter); |
72 } | 67 } |
73 | 68 |
74 inline void SubscriptionChange(Topic topic, Subscription* subscription) | 69 inline void SubscriptionChange(Topic topic, Subscription* subscription) |
75 { | 70 { |
76 JSNotifySubscriptionChange(topic, subscription); | 71 JSNotifySubscriptionChange(topic, subscription); |
77 } | 72 } |
78 } | 73 } |
LEFT | RIGHT |