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 ACCESSIBILITY_CAPTION_PARCEL_H
17#define ACCESSIBILITY_CAPTION_PARCEL_H
18
19#include "accessibility_caption.h"
20#include "parcel.h"
21
22namespace OHOS {
23namespace Accessibility {
24class CaptionPropertyParcel : public AccessibilityConfig::CaptionProperty, public Parcelable {
25public:
26    CaptionPropertyParcel() = default;
27    explicit CaptionPropertyParcel(const AccessibilityConfig::CaptionProperty &property);
28    /**
29     * @brief read this sequenceable object from a Parcel.
30     * @param parcel Indicates the Parcel object into which the sequenceable
31     * object has been marshaled.
32     * @return Return true if read successfully, else return false.
33     */
34    bool ReadFromParcel(Parcel& parcel);
35
36    /**
37     * @brief Marshals this sequenceable object into a Parcel.
38     * @param parcel Indicates the Parcel object to which the sequenceable
39     * object will be marshaled.
40     * @return Return true if Marshal successfully, else return false.
41     */
42    bool Marshalling(Parcel& parcel) const override;
43
44    /**
45     * @brief Unmarshals this sequenceable object from a Parcel.
46     * @param parcel Indicates the Parcel object into which the sequenceable
47     * object has been marshaled.
48     * @return Return a sequenceable object of CaptionPropertyParcel.
49     */
50    static sptr<CaptionPropertyParcel> Unmarshalling(Parcel& parcel);
51};
52} // namespace Accessibility
53} // namespace OHOS
54#endif  // ACCESSIBILITY_CAPTION_H