• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_EXTENSION_INFO_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_EXTENSION_INFO_H
18 
19 #include <string>
20 
21 #include "parcel.h"
22 #include "application_info.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 enum ExtensionAbilityInfoFlag {
27     GET_EXTENSION_INFO_DEFAULT = 0x00000000,
28     GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002,
29     GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004,
30     GET_EXTENSION_INFO_WITH_METADATA = 0x00000020,
31 };
32 
33 enum class ExtensionAbilityType {
34     FORM = 0,
35     WORK_SCHEDULER,
36     INPUTMETHOD,
37     SERVICE,
38     ACCESSIBILITY,
39     DATASHARE,
40     FILESHARE,
41     STATICSUBSCRIBER,
42     WALLPAPER,
43     UNSPECIFIED
44 };
45 
46 struct ExtensionAbilityInfo : public Parcelable {
47     std::string bundleName;
48     std::string moduleName;
49     std::string name;
50     std::string srcEntrance;
51     std::string icon;
52     int32_t iconId = 0;
53     std::string label;
54     int32_t labelId = 0;
55     std::string description;
56     int32_t descriptionId = 0;
57     int32_t priority = 0;
58     std::vector<std::string> permissions;
59     std::string readPermission;
60     std::string writePermission;
61     std::string uri;
62     ExtensionAbilityType type;
63     bool visible = false;
64     std::vector<Metadata> metadata;
65     ApplicationInfo applicationInfo;
66     // set when install
67     std::string resourcePath;
68     bool enabled = true;
69     std::string process;
70 
71     bool ReadFromParcel(Parcel &parcel);
72     virtual bool Marshalling(Parcel &parcel) const override;
73     static ExtensionAbilityInfo *Unmarshalling(Parcel &parcel);
74 };
75 }  // namespace AppExecFwk
76 }  // namespace OHOS
77 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_EXTENSION_INFO_H