• 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 package ohos;
17 
18 import java.util.ArrayList;
19 import java.util.List;
20 
21 /**
22  * Ability form info.
23  *
24  */
25 public class AbilityFormInfo {
26 
27     /**
28      * Module window info.
29      *
30      */
31     public static class ModuleWindowInfo {
32         /**
33          * Indicates the designWidth of ModuleUsedScene.
34          */
35         public int designWidth = 0;
36         /**
37          * Indicates the autoDesignWidth of ModuleUsedScene.
38          */
39         public boolean autoDesignWidth = false;
40     }
41 
42     /**
43      * Indicates the name of ability form.
44      */
45     public String name = "";
46 
47     /**
48      * Indicates the type of ability form.
49      */
50     public String type = "";
51 
52     /**
53      * Indicates whether or not this form is allowed to update periodically.
54      */
55     public boolean updateEnabled = false;
56 
57     /**
58      * Indicates the scheduledUpdateTime of ability form.
59      */
60     public String scheduledUpdateTime = "";
61 
62     /**
63      * Indicates the update duration, unit: 30 mins.
64      */
65     public int updateDuration = 1;
66 
67     /**
68      * Indicates the supportDimensions of ability form.
69      */
70     public List<String> supportDimensions = new ArrayList<String>();
71 
72     /**
73      * Indicates the defaultDimension of ability form.
74      */
75     public String defaultDimension = "";
76 
77     /**
78      * Indicates the metaData of ability form.
79      */
80     public MetaData metaData = new MetaData();
81 
82     // stage module attributes
83     /**
84      * Indicates the description of ability form.
85      */
86     public String description = "";
87 
88     /**
89      * Indicates the src of ability form the attribute is corresponding to the UI code of the form.
90      */
91     public String src = "";
92 
93     /**
94      * Indicates the window of ability form.
95      */
96     public ModuleWindowInfo windowInfo = new ModuleWindowInfo();
97 
98     /**
99      * Indicates the isDefault of ability form.
100      */
101     public boolean isDefault = false;
102 
103     /**
104      * Indicates the colorMode of ability form.
105      */
106     public String colorMode = "auto";
107 
108     /**
109      * Indicates the formConfigAbility of ability form, it is the ability name for card.
110      */
111     public String formConfigAbility = "";
112 
113     /**
114      * Indicates the formVisibleNotify of ability form.
115      */
116     public boolean formVisibleNotify = false;
117 
118     /**
119      * Indicates the providerAbility of ability form.
120      */
121     public String providerAbility = "";
122 
123     /**
124      * get the customize Data value defined in this ability form.
125      */
getCustomizeDataValue(String customizeDataName)126     public String getCustomizeDataValue(String customizeDataName) {
127         for (CustomizeData data : metaData.customizeDatas) {
128             if (customizeDataName.equals(data.name)) {
129                 return data.value;
130             }
131         }
132         return "";
133     }
134 }