1 /* 2 * Copyright (c) 2020 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 OHOS_BUNDLE_CALLBACK_UTILS_H 17 #define OHOS_BUNDLE_CALLBACK_UTILS_H 18 19 #include <string> 20 21 #include "ability_info.h" 22 #include "appexecfwk_errors.h" 23 #include "bundle_info.h" 24 #include "bundle_manager.h" 25 #include "bundle_status_callback.h" 26 27 namespace OHOS { 28 const char INSTALL_SUCCESS[] = "install success !"; 29 const char UNINSTALL_SUCCESS[] = "uninstall success !"; 30 31 enum { 32 INSTALL_CALLBACK, 33 UNINSTALL_CALLBACK 34 }; 35 36 std::string ObtainErrorMessage(uint8_t errorCode); 37 } // namespace 38 39 struct ResultOfQueryAbilityInfo { 40 uint8_t resultCode; 41 AbilityInfo *abilityInfo; 42 }; 43 44 struct ResultOfGetBundleInfo { 45 uint8_t resultCode; 46 BundleInfo *bundleInfo; 47 }; 48 49 struct ResultOfGetBundleInfos { 50 uint8_t resultCode; 51 int32_t length; 52 BundleInfo *bundleInfo; 53 }; 54 55 struct ResultOfGetBundleNameForUid { 56 uint8_t resultCode; 57 char *bundleName; 58 int32_t length; 59 }; 60 61 struct ResultOfGetSysCap { 62 uint8_t resultCode; 63 SystemCapability systemCap; 64 }; 65 66 struct BundleCallbackInfo { 67 BundleStateCallback bundleStateCallback; 68 void *data; 69 }; 70 71 struct ResultOfGetBundleSize { 72 uint8_t resultCode; 73 uint32_t bundleSize; 74 }; 75 76 struct BasicInfo { 77 char *metaDataKey; 78 int32_t flags; 79 }; 80 #endif // OHOS_BUNDLE_CALLBACK_UTILS_H