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 OHOS_HDI_DISPLAY_V1_1_IDISPLAY_BUFFER_H 17 #define OHOS_HDI_DISPLAY_V1_1_IDISPLAY_BUFFER_H 18 19 #include "v1_0/include/idisplay_buffer.h" 20 21 namespace OHOS { 22 namespace HDI { 23 namespace Display { 24 namespace Buffer { 25 namespace V1_1 { 26 class IDisplayBuffer : public V1_0::IDisplayBuffer { 27 public: 28 virtual ~IDisplayBuffer() = default; 29 30 /** 31 * @brief Obtains all interfaces of IDisplayBuffer. 32 * 33 * @return Returns <b>IDisplayBuffer*</b> if the operation is successful; returns an null point otherwise. 34 * @since 4.0 35 * @version 1.0 36 */ 37 static IDisplayBuffer *Get(); 38 virtual int32_t RegisterBuffer(const BufferHandle& handle) = 0; 39 virtual int32_t SetMetadata(const BufferHandle& handle, uint32_t key, const std::vector<uint8_t>& value) = 0; 40 virtual int32_t GetMetadata(const BufferHandle& handle, uint32_t key, std::vector<uint8_t>& value) = 0; 41 virtual int32_t ListMetadataKeys(const BufferHandle& handle, std::vector<uint32_t>& keys) = 0; 42 virtual int32_t EraseMetadataKey(const BufferHandle& handle, uint32_t key) = 0; 43 }; 44 } // namespace V1_1 45 } // namespace Buffer 46 } // namespace Display 47 } // namespace HDI 48 } // namespace OHOS 49 50 #endif // OHOS_HDI_DISPLAY_V1_1_IDISPLAY_BUFFER_H 51