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 */ 15import { Permissions } from '@ohos.abilityAccessCtrl'; 16 17export class appInfo { 18 bundleName: string 19 api: number 20 tokenId: number 21 icon: ResourceStr | PixelMap 22 iconId: number 23 label: string 24 labelId: number 25 permissions: Permissions[] 26 groupId: number[] 27 zhTag: string 28 indexTag: string 29 language: string 30 31 constructor(bundleName: string, api: number, tokenId: number, icon: ResourceStr | PixelMap, iconId: number, label: string, labelId: number, permissions: Permissions[], groupId: number[], zhTag: string, indexTag: string, language: string) { 32 this.bundleName = bundleName 33 this.api = api 34 this.tokenId = tokenId 35 this.icon = icon 36 this.iconId = iconId 37 this.label = label 38 this.labelId = labelId 39 this.permissions = permissions 40 this.groupId = groupId 41 this.zhTag = zhTag 42 this.indexTag = indexTag 43 this.language = language 44 } 45}; 46 47export class permissionApplications { 48 permission: Permissions 49 groupName: string 50 bundleNames: string[] 51 icon: ResourceStr 52 53 constructor(permission: Permissions, groupName: string, bundleNames: string[], icon: ResourceStr) { 54 this.permission = permission 55 this.groupName = groupName 56 this.bundleNames = bundleNames 57 this.icon = icon 58 } 59}; 60 61export class groupPermission { 62 group: string 63 permissions: string[] 64 groupName: ResourceStr 65 icon: ResourceStr 66 isShow:boolean 67 68 constructor(group: string, permissions: string[], groupName: ResourceStr, icon: ResourceStr, isShow:boolean) { 69 this.group = group 70 this.permissions = permissions 71 this.groupName = groupName 72 this.icon = icon 73 this.isShow = isShow 74 } 75}; 76 77export class ApplicationObj { 78 label: string 79 icon: ResourceStr | PixelMap 80 index: number 81 accessTokenId: number 82 permission: Permissions 83 zhTag: string 84 indexTag: string 85 language: string 86 bundleName?: string 87 constructor(label: string, icon: ResourceStr | PixelMap, index: number, accessTokenId: number, permission: Permissions, zhTag: string, indexTag: string, language: string, bundleName?: string,) { 88 this.label = label 89 this.icon = icon 90 this.index = index 91 this.accessTokenId = accessTokenId 92 this.permission = permission 93 this.zhTag = zhTag 94 this.indexTag = indexTag 95 this.language = language 96 this.bundleName = bundleName 97 } 98} 99 100export class CalendarObj { 101 permissionName: string 102 groupName: string 103 label: ResourceStr 104 index: number 105 constructor(permissionName: string, groupName: string, label: ResourceStr, index: number) { 106 this.permissionName = permissionName 107 this.groupName = groupName 108 this.label = label 109 this.index = index 110 } 111} 112 113export class MediaDocObj { 114 name: Resource 115 accessTokenId: number 116 permissions: Array<Permissions> 117 index: number 118 constructor(name: Resource, accessTokenId: number, permissions: Array<Permissions>, index: number) { 119 this.name = name 120 this.accessTokenId = accessTokenId 121 this.permissions = permissions 122 this.index = index 123 } 124} 125 126export class permissionObj { 127 groupName: ResourceStr; 128 permission: string[]; 129 group: string; 130 constructor(groupName: ResourceStr, permission: string[], group: string) { 131 this.groupName = groupName; 132 this.permission = permission; 133 this.group = group 134 } 135} 136 137export class StringObj { 138 morning: string 139 afternoon: string 140 constructor(morning: string, afternoon: string) { 141 this.morning = morning 142 this.afternoon = afternoon 143 } 144} 145 146export class appInfoSimple { 147 bundleName: string 148 api: number 149 tokenId: number 150 icon: ResourceStr | PixelMap 151 label: ResourceStr 152 permissions: Array<string> 153 groupId: Array<number> 154 155 constructor(bundleName: string, api: number, tokenId: number, icon: ResourceStr | PixelMap, label: ResourceStr, permissions: Array<string>, groupId: Array<number>) { 156 this.bundleName = bundleName 157 this.api = api 158 this.tokenId = tokenId 159 this.icon = icon 160 this.label = label 161 this.permissions = permissions 162 this.groupId = groupId 163 } 164} 165 166export class param { 167 icon: Resource 168 label: Resource 169 170 constructor(icon: Resource, label: Resource) { 171 this.icon = icon 172 this.label = label 173 } 174}; 175 176export class otherPermission { 177 permissionLabel: ResourceStr 178 permission: string 179 180 constructor(permissionLabel: ResourceStr, permission: string) { 181 this.permissionLabel = permissionLabel 182 this.permission = permission 183 } 184} 185 186export class PermissionInfo { 187 permissionName: string 188 groupName: string 189 label: ResourceStr 190 groupId: number 191 enable_description_start?: ResourceStr 192 enable_description_end?: ResourceStr 193 forbidden_description?: ResourceStr 194 195 constructor(permissionName: string, groupName: string, label: ResourceStr, groupId: number, enable_description_start?: ResourceStr, enable_description_end?: ResourceStr, forbidden_description?: ResourceStr,) { 196 this.permissionName = permissionName; 197 this.groupName = groupName; 198 this.label = label; 199 this.groupId = groupId; 200 this.enable_description_start = enable_description_start; 201 this.enable_description_end = enable_description_end; 202 this.forbidden_description = forbidden_description; 203 } 204} 205 206export class GroupInfo { 207 name: string 208 groupName: ResourceStr 209 label: ResourceStr 210 icon: ResourceStr 211 description: Array<ResourceStr> 212 reason: string 213 permissions: Array<Permissions> 214 isShow: boolean 215 enable_description_start?: ResourceStr 216 enable_description_end?: ResourceStr 217 forbidden_description?: ResourceStr 218 219 constructor(name: string, groupName: ResourceStr, label: ResourceStr, icon: ResourceStr, description: Array<ResourceStr>, reason: string, permissions: Array<Permissions>, isShow: boolean, enable_description_start?: ResourceStr, enable_description_end?: ResourceStr, forbidden_description?: ResourceStr) { 220 this.name = name; 221 this.groupName = groupName; 222 this.label = label; 223 this.icon = icon; 224 this.description = description; 225 this.reason = reason; 226 this.permissions = permissions; 227 this.isShow = isShow; 228 this.enable_description_start = enable_description_start; 229 this.enable_description_end = enable_description_end; 230 this.forbidden_description = forbidden_description; 231 } 232} 233 234export class appRecordInfo { 235 groupName: ResourceStr 236 icon: ResourceStr | PixelMap 237 name: string 238 api: number 239 accessTokenId: number 240 reqUserPermissions: string[] 241 permissions: appGroupRecordInfo[] 242 groupNames: ResourceStr[] 243 groupIds: number[] 244 appLastTime: number 245 246 constructor(groupName: ResourceStr, icon: ResourceStr | PixelMap, name: string, api: number, accessTokenId: number, reqUserPermissions: string[], permissions: appGroupRecordInfo[], groupNames: ResourceStr[], groupIds: number[], appLastTime: number) { 247 this.groupName = groupName 248 this.icon = icon 249 this.name = name 250 this.api = api 251 this.accessTokenId = accessTokenId 252 this.reqUserPermissions = reqUserPermissions 253 this.permissions = permissions 254 this.groupNames = groupNames 255 this.groupIds = groupIds 256 this.appLastTime = appLastTime 257 } 258} 259 260export class GroupRecordInfo { 261 name: string 262 groupName: ResourceStr 263 label: ResourceStr 264 icon: ResourceStr 265 permissions: Array<Permissions> 266 sum: number 267 recentVisit: number 268 269 constructor(name: string, groupName: ResourceStr, label: ResourceStr, icon: ResourceStr, permissions: Array<Permissions>, sum: number, recentVisit: number) { 270 this.name = name; 271 this.groupName = groupName; 272 this.label = label; 273 this.icon = icon; 274 this.permissions = permissions; 275 this.sum = sum; 276 this.recentVisit = recentVisit; 277 } 278} 279 280export class appGroupRecordInfo { 281 name: string 282 groupName: ResourceStr 283 label: ResourceStr 284 icon: ResourceStr 285 count: number 286 lastTime: number 287 288 constructor(name: string, groupName: ResourceStr, label: ResourceStr, icon: ResourceStr, count: number, lastTime: number) { 289 this.name = name; 290 this.groupName = groupName; 291 this.label = label; 292 this.icon = icon; 293 this.count = count; 294 this.lastTime = lastTime; 295 } 296} 297 298export class routerParams_1 { 299 list: permissionApplications[] 300 backTitle: ResourceStr 301 group: string 302 globalIsOn: boolean 303 304 constructor(list: permissionApplications[], backTitle: ResourceStr, group: string, globalIsOn: boolean) { 305 this.list = list 306 this.backTitle = backTitle 307 this.group = group 308 this.globalIsOn = globalIsOn 309 } 310} 311 312export class routerParams_2 { 313 list: permissionApplications[] 314 backTitle: ResourceStr 315 permissionName: string 316 317 constructor(list: permissionApplications[], backTitle: ResourceStr, permissionName: string) { 318 this.list = list 319 this.backTitle = backTitle 320 this.permissionName = permissionName 321 } 322} 323 324export class routerParams_3 { 325 bundleName: string 326 backTitle: ResourceStr 327 permission: Permissions[] 328 status: number 329 tokenId: number 330 331 constructor(bundleName: string, backTitle: ResourceStr, permission: Permissions[], status: number, tokenId: number) { 332 this.bundleName = bundleName 333 this.backTitle = backTitle 334 this.permission = permission 335 this.status = status 336 this.tokenId = tokenId 337 } 338} 339 340export class wantInfo { 341 parameters: Object[] 342 343 constructor(parameters: Object[]) { 344 this.parameters = parameters 345 } 346}