Index: compiled/bindings.cpp |
=================================================================== |
--- a/compiled/bindings.cpp |
+++ b/compiled/bindings.cpp |
@@ -22,16 +22,19 @@ |
#include "filter/ActiveFilter.h" |
#include "filter/RegExpFilter.h" |
#include "filter/BlockingFilter.h" |
#include "filter/WhitelistFilter.h" |
#include "filter/ElemHideBase.h" |
#include "filter/ElemHideFilter.h" |
#include "filter/ElemHideException.h" |
#include "filter/ElemHideEmulationFilter.h" |
+#include "subscription/Subscription.h" |
+#include "subscription/DownloadableSubscription.h" |
+#include "subscription/UserDefinedSubscription.h" |
EMSCRIPTEN_BINDINGS |
{ |
class_<Filter>("Filter") |
.property("text", &Filter::GetText) |
.function("serialize", &Filter::Serialize) |
.class_function("fromText", &Filter::FromText) |
.subclass_differentiator(&Filter::mType, { |
@@ -77,9 +80,41 @@ EMSCRIPTEN_BINDINGS |
class_<ElemHideFilter,ElemHideBase>("ElemHideFilter") |
.class_property("type", "'elemhide'"); |
class_<ElemHideException,ElemHideBase>("ElemHideException") |
.class_property("type", "'elemhideexception'"); |
class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter") |
.class_property("type", "'elemhideemulation'"); |
+ |
+ class_<Subscription>("Subscription") |
+ .property("url", &Subscription::GetID) |
+ .property("title", &Subscription::GetTitle, &Subscription::SetTitle) |
+ .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisabled) |
+ .function("serialize", &Subscription::Serialize) |
+ .function("serializeFilters", &Subscription::SerializeFilters) |
+ .class_function("fromURL", &Subscription::FromID) |
+ .subclass_differentiator(&Subscription::mType, { |
+ {Subscription::Type::USERDEFINED, "SpecialSubscription"}, |
+ {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"}, |
+ }); |
+ |
+ class_<UserDefinedSubscription,Subscription>("SpecialSubscription") |
+ .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor) |
+ .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor) |
+ .function("serialize", &UserDefinedSubscription::Serialize); |
+ |
+ class_<DownloadableSubscription,Subscription>("DownloadableSubscription") |
+ .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &DownloadableSubscription::SetFixedTitle) |
+ .property("homepage", &DownloadableSubscription::GetHomepage, &DownloadableSubscription::SetHomepage) |
+ .property("lastCheck", &DownloadableSubscription::GetLastCheck, &DownloadableSubscription::SetLastCheck) |
+ .property("expires", &DownloadableSubscription::GetHardExpiration, &DownloadableSubscription::SetHardExpiration) |
+ .property("softExpiration", &DownloadableSubscription::GetSoftExpiration, &DownloadableSubscription::SetSoftExpiration) |
+ .property("lastDownload", &DownloadableSubscription::GetLastDownload, &DownloadableSubscription::SetLastDownload) |
+ .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus, &DownloadableSubscription::SetDownloadStatus) |
+ .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &DownloadableSubscription::SetLastSuccess) |
+ .property("errors", &DownloadableSubscription::GetErrorCount, &DownloadableSubscription::SetErrorCount) |
+ .property("version", &DownloadableSubscription::GetDataRevision, &DownloadableSubscription::SetDataRevision) |
+ .property("requiredVersion", &DownloadableSubscription::GetRequiredVersion, &DownloadableSubscription::SetRequiredVersion) |
+ .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount) |
+ .function("serialize", &DownloadableSubscription::Serialize); |
} |