1 /* 2 * Copyright (C) 2022 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_STUB_H 17 #define DOWNLOAD_SERVICE_STUB_H 18 19 #include <stdint.h> 20 #include "message_option.h" 21 #include "message_parcel.h" 22 #include "refbase.h" 23 #include "iremote_stub.h" 24 #include "download_service_interface.h" 25 26 namespace OHOS::Request::Download { 27 class DownloadServiceStub : public IRemoteStub<DownloadServiceInterface> { 28 public: 29 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 30 31 private: 32 bool OnRequest(MessageParcel &data, MessageParcel &reply); 33 bool OnPause(MessageParcel &data, MessageParcel &reply); 34 bool OnQuery(MessageParcel &data, MessageParcel &reply); 35 bool OnQueryMimeType(MessageParcel &data, MessageParcel &reply); 36 bool OnRemove(MessageParcel &data, MessageParcel &reply); 37 bool OnResume(MessageParcel &data, MessageParcel &reply); 38 bool OnEventOn(MessageParcel &data, MessageParcel &reply); 39 bool OnEventOff(MessageParcel &data, MessageParcel &reply); 40 bool OnCheckPermission(MessageParcel &data, MessageParcel &reply); 41 }; 42 } // namespace OHOS::Request::Download 43 #endif // DOWNLOAD_SERVICE_STUB_H 44