• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_FORM_INFO_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_FORM_INFO_H
18 
19 #include <string>
20 #include "parcel.h"
21 
22 namespace OHOS {
23 namespace AppExecFwk {
24 enum class FormsColorMode {
25     AUTO_MODE = -1,
26     DARK_MODE = 0,
27     LIGHT_MODE = 1,
28 };
29 
30 enum class FormType {
31     JAVA = 0,
32     JS = 1,
33 };
34 
35 struct FormCustomizeData {
36     std::string name;
37     std::string value;
38 };
39 
40 struct FormInfo : public Parcelable {
41     std::string package;
42     std::string bundleName;
43     std::string originalBundleName;
44     std::string relatedBundleName;
45     std::string moduleName;  // the "module.distro.moduleName" in config.json
46     std::string abilityName;
47     std::string name;
48     std::string description;
49     std::string jsComponentName;
50     std::string deepLink;
51     std::string formConfigAbility;
52     std::string scheduledUpateTime = "0:0";
53     int32_t descriptionId = 0;
54     int32_t updateDuration = 0;
55     int32_t defaultDimension = 0;
56     bool defaultFlag = false;
57     bool formVisibleNotify = false;
58     bool updateEnabled = false;
59     FormType type = FormType::JS;
60     std::vector<int32_t> supportDimensions;
61     FormsColorMode colorMode = FormsColorMode::AUTO_MODE;
62     std::vector<std::string> landscapeLayouts;
63     std::vector<std::string> portraitLayouts;
64     std::vector<FormCustomizeData> customizeDatas;
65 
66     bool ReadFromParcel(Parcel &parcel);
67     virtual bool Marshalling(Parcel &parcel) const override;
68     static FormInfo *Unmarshalling(Parcel &parcel);
69 };
70 }  // namespace AppExecFwk
71 }  // namespace OHOS
72 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_FORM_H
73