1 /* 2 * Copyright (c) 2024 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 ACCESS_FORM_INSTANCE_H 17 #define ACCESS_FORM_INSTANCE_H 18 19 #include <sys/types.h> 20 21 #include "parcel.h" 22 #include "iremote_object.h" 23 24 namespace OHOS { 25 namespace Security { 26 namespace AccessToken { 27 enum class FormUsageState { 28 USED = 0, 29 UNUSED, 30 }; 31 32 enum class FormVisibilityType { 33 UNKNOWN = 0, 34 VISIBLE, 35 INVISIBLE, 36 }; 37 38 enum class FormLocation : int8_t { 39 OTHER = -1, 40 DESKTOP = 0, 41 FORM_CENTER = 1, 42 FORM_MANAGER = 2, 43 NEGATIVE_SCREEN = 3, 44 FORM_CENTER_NEGATIVE_SCREEN = 4, 45 FORM_MANAGER_NEGATIVE_SCREEN = 5, 46 SCREEN_LOCK = 6, 47 AI_SUGGESTION = 7, 48 }; 49 50 struct FormInstance : public Parcelable { 51 int64_t formId_ = 0; 52 std::string formHostName_ = ""; 53 FormVisibilityType formVisiblity_ = FormVisibilityType::UNKNOWN; 54 int32_t specification_ = 0; 55 std::string bundleName_ = ""; 56 std::string moduleName_ = ""; 57 std::string abilityName_ = ""; 58 std::string formName_ = ""; 59 FormUsageState formUsageState_ = FormUsageState::USED; 60 std::string description_; 61 int32_t appIndex_ = 0; 62 int32_t userId_ = -1; 63 64 bool ReadFromParcel(Parcel &parcel); 65 bool Marshalling(Parcel &parcel) const override; 66 static FormInstance *Unmarshalling(Parcel &parcel); 67 }; 68 } // namespace AccessToken 69 } // namespace Security 70 } // namespace OHOS 71 72 #endif // ACCESS_FORM_INSTANCE_H 73