OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2017 eyeo GmbH |
| 4 * |
| 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 |
| 7 * published by the Free Software Foundation. |
| 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 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/>. |
| 16 */ |
| 17 |
| 18 #pragma once |
| 19 |
| 20 #include <cstdio> |
| 21 |
| 22 #include "String.h" |
| 23 |
| 24 namespace FilterNotifier |
| 25 { |
| 26 enum class Topic |
| 27 { |
| 28 NONE, |
| 29 FILTER_DISABLED, |
| 30 FILTER_HITCOUNT, |
| 31 FILTER_LASTHIT, |
| 32 SUBSCRIPTION_TITLE, |
| 33 SUBSCRIPTION_DISABLED, |
| 34 SUBSCRIPTION_FIXEDTITLE, |
| 35 SUBSCRIPTION_HOMEPAGE, |
| 36 SUBSCRIPTION_LASTCHECK, |
| 37 SUBSCRIPTION_LASTDOWNLOAD, |
| 38 SUBSCRIPTION_DOWNLOADSTATUS, |
| 39 SUBSCRIPTION_ERRORS, |
| 40 }; |
| 41 |
| 42 inline void GenerateCustomBindings() |
| 43 { |
| 44 printf("var FilterNotifier = require('filterNotifier').FilterNotifier;\n"); |
| 45 printf("var notifierTopics = new Map([\n"); |
| 46 printf(" [%i, 'filter.disabled'],\n", Topic::FILTER_DISABLED); |
| 47 printf(" [%i, 'filter.hitCount'],\n", Topic::FILTER_HITCOUNT); |
| 48 printf(" [%i, 'filter.lastHit'],\n", Topic::FILTER_LASTHIT); |
| 49 printf(" [%i, 'subscription.title'],\n", Topic::SUBSCRIPTION_TITLE); |
| 50 printf(" [%i, 'subscription.disabled'],\n", Topic::SUBSCRIPTION_DISABLED); |
| 51 printf(" [%i, 'subscription.fixedTitle'],\n", Topic::SUBSCRIPTION_FIXEDTITL
E); |
| 52 printf(" [%i, 'subscription.homepage'],\n", Topic::SUBSCRIPTION_HOMEPAGE); |
| 53 printf(" [%i, 'subscription.lastCheck'],\n", Topic::SUBSCRIPTION_LASTCHECK)
; |
| 54 printf(" [%i, 'subscription.lastDownload'],\n", Topic::SUBSCRIPTION_LASTDOW
NLOAD); |
| 55 printf(" [%i, 'subscription.downloadStatus'],\n", Topic::SUBSCRIPTION_DOWNL
OADSTATUS); |
| 56 printf(" [%i, 'subscription.errors'],\n", Topic::SUBSCRIPTION_ERRORS); |
| 57 printf("]);"); |
| 58 } |
| 59 |
| 60 void PropertyChange(Topic topic, void* object, bool newValue, bool oldValue); |
| 61 void PropertyChange(Topic topic, void* object, int newValue, int oldValue); |
| 62 void PropertyChange(Topic topic, void* object, unsigned int newValue, |
| 63 unsigned int oldValue); |
| 64 void PropertyChange(Topic topic, void* object, uint64_t newValue, |
| 65 uint64_t oldValue); |
| 66 void PropertyChange(Topic topic, void* object, const String& newValue, |
| 67 const String& oldValue); |
| 68 } |
OLD | NEW |