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
16package ohos.hdi.display.buffer.v1_0;
17
18import ohos.hdi.display.buffer.v1_0.DisplayBufferType;
19
20interface IMapper {
21    /**
22     * @brief the function to free memory
23     *
24     * @param handle The input buffer handle
25     *
26     * @return Returns <b>0</b> if the operation is successful; returns an error code defined
27     * in {@link DispErrCode} otherwise.
28     * @since 4.0
29     * @version 1.0
30     */
31    FreeMem([in] NativeBuffer handle);
32
33    /**
34     * @brief map buffer handle
35     *
36     * @param handle The input buffer handle
37     *
38     * @return Returns <b>0</b> if the operation is successful; returns an error code defined
39     * in {@link DispErrCode} otherwise.
40     * @since 4.0
41     * @version 1.0
42     */
43    Mmap([in] NativeBuffer handle);
44
45    /**
46     * @brief unmap buffer handle
47     *
48     * @param handle The input buffer handle
49     *
50     * @return Returns <b>0</b> if the operation is successful; returns an error code defined
51     * in {@link DispErrCode} otherwise.
52     * @since 4.0
53     * @version 1.0
54     */
55    Unmap([in] NativeBuffer handle);
56
57    /**
58     * @brief flush buffer handle cache
59     *
60     * @param handle The input buffer handle
61     *
62     * @return Returns <b>0</b> if the operation is successful; returns an error code defined
63     * in {@link DispErrCode} otherwise.
64     * @since 4.0
65     * @version 1.0
66     */
67    FlushCache([in] NativeBuffer handle);
68
69    /**
70     * @brief invalidate buffer handle cache
71     *
72     * @param handle The input buffer handle
73     *
74     * @return Returns <b>0</b> if the operation is successful; returns an error code defined
75     * in {@link DispErrCode} otherwise.
76     * @since 4.0
77     * @version 1.0
78     */
79    InvalidateCache([in] NativeBuffer handle);
80}
81