Index: compiled/FilterNotifier.h |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/compiled/FilterNotifier.h |
@@ -0,0 +1,68 @@ |
+/* |
+ * This file is part of Adblock Plus <https://adblockplus.org/>, |
+ * Copyright (C) 2006-2017 eyeo GmbH |
+ * |
+ * Adblock Plus is free software: you can redistribute it and/or modify |
+ * it under the terms of the GNU General Public License version 3 as |
+ * published by the Free Software Foundation. |
+ * |
+ * Adblock Plus is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ * GNU General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU General Public License |
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
+ */ |
+ |
+#pragma once |
+ |
+#include <cstdio> |
+ |
+#include "String.h" |
+ |
+namespace FilterNotifier |
+{ |
+ enum class Topic |
+ { |
+ NONE, |
+ FILTER_DISABLED, |
+ FILTER_HITCOUNT, |
+ FILTER_LASTHIT, |
+ SUBSCRIPTION_TITLE, |
+ SUBSCRIPTION_DISABLED, |
+ SUBSCRIPTION_FIXEDTITLE, |
+ SUBSCRIPTION_HOMEPAGE, |
+ SUBSCRIPTION_LASTCHECK, |
+ SUBSCRIPTION_LASTDOWNLOAD, |
+ SUBSCRIPTION_DOWNLOADSTATUS, |
+ SUBSCRIPTION_ERRORS, |
+ }; |
+ |
+ inline void GenerateCustomBindings() |
+ { |
+ printf("var FilterNotifier = require('filterNotifier').FilterNotifier;\n"); |
+ printf("var notifierTopics = new Map([\n"); |
+ printf(" [%i, 'filter.disabled'],\n", Topic::FILTER_DISABLED); |
+ printf(" [%i, 'filter.hitCount'],\n", Topic::FILTER_HITCOUNT); |
+ printf(" [%i, 'filter.lastHit'],\n", Topic::FILTER_LASTHIT); |
+ printf(" [%i, 'subscription.title'],\n", Topic::SUBSCRIPTION_TITLE); |
+ printf(" [%i, 'subscription.disabled'],\n", Topic::SUBSCRIPTION_DISABLED); |
+ printf(" [%i, 'subscription.fixedTitle'],\n", Topic::SUBSCRIPTION_FIXEDTITLE); |
+ printf(" [%i, 'subscription.homepage'],\n", Topic::SUBSCRIPTION_HOMEPAGE); |
+ printf(" [%i, 'subscription.lastCheck'],\n", Topic::SUBSCRIPTION_LASTCHECK); |
+ printf(" [%i, 'subscription.lastDownload'],\n", Topic::SUBSCRIPTION_LASTDOWNLOAD); |
+ printf(" [%i, 'subscription.downloadStatus'],\n", Topic::SUBSCRIPTION_DOWNLOADSTATUS); |
+ printf(" [%i, 'subscription.errors'],\n", Topic::SUBSCRIPTION_ERRORS); |
+ printf("]);"); |
+ } |
+ |
+ void PropertyChange(Topic topic, void* object, bool newValue, bool oldValue); |
+ void PropertyChange(Topic topic, void* object, int newValue, int oldValue); |
+ void PropertyChange(Topic topic, void* object, unsigned int newValue, |
+ unsigned int oldValue); |
+ void PropertyChange(Topic topic, void* object, double newValue, |
+ double oldValue); |
+ void PropertyChange(Topic topic, void* object, const String& newValue, |
+ const String& oldValue); |
+} |