1 /* 2 * Copyright (c) 2021-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 OHOS_FORM_FWK_FORM_RECORD_H 17 #define OHOS_FORM_FWK_FORM_RECORD_H 18 19 #include <vector> 20 #include "form_constants.h" 21 #include "form_info_base.h" 22 #include "form_instance.h" 23 #include "form_provider_info.h" 24 #include "application_info.h" 25 #include "want.h" 26 27 namespace OHOS { 28 namespace AppExecFwk { 29 using Want = OHOS::AAFwk::Want; 30 /** 31 * @class FormRecord 32 * Form data. 33 */ 34 class FormRecord { 35 public: 36 int64_t formId = 0; 37 bool isInited = false; 38 bool needFreeInstall = false; 39 bool versionUpgrade = false; 40 bool needRefresh = false; 41 int refreshType; 42 bool needAddForm = false; 43 bool isCountTimerRefresh = false; 44 std::string packageName = ""; 45 std::string bundleName = ""; 46 std::string moduleName = ""; // ExtensionAbility module name 47 std::string abilityName = ""; 48 std::string formName = ""; 49 int32_t specification; 50 bool isEnableUpdate = false; 51 bool isVisible = false; 52 int64_t updateDuration = 0; 53 int updateAtHour = -1; 54 int updateAtMin = -1; 55 std::vector<std::vector<int>> updateAtTimes; 56 FormProviderInfo formProviderInfo; 57 std::vector<std::string> hapSourceDirs; 58 std::map<std::string, std::string> modulePkgNameMap; 59 std::string jsFormCodePath = ""; 60 bool formTempFlag = false; 61 std::vector<int> formUserUids; 62 bool formVisibleNotify = false; 63 int formVisibleNotifyState = 0; 64 int32_t userId = 0; 65 int32_t providerUserId = Constants::DEFAULT_PROVIDER_USER_ID; 66 std::string formSrc = ""; 67 FormWindow formWindow; 68 uint32_t versionCode = 0; 69 std::string versionName = ""; 70 uint32_t compatibleVersion = 0; 71 FormType type = FormType::JS; 72 FormType uiSyntax = FormType::JS; 73 bool isDynamic = true; 74 bool transparencyEnabled = false; 75 bool isTimerRefresh = false; 76 bool isHostRefresh = false; 77 bool isDataProxy = false; 78 bool isDataProxyIgnoreFormVisible = false; 79 bool isSystemApp = false; 80 int32_t uid = 0; 81 std::string description = ""; 82 int32_t privacyLevel = 0; 83 bool isNeedNotify = true; 84 RecycleStatus recycleStatus = RecycleStatus::NON_RECYCLABLE; 85 Constants::FormLocation formLocation; 86 bool isThemeForm = false; 87 BundleType formBundleType = BundleType::APP; 88 bool enableForm = true; 89 bool isRefreshDuringDisableForm = false; 90 bool isUpdateDuringDisableForm = false; 91 Constants::RenderingMode renderingMode = Constants::RenderingMode::FULL_COLOR; 92 bool lockForm = false; 93 bool protectForm = false; 94 std::vector<int32_t> conditionUpdate; 95 std::map<int64_t, Want> wantCacheMap; 96 bool isLocationChange = false; 97 bool isExistRecycleTask = false; 98 bool isDataProxyUpdate = false; 99 bool isDistributedForm = false; 100 std::string uiModule = ""; // widget module name 101 }; 102 } // namespace AppExecFwk 103 } // namespace OHOS 104 105 #endif // OHOS_FORM_FWK_FORM_RECORD_H 106