• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_appitem.h"
17 
18 namespace OHOS {
19 namespace UDMF {
SystemDefinedAppItem()20 SystemDefinedAppItem::SystemDefinedAppItem()
21 {
22     this->dataType_ = SYSTEM_DEFINED_APP_ITEM;
23 }
24 
GetSize()25 int64_t SystemDefinedAppItem::GetSize()
26 {
27     return UnifiedDataUtils::GetDetailsSize(this->details_) + this->appId_.size() + this->appName_.size()
28            + this->appIconId_.size() + this->appLabelId_.size() + this->bundleName_.size() + this->abilityName_.size();
29 }
30 
GetAppId() const31 std::string SystemDefinedAppItem::GetAppId() const
32 {
33     return this->appId_;
34 }
35 
SetAppId(const std::string & appId)36 void SystemDefinedAppItem::SetAppId(const std::string &appId)
37 {
38     this->appId_ = appId;
39 }
40 
GetAppName() const41 std::string SystemDefinedAppItem::GetAppName() const
42 {
43     return this->appName_;
44 }
45 
SetAppName(const std::string & appName)46 void SystemDefinedAppItem::SetAppName(const std::string &appName)
47 {
48     this->appName_ = appName;
49 }
50 
GetAppIconId() const51 std::string SystemDefinedAppItem::GetAppIconId() const
52 {
53     return this->appIconId_;
54 }
55 
SetAppIconId(const std::string & appIconId)56 void SystemDefinedAppItem::SetAppIconId(const std::string &appIconId)
57 {
58     this->appIconId_ = appIconId;
59 }
60 
GetAppLabelId() const61 std::string SystemDefinedAppItem::GetAppLabelId() const
62 {
63     return this->appLabelId_;
64 }
65 
SetAppLabelId(const std::string & appLabelId)66 void SystemDefinedAppItem::SetAppLabelId(const std::string &appLabelId)
67 {
68     this->appLabelId_ = appLabelId;
69 }
70 
GetBundleName() const71 std::string SystemDefinedAppItem::GetBundleName() const
72 {
73     return this->bundleName_;
74 }
75 
SetBundleName(const std::string & bundleName)76 void SystemDefinedAppItem::SetBundleName(const std::string &bundleName)
77 {
78     this->bundleName_ = bundleName;
79 }
80 
GetAbilityName() const81 std::string SystemDefinedAppItem::GetAbilityName() const
82 {
83     return this->abilityName_;
84 }
85 
SetAbilityName(const std::string & abilityName)86 void SystemDefinedAppItem::SetAbilityName(const std::string &abilityName)
87 {
88     this->abilityName_ = abilityName;
89 }
90 } // namespace UDMF
91 } // namespace OHOS