1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef DOWNLOAD_SERVICE_INTERFACE_H 17 #define DOWNLOAD_SERVICE_INTERFACE_H 18 19 #include <string> 20 21 #include "notify_interface.h" 22 #include "iremote_broker.h" 23 #include "constant.h" 24 #include "js_common.h" 25 26 namespace OHOS::Request { 27 class RequestServiceInterface : public IRemoteBroker { 28 public: 29 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Download.RequestServiceInterface"); 30 virtual int32_t Create(const Config &config, int32_t &taskId, sptr<NotifyInterface> listener) = 0; 31 virtual int32_t Start(const std::string &tid) = 0; 32 virtual int32_t Pause(const std::string &tid, Version version) = 0; 33 virtual int32_t QueryMimeType(const std::string &tid, std::string &mimeType) = 0; 34 virtual int32_t Remove(const std::string &tid, Version version) = 0; 35 virtual int32_t Resume(const std::string &tid) = 0; 36 37 virtual int32_t Stop(const std::string &tid) = 0; 38 virtual int32_t Query(const std::string &tid, TaskInfo &info) = 0; 39 virtual int32_t Touch(const std::string &tid, const std::string &token, TaskInfo &info) = 0; 40 virtual int32_t Search(const Filter &filter, std::vector<std::string> &tids) = 0; 41 virtual int32_t Show(const std::string &tid, TaskInfo &info) = 0; 42 43 virtual int32_t On(const std::string &type, const std::string &tid, 44 const sptr<NotifyInterface> &listener) = 0; 45 virtual int32_t Off(const std::string &type, const std::string &tid) = 0; 46 }; 47 } // namespace OHOS::Request 48 #endif // DOWNLOAD_SERVICE_INTERFACE_H