OLD | NEW |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void Callback(const std::string& arg, const AdblockPlus::JsValuePtr jsValue); | 77 void Callback(const std::string& arg, const AdblockPlus::JsValuePtr jsValue); |
78 }; | 78 }; |
79 | 79 |
80 class JniLogSystemCallback : public JniCallbackBase, public AdblockPlus::LogSyst
em | 80 class JniLogSystemCallback : public JniCallbackBase, public AdblockPlus::LogSyst
em |
81 { | 81 { |
82 public: | 82 public: |
83 JniLogSystemCallback(JNIEnv* env, jobject callbackObject); | 83 JniLogSystemCallback(JNIEnv* env, jobject callbackObject); |
84 void operator()(AdblockPlus::LogSystem::LogLevel logLevel, const std::string&
message, const std::string& source); | 84 void operator()(AdblockPlus::LogSystem::LogLevel logLevel, const std::string&
message, const std::string& source); |
85 }; | 85 }; |
86 | 86 |
| 87 /** |
| 88 * Shared smart pointer to a `JniLogSystemCallback` instance. |
| 89 */ |
| 90 typedef std::shared_ptr<JniLogSystemCallback> JniLogSystemCallbackPtr; |
| 91 |
87 class JniShowNotificationCallback : public JniCallbackBase | 92 class JniShowNotificationCallback : public JniCallbackBase |
88 { | 93 { |
89 public: | 94 public: |
90 JniShowNotificationCallback(JNIEnv* env, jobject callbackObject); | 95 JniShowNotificationCallback(JNIEnv* env, jobject callbackObject); |
91 void Callback(const AdblockPlus::NotificationPtr&); | 96 void Callback(const AdblockPlus::NotificationPtr&); |
92 }; | 97 }; |
93 | 98 |
94 class JniWebRequest : public JniCallbackBase, public AdblockPlus::WebRequest | 99 class JniWebRequest : public JniCallbackBase, public AdblockPlus::WebRequest |
95 { | 100 { |
96 public: | 101 public: |
97 JniWebRequest(JNIEnv* env, jobject callbackObject); | 102 JniWebRequest(JNIEnv* env, jobject callbackObject); |
98 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea
derList& requestHeaders) const; | 103 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea
derList& requestHeaders) const; |
99 | 104 |
100 private: | 105 private: |
101 jobject NewTuple(JNIEnv* env, const std::string& a, const std::string& b) cons
t; | 106 jobject NewTuple(JNIEnv* env, const std::string& a, const std::string& b) cons
t; |
102 }; | 107 }; |
103 | 108 |
104 #endif /* JNICALLBACKS_H */ | 109 #endif /* JNICALLBACKS_H */ |
OLD | NEW |