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 */ 15 16 #include "system_defined_form.h" 17 18 namespace OHOS { 19 namespace UDMF { SystemDefinedForm()20SystemDefinedForm::SystemDefinedForm() 21 { 22 this->dataType_ = SYSTEM_DEFINED_FORM; 23 } 24 GetSize()25int64_t SystemDefinedForm::GetSize() 26 { 27 return UnifiedDataUtils::GetDetailsSize(this->details_) + sizeof(formId_) + this->formName_.size() 28 + this->bundleName_.size() + this->abilityName_.size() + this->module_.size(); 29 } 30 GetFormId() const31int32_t SystemDefinedForm::GetFormId() const 32 { 33 return this->formId_; 34 } 35 SetFormId(const int32_t & formId)36void SystemDefinedForm::SetFormId(const int32_t &formId) 37 { 38 this->formId_ = formId; 39 } 40 GetFormName() const41std::string SystemDefinedForm::GetFormName() const 42 { 43 return this->formName_; 44 } 45 SetFormName(const std::string & formName)46void SystemDefinedForm::SetFormName(const std::string &formName) 47 { 48 this->formName_ = formName; 49 } 50 GetBundleName() const51std::string SystemDefinedForm::GetBundleName() const 52 { 53 return this->bundleName_; 54 } 55 SetBundleName(const std::string & bundleName)56void SystemDefinedForm::SetBundleName(const std::string &bundleName) 57 { 58 this->bundleName_ = bundleName; 59 } 60 GetAbilityName() const61std::string SystemDefinedForm::GetAbilityName() const 62 { 63 return this->abilityName_; 64 } 65 SetAbilityName(const std::string & abilityName)66void SystemDefinedForm::SetAbilityName(const std::string &abilityName) 67 { 68 this->abilityName_ = abilityName; 69 } 70 GetModule() const71std::string SystemDefinedForm::GetModule() const 72 { 73 return this->module_; 74 } 75 SetModule(const std::string & module)76void SystemDefinedForm::SetModule(const std::string &module) 77 { 78 this->module_ = module; 79 } 80 } // namespace UDMF 81 } // namespace OHOS 82