• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_SHORTCUT_INFO_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_SHORTCUT_INFO_H
18 
19 #include <string>
20 #include <vector>
21 #include "parcel.h"
22 
23 namespace OHOS {
24 namespace AppExecFwk {
25 struct ShortcutWant {
26     std::string bundleName;
27     std::string moduleName;
28     std::string abilityName;
29 };
30 
31 struct Shortcut {
32     std::string shortcutId;
33     std::string icon;
34     int32_t iconId = 0;
35     std::string label;
36     int32_t labelId = 0;
37     std::vector<ShortcutWant> wants;
38 };
39 
40 struct ShortcutJson {
41     std::vector<Shortcut> shortcuts;
42 };
43 
44 struct ShortcutIntent {
45     std::string targetBundle;
46     std::string targetModule;
47     std::string targetClass;
48 };
49 
50 struct ShortcutInfo : public Parcelable {
51     std::string id;
52     std::string bundleName;
53     std::string moduleName;
54     std::string hostAbility;
55     int32_t iconId;
56     int32_t labelId;
57     std::string icon;
58     std::string label;
59     std::string disableMessage;
60     std::vector<ShortcutIntent> intents;
61     bool isStatic = false;
62     bool isHomeShortcut = false;
63     bool isEnables = false;
64 
65     bool ReadFromParcel(Parcel &parcel);
66     virtual bool Marshalling(Parcel &parcel) const override;
67     static ShortcutInfo *Unmarshalling(Parcel &parcel);
68 };
69 }  // namespace AppExecFwk
70 }  // namespace OHOS
71 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_SHORTCUT_INFO_H