| 1114 | }; |
| 1115 | |
| 1116 | ScriptingObjects::ScriptDownloadObject::ScriptDownloadObject(ProcessorWithScriptingContent* pwsc, const URL& url, const String& extraHeader_, const File& targetFile_, var callback_) : |
| 1117 | ConstScriptingObject(pwsc, 3), |
| 1118 | callback(pwsc, this, callback_, 0), |
| 1119 | downloadURL(url), |
| 1120 | targetFile(targetFile_), |
| 1121 | extraHeaders(extraHeader_), |
| 1122 | jp(dynamic_cast<JavascriptProcessor*>(pwsc)) |
| 1123 | { |
| 1124 | data = new DynamicObject(); |
| 1125 | addConstant("data", var(data.get())); |
| 1126 | |
| 1127 | callback.incRefCount(); |
| 1128 | callback.setThisObject(this); |
| 1129 | |
| 1130 | |
| 1131 | ADD_API_METHOD_0(resume); |
| 1132 | ADD_API_METHOD_0(stop); |
| 1133 | ADD_API_METHOD_0(abort); |
| 1134 | ADD_API_METHOD_0(isRunning); |
| 1135 | ADD_API_METHOD_0(getProgress); |
| 1136 | ADD_API_METHOD_0(getFullURL); |
| 1137 | ADD_API_METHOD_0(getStatusText); |
| 1138 | ADD_API_METHOD_0(getDownloadedTarget); |
| 1139 | ADD_API_METHOD_0(getDownloadSpeed); |
| 1140 | ADD_API_METHOD_0(getNumBytesDownloaded); |
| 1141 | ADD_API_METHOD_0(getDownloadSize); |
| 1142 | } |
| 1143 | |
| 1144 | ScriptingObjects::ScriptDownloadObject::~ScriptDownloadObject() |
| 1145 | { |
nothing calls this directly
no test coverage detected