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 #ifndef OHOS_FORM_FWK_FORM_INFO_FILTER_H
16 #define OHOS_FORM_FWK_FORM_INFO_FILTER_H
17 
18 #include "parcel.h"
19 
20 namespace OHOS {
21 namespace AppExecFwk {
22 /**
23  * @brief This struct is mainly used by function getFormsInfo as a filter to retrieve only formInfos
24  * that has desired attributes, e.g. the formInfo is belong to a module with the same moduleName as specifed
25  * in FormInfoFilter.
26  */
27 struct FormInfoFilter final : public Parcelable {
28     // list of parameters
29     std::string bundleName = "";
30     std::string moduleName = "";
31     std::vector<int32_t> supportDimensions;
32     std::vector<int32_t> supportShapes;
33 
34     /**
35      * @brief Serialize the list of parameters for IPC.
36      *
37      * @param parcel The container into which the serialized parameters write.
38      * @return true when serialization is successful, false otherwise.
39      */
40     bool Marshalling(Parcel &parcel) const override;
41 
42     /**
43      * @brief Deserialize the list of parameters from IPC
44      *
45      * @param parcel The container from which the serialized parameters read.
46      * @return true when deserialization is successful, false otherwise.
47      */
48     static FormInfoFilter *Unmarshalling(Parcel &parcel);
49 };
50 } // AppExecFwk
51 } // OHOS
52 #endif