Index: include/AdblockPlus/FilterEngine.h |
=================================================================== |
--- a/include/AdblockPlus/FilterEngine.h |
+++ b/include/AdblockPlus/FilterEngine.h |
@@ -62,33 +62,38 @@ namespace AdblockPlus |
}; |
typedef std::tr1::shared_ptr<Filter> FilterPtr; |
typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr; |
class FilterEngine |
{ |
public: |
+ typedef void(*UpdaterCallback)(const std::string& error); |
+ |
explicit FilterEngine(JsEnginePtr jsEngine); |
JsEnginePtr GetJsEngine() const { return jsEngine; } |
bool IsFirstRun() const; |
FilterPtr GetFilter(const std::string& text); |
SubscriptionPtr GetSubscription(const std::string& url); |
std::vector<FilterPtr> GetListedFilters() const; |
std::vector<SubscriptionPtr> GetListedSubscriptions() const; |
std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; |
FilterPtr Matches(const std::string& url, |
const std::string& contentType, |
const std::string& documentUrl) const; |
std::vector<std::string> GetElementHidingSelectors(const std::string& domain) const; |
JsValuePtr GetPref(const std::string& pref) const; |
void SetPref(const std::string& pref, JsValuePtr value); |
+ void ForceUpdateCheck(UpdaterCallback callback = 0); |
Felix Dahlke
2013/06/05 15:47:36
I suppose you considered using an std::function he
Wladimir Palant
2013/06/05 18:58:21
No, I somehow forgot about that option. Works fine
|
private: |
JsEnginePtr jsEngine; |
bool initialized; |
bool firstRun; |
+ int updateCheckId; |
void InitDone(JsValueList& params); |
+ void UpdateCheckDone(std::string eventName, UpdaterCallback callback, JsValueList& params); |
Felix Dahlke
2013/06/05 15:47:36
Any reason why eventName is not a const string ref
Wladimir Palant
2013/06/05 18:58:21
I had concerns where that reference would point to
|
}; |
} |
#endif |