1 /* 2 * Copyright (c) 2021 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 OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_SERVICE_STUB_H 17 #define OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_SERVICE_STUB_H 18 19 #include <iremote_stub.h> 20 #include <message_parcel.h> 21 #include <message_option.h> 22 #include "idisplay_layer.h" 23 #include "display_layer_service_impl.h" 24 25 namespace OHOS { 26 namespace HDI { 27 namespace Display { 28 namespace V1_0 { 29 30 enum { 31 CMD_DISPLAY_LAYER_INIT_DISPLAY = 0, 32 CMD_DISPLAY_LAYER_DEINIT_DISPLAY, 33 CMD_DISPLAY_LAYER_GET_DISPLAY_INFO, 34 CMD_DISPLAY_LAYER_CREATE_LAYER, 35 CMD_DISPLAY_LAYER_CLOSE_LAYER, 36 CMD_DISPLAY_LAYER_SET_LAYER_VISIBLE, 37 CMD_DISPLAY_LAYER_GET_LAYER_VISIBLE_STATE, 38 CMD_DISPLAY_LAYER_SET_LAYER_RECT, 39 CMD_DISPLAY_LAYER_GET_LAYER_RECT, 40 CMD_DISPLAY_LAYER_SET_LAYER_ZORDER, 41 CMD_DISPLAY_LAYER_GET_LAYER_ZORDER, 42 CMD_DISPLAY_LAYER_SET_TRANSFORM_MODE, 43 CMD_DISPLAY_LAYER_SET_LAYER_BUFFER, 44 }; 45 46 class DisplayLayerStub { 47 public: 48 DisplayLayerStub(); ~DisplayLayerStub()49 virtual ~DisplayLayerStub() {} 50 51 DispErrCode Init(); 52 int32_t LayerStubInitDisplay(MessageParcel& data, MessageParcel& reply, MessageOption& option); 53 int32_t LayerStubDeinitDisplay(MessageParcel& data, MessageParcel& reply, MessageOption& option); 54 int32_t LayerStubGetDisplayInfo(MessageParcel& data, MessageParcel& reply, MessageOption& option); 55 int32_t LayerStubCreateLayer(MessageParcel& data, MessageParcel& reply, MessageOption& option); 56 int32_t LayerStubCloseLayer(MessageParcel& data, MessageParcel& reply, MessageOption& option); 57 int32_t LayerStubSetLayerVisible(MessageParcel& data, MessageParcel& reply, MessageOption& option); 58 int32_t LayerStubGetLayerVisibleState(MessageParcel& data, MessageParcel& reply, MessageOption& option); 59 int32_t LayerStubSetLayerRect(MessageParcel& data, MessageParcel& reply, MessageOption& option); 60 int32_t LayerStubGetLayerRect(MessageParcel& data, MessageParcel& reply, MessageOption& option); 61 int32_t LayerStubSetLayerZorder(MessageParcel& data, MessageParcel& reply, MessageOption& option); 62 int32_t LayerStubGetLayerZorder(MessageParcel& data, MessageParcel& reply, MessageOption& option); 63 int32_t LayerStubSetLayerTransformMode(MessageParcel& data, MessageParcel& reply, MessageOption& option); 64 int32_t LayerStubSetLayerBuffer(MessageParcel& data, MessageParcel& reply, MessageOption& option); 65 int32_t LayerStubOnRemoteRequest(int cmdId, MessageParcel& data, MessageParcel& reply, MessageOption& option); 66 67 private: 68 std::shared_ptr<DisplayLayerService> layerService_ = nullptr; 69 }; 70 71 } // namespace V1_0 72 } // namespace Display 73 } // namespace HDI 74 } // namespace OHOS 75 76 void *LayerStubInstance(); 77 78 void DestroyLayerStub(void *obj); 79 80 int32_t LayerServiceOnRemoteRequest(void *stub, int cmdId, struct HdfSBuf *data, struct HdfSBuf *reply); 81 82 #endif // OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_SERVICE_STUB_H