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 #ifndef FOUNDATION_BUNDLEMANAGER_BUNDLE_FRAMEWORK_SERVICES_BUNDLEMGR_BUNDLE_RESOURCE_DRAWABLE_H 17 #define FOUNDATION_BUNDLEMANAGER_BUNDLE_FRAMEWORK_SERVICES_BUNDLEMGR_BUNDLE_RESOURCE_DRAWABLE_H 18 19 #include <string> 20 21 #include "resource_manager.h" 22 #include "resource_info.h" 23 24 #ifdef BUNDLE_FRAMEWORK_GRAPHICS 25 #include "pixel_map.h" 26 #endif 27 28 namespace OHOS { 29 namespace AppExecFwk { 30 class BundleResourceDrawable { 31 public: 32 bool GetIconResourceByTheme( 33 const uint32_t iconId, 34 const int32_t density, 35 std::shared_ptr<Global::Resource::ResourceManager> resourceManager, 36 ResourceInfo &resourceInfo); 37 38 bool GetIconResourceByHap( 39 const uint32_t iconId, 40 const int32_t density, 41 std::shared_ptr<Global::Resource::ResourceManager> resourceManager, 42 ResourceInfo &resourceInfo); 43 44 bool ProcessForegroundIcon( 45 std::pair<std::unique_ptr<uint8_t[]>, size_t> &foregroundInfo, 46 ResourceInfo &resourceInfo); 47 48 #ifdef BUNDLE_FRAMEWORK_GRAPHICS 49 bool GetBadgedIconResource( 50 const std::shared_ptr<Media::PixelMap> layeredPixelMap, 51 const std::shared_ptr<Media::PixelMap> badgedPixelMap, 52 ResourceInfo &resourceInfo); 53 #endif 54 }; 55 } // AppExecFwk 56 } // OHOS 57 #endif // FOUNDATION_BUNDLEMANAGER_BUNDLE_FRAMEWORK_SERVICES_BUNDLEMGR_BUNDLE_RESOURCE_DRAWABLE_H 58