/base/global/resource_management/frameworks/resmgr/test/unittest/common/ |
H A D | theme_config_test.cpp | 41 std::shared_ptr<ResConfigImpl> resConfig; member in __anon284::ThemeConfigTest 58 this->resConfig = std::make_shared<ResConfigImpl>(); in SetUp() 96 this->resConfig->SetDirection(DIRECTION_NOT_SET); in HWTEST_F() 97 bool ret = this->themeConfig->Match(themeConfig, *this->resConfig); in HWTEST_F() 100 this->resConfig->SetDirection(DIRECTION_VERTICAL); in HWTEST_F() 101 ret = this->themeConfig->Match(themeConfig, *this->resConfig); in HWTEST_F() 104 this->resConfig->SetDirection(DIRECTION_NOT_SET); in HWTEST_F() 106 ret = this->themeConfig->Match(themeConfig, *this->resConfig); in HWTEST_F() 118 this->resConfig->SetDirection(DIRECTION_VERTICAL); in HWTEST_F() 119 bool ret = this->themeConfig->Match(themeConfig, *this->resConfig); in HWTEST_F() [all...] |
H A D | test_common.cpp | 74 ResConfig *resConfig = CreateResConfig(); in CreateResConfig() local 75 if (resConfig == nullptr) { in CreateResConfig() 78 resConfig->SetLocaleInfo(language, script, region); in CreateResConfig() 79 return resConfig; in CreateResConfig() 92 std::shared_ptr<ResConfigImpl> resConfig = std::make_shared<ResConfigImpl>(); in InitDefaultResConfig() local 93 if (resConfig == nullptr) { in InitDefaultResConfig() 96 resConfig->SetAppDarkRes(true); in InitDefaultResConfig() 97 return resConfig; in InitDefaultResConfig()
|
/base/global/resource_management/frameworks/resmgr/src/ |
H A D | theme_pack_config.cpp | 34 bool ThemeConfig::Match(const std::shared_ptr<ThemeConfig> &themeConfig, const ResConfigImpl &resConfig) in Match() argument 36 ColorMode colorMode = resConfig.GetColorMode(); in Match() 37 Direction direction = resConfig.GetDirection(); in Match() 45 if (colorMode == DARK && !resConfig.GetAppColorMode() && !resConfig.GetAppDarkRes()) { in Match() 56 bool ThemeConfig::BestMatch(const std::shared_ptr<ThemeConfig> &themeConfig, const ResConfigImpl &resConfig) const in BestMatch() 58 ColorMode colorMode = resConfig.GetColorMode(); in BestMatch() 59 Direction direction = resConfig.GetDirection(); in BestMatch()
|
H A D | resource_manager_impl.cpp | 68 auto resConfig = std::make_shared<ResConfigImpl>(); in Init() local 69 if (resConfig == nullptr) { in Init() 73 hapManager_ = std::make_shared<HapManager>(resConfig, isSystem); in Init() 157 ResConfigImpl resConfig; in GetStringFormatById() local 158 GetResConfig(resConfig); in GetStringFormatById() 159 if (!ReplacePlaceholderWithParams(outValue, resConfig, jsParams)) { in GetStringFormatById() 175 ResConfigImpl resConfig; in GetStringFormatByName() local 176 GetResConfig(resConfig); in GetStringFormatByName() 177 if (!ReplacePlaceholderWithParams(outValue, resConfig, jsParams)) { in GetStringFormatByName() 459 ResConfigImpl resConfig; in GetThemeValues() local 583 ResConfigImpl resConfig; GetThemeFloat() local 599 ResConfigImpl resConfig; GetThemeFloat() local 826 ResConfigImpl resConfig; GetThemeColor() local 1120 UpdateFakeLocaleFlag(ResConfig &resConfig) UpdateFakeLocaleFlag() argument 1149 UpdateResConfig(ResConfig &resConfig, bool isUpdateTheme) UpdateResConfig() argument 1166 UpdateOverrideResConfig(ResConfig &resConfig) UpdateOverrideResConfig() argument 1175 GetResConfig(ResConfig &resConfig) GetResConfig() argument 1180 GetOverrideResConfig(ResConfig &resConfig) GetOverrideResConfig() argument 1209 ResConfigImpl resConfig; GetThemeMedia() local 1267 ResConfigImpl resConfig; GetThemeMediaBase64() local 1530 ResConfigImpl resConfig; GetStringFormatById() local 1545 ResConfigImpl resConfig; GetStringFormatByName() local 1571 ResConfigImpl resConfig; GetFormatPluralStringById() local 1598 ResConfigImpl resConfig; GetFormatPluralStringByName() local [all...] |
H A D | resource_manager.cpp | 55 ResConfig &resConfig, int32_t userId) in CreateResourceManagerDef() 70 uint32_t currentId = resConfig.GetThemeId(); in CreateResourceManagerDef() 99 ResConfig &resConfig, int32_t appType, int32_t userId) in CreateResourceManager() 102 return CreateResourceManagerDef(bundleName, moduleName, hapPath, overlayPath, resConfig, userId); in CreateResourceManager() 52 CreateResourceManagerDef( const std::string &bundleName, const std::string &moduleName, const std::string &hapPath, const std::vector<std::string> &overlayPath, ResConfig &resConfig, int32_t userId) CreateResourceManagerDef() argument 97 CreateResourceManager(const std::string &bundleName, const std::string &moduleName, const std::string &hapPath, const std::vector<std::string> &overlayPath, ResConfig &resConfig, int32_t appType, int32_t userId) CreateResourceManager() argument
|
H A D | theme_pack_manager.cpp | 184 const std::vector<std::shared_ptr<IdItem>> &idItems, const ResConfigImpl &resConfig, bool isThemeSystemResEnable) in FindThemeResource() 196 result = GetThemeResource(tempInfo, resType, resName, resConfig); in FindThemeResource() 198 result = GetThemeResource(bundleInfo, resType, resName, resConfig); in FindThemeResource() 208 const ResType &resType, const std::string &resName, const ResConfigImpl &resConfig) in GetThemeResource() 210 auto themeQualifierValue = GetThemeQualifierValue(bundInfo, resType, resName, resConfig); in GetThemeResource() 239 const std::string &resName, const ResConfigImpl &resConfig) in GetThemeQualifierValue() 245 return GetBestMatchThemeResource(candidates, resConfig); in GetThemeQualifierValue() 249 const std::vector<std::shared_ptr<ThemeResource::ThemeValue> > &candidates, const ResConfigImpl &resConfig) in GetBestMatchThemeResource() 260 if (!ThemeConfig::Match(themeConfig, resConfig)) { in GetBestMatchThemeResource() 268 if (!bestThemeConfig->BestMatch(themeConfig, resConfig)) { in GetBestMatchThemeResource() 183 FindThemeResource(const std::pair<std::string, std::string> &bundleInfo, const std::vector<std::shared_ptr<IdItem>> &idItems, const ResConfigImpl &resConfig, bool isThemeSystemResEnable) FindThemeResource() argument 207 GetThemeResource(const std::pair<std::string, std::string> &bundInfo, const ResType &resType, const std::string &resName, const ResConfigImpl &resConfig) GetThemeResource() argument 237 GetThemeQualifierValue( const std::pair<std::string, std::string> &bundInfo, const ResType &resType, const std::string &resName, const ResConfigImpl &resConfig) GetThemeQualifierValue() argument 248 GetBestMatchThemeResource( const std::vector<std::shared_ptr<ThemeResource::ThemeValue> > &candidates, const ResConfigImpl &resConfig) GetBestMatchThemeResource() argument [all...] |
H A D | native_resource_manager.cpp | 395 ResConfigImpl resConfig;
in OH_ResourceManager_GetConfiguration() local 396 mgr->resManager->GetResConfig(resConfig);
in OH_ResourceManager_GetConfiguration() 398 const icu::Locale *localeInfo = resConfig.GetLocaleInfo();
in OH_ResourceManager_GetConfiguration() 404 configuration->direction = static_cast<::ResourceManager_Direction>(resConfig.GetDirection());
in OH_ResourceManager_GetConfiguration() 405 configuration->deviceType = static_cast<::ResourceManager_DeviceType>(resConfig.GetDeviceType());
in OH_ResourceManager_GetConfiguration() 406 configuration->screenDensity = static_cast<::ScreenDensity>(resConfig.GetScreenDensity());
in OH_ResourceManager_GetConfiguration() 407 configuration->colorMode = static_cast<::ResourceManager_ColorMode>(resConfig.GetColorMode());
in OH_ResourceManager_GetConfiguration() 408 configuration->mcc = resConfig.GetMcc();
in OH_ResourceManager_GetConfiguration() 409 configuration->mnc = resConfig.GetMnc();
in OH_ResourceManager_GetConfiguration()
|
H A D | hap_manager.cpp | 68 HapManager::HapManager(std::shared_ptr<ResConfigImpl> resConfig, bool isSystem) in HapManager() argument 69 : resConfig_(resConfig), isSystem_(isSystem) in HapManager() 260 const auto resConfig = path->GetResConfig(); in MatchBestResource() local 261 if (!currentResConfig->Match(resConfig)) { in MatchBestResource() 265 bestResConfig = resConfig; in MatchBestResource() 269 if (!bestResConfig->IsMoreSuitable(resConfig, currentResConfig, density)) { in MatchBestResource() 270 bestResConfig = resConfig; in MatchBestResource() 349 RState HapManager::UpdateResConfig(ResConfig &resConfig) in UpdateResConfig() argument 352 this->resConfig_->Copy(resConfig); in UpdateResConfig() 356 RState HapManager::UpdateOverrideResConfig(ResConfig &resConfig) in UpdateOverrideResConfig() argument 363 GetResConfig(ResConfig &resConfig) GetResConfig() argument 369 GetOverrideResConfig(ResConfig &resConfig) GetOverrideResConfig() argument [all...] |
/base/global/resource_management_lite/frameworks/resmgr_lite/include/ |
H A D | hap_manager.h | 35 explicit HapManager(ResConfigImpl *resConfig); 43 * Update the resConfig 44 * @param resConfig the resource config 45 * @return SUCCESS if the resConfig updated success, else HAP_INIT_FAILED 47 RState UpdateResConfig(ResConfig &resConfig); 50 * Get the resConfig 51 * @param resConfig the resource config 53 void GetResConfig(ResConfig &resConfig); 100 void UpdateResConfigImpl(ResConfigImpl &resConfig); 102 void GetResConfigImpl(ResConfigImpl &resConfig); [all...] |
H A D | resource_manager.h | 33 virtual RState UpdateResConfig(ResConfig &resConfig) = 0; 35 virtual void GetResConfig(ResConfig &resConfig) = 0;
|
H A D | resource_manager_impl.h | 43 * Update the resConfig 44 * @param resConfig the resource config 45 * @return the resConfig after update 47 virtual RState UpdateResConfig(ResConfig &resConfig); 50 * Get the resConfig 51 * @param resConfig the resource config 53 virtual void GetResConfig(ResConfig &resConfig);
|
/base/global/resource_management_lite/frameworks/resmgr_lite/src/ |
H A D | hap_manager.cpp | 29 HapManager::HapManager(ResConfigImpl *resConfig) in HapManager() argument 30 : resConfig_(resConfig) in HapManager() 135 const ResConfigImpl *resConfig = path->GetResConfig(); in FindQualifierValueByName() local 136 if (!this->resConfig_->Match(resConfig)) { in FindQualifierValueByName() 141 bestResConfig = resConfig; in FindQualifierValueByName() 144 if (!bestResConfig->IsMoreSuitable(resConfig, currentResConfig)) { in FindQualifierValueByName() 145 bestResConfig = resConfig; in FindQualifierValueByName() 167 const ResConfigImpl *resConfig = path->GetResConfig(); in FindQualifierValueById() local 168 if (!this->resConfig_->Match(resConfig)) { in FindQualifierValueById() 173 bestResConfig = resConfig; in FindQualifierValueById() 184 UpdateResConfig(ResConfig &resConfig) UpdateResConfig() argument 196 GetResConfig(ResConfig &resConfig) GetResConfig() argument [all...] |
H A D | global_utils.c | 46 static uint32_t FindOffsetByLangWithScriptOrRegion(char **resConfig, const Key *keys, uint32_t configNum);
47 static uint32_t FindOffsetByAllParam(char **resConfig, const Key *keys, uint32_t configNum);
48 static uint32_t GetIdHeaderOffsetByCount(char **resConfig, const Key *keys, uint32_t configNum, int32_t count);
176 static uint32_t FindOffsetByLangWithScriptOrRegion(char **resConfig, const Key *keys, uint32_t configNum)
in FindOffsetByLangWithScriptOrRegion() argument 178 if (resConfig == NULL || keys == NULL) {
in FindOffsetByLangWithScriptOrRegion() 182 uint32_t languageValue = GetValueFromLocale(resConfig[LANGUAGE_INDEX]);
in FindOffsetByLangWithScriptOrRegion() 183 uint32_t secondValue = GetValueFromLocale(resConfig[1]); // secondValue may be script or region
in FindOffsetByLangWithScriptOrRegion() 184 uint32_t len = strlen(resConfig[1]);
in FindOffsetByLangWithScriptOrRegion() 211 static uint32_t FindOffsetByAllParam(char **resConfig, const Key *keys, uint32_t configNum)
in FindOffsetByAllParam() argument 213 if (resConfig in FindOffsetByAllParam() 258 GetIdHeaderOffsetByCount(char **resConfig, const Key *keys, uint32_t configNum, int32_t count) GetIdHeaderOffsetByCount() argument 483 char *resConfig[LOCALE_ELEMENT_NUM] = {0}; GetIdHeaderOffsetByLocale() local [all...] |
H A D | global.cpp | 157 ResConfigImpl *resConfig = new(std::nothrow) ResConfigImpl; in GLOBAL_GetValueById() local 158 if (resConfig == nullptr) { in GLOBAL_GetValueById() 162 HapManager hapManager(resConfig); in GLOBAL_GetValueById() 190 ResConfigImpl *resConfig = new(std::nothrow) ResConfigImpl; in GLOBAL_GetValueByName() local 191 if (resConfig == nullptr) { in GLOBAL_GetValueByName() 195 HapManager hapManager(resConfig); in GLOBAL_GetValueByName()
|
H A D | resource_manager_impl.cpp | 57 ResConfigImpl *resConfig = new (std::nothrow) ResConfigImpl; in Init() local 58 if (resConfig == nullptr) { in Init() 62 hapManager_ = new (std::nothrow) HapManager(resConfig); in Init() 64 delete (resConfig); in Init() 602 RState ResourceManagerImpl::UpdateResConfig(ResConfig &resConfig) in UpdateResConfig() argument 604 if (resConfig.GetLocaleInfo() == nullptr) { in UpdateResConfig() 607 if (resConfig.GetLocaleInfo()->GetLanguage() == nullptr) { in UpdateResConfig() 610 return this->hapManager_->UpdateResConfig(resConfig); in UpdateResConfig() 613 void ResourceManagerImpl::GetResConfig(ResConfig &resConfig) in GetResConfig() argument 615 this->hapManager_->GetResConfig(resConfig); in GetResConfig() [all...] |
/base/global/resource_management_lite/frameworks/resmgr_lite/test/unittest/lite/common/ |
H A D | test_common.cpp | 71 ResConfig *resConfig = CreateResConfig(); in CreateResConfig() local 72 if (resConfig == nullptr) { in CreateResConfig() 75 resConfig->SetLocaleInfo(language, script, region); in CreateResConfig() 76 return resConfig; in CreateResConfig()
|
/base/global/resource_management/frameworks/resmgr/include/ |
H A D | hap_manager.h | 38 * @param resConfig resource config 41 HapManager(std::shared_ptr<ResConfigImpl> resConfig, bool isSystem = false); 49 * Update the resConfig 50 * @param resConfig the resource config 51 * @return SUCCESS if the resConfig updated success, else HAP_INIT_FAILED 53 RState UpdateResConfig(ResConfig &resConfig); 56 * Update the override resConfig 57 * @param resConfig the override resource config 58 * @return SUCCESS if the override resConfig updated success, else ERROR 60 RState UpdateOverrideResConfig(ResConfig &resConfig); [all...] |
H A D | theme_pack_config.h | 29 * Set theme resConfig direction 31 * @param direction the theme resConfig direction 36 * Set theme resConfig colorMode 38 * @param colorMode the theme resConfig colorMode 53 * Whether this themeConfig match the device resConfig 55 * @param themeConfig the theme resConfig 56 * @param resConfig the device resConfig 57 * @return true if this themeConfig match the device resConfig, else false 59 static bool Match(const std::shared_ptr<ThemeConfig> &themeConfig, const ResConfigImpl &resConfig); [all...] |
H A D | theme_pack_manager.h | 78 * Get the theme resource related to bundlename, modulename, resType, resName and resConfig. 83 * @param resConfig the resource config 86 const ResType &resType, const std::string &resName, const ResConfigImpl &resConfig); 89 * Find the best theme resource related to bundlename, modulename, idItems and resConfig. 93 * @param resConfig the resource config 97 const std::vector<std::shared_ptr<IdItem>> &idItems, const ResConfigImpl &resConfig, 172 const std::string &resName, const ResConfigImpl &resConfig); 176 const ResConfigImpl &resConfig);
|
/base/global/resource_management/frameworks/resmgr/include/utils/ |
H A D | string_utils.h | 36 bool ReplacePlaceholderWithParams(std::string &inputOutputValue, const ResConfigImpl &resConfig,
|
/base/global/resource_management_lite/frameworks/resmgr_lite/src/utils/ |
H A D | hap_parser.cpp | 398 ResConfigImpl *resConfig = new (std::nothrow) ResConfigImpl; in CreateResConfigFromKeyParams() local 399 if (resConfig == nullptr) { in CreateResConfigFromKeyParams() 406 return resConfig; in CreateResConfigFromKeyParams() 436 resConfig->SetDeviceType(deviceType); in CreateResConfigFromKeyParams() 437 resConfig->SetDirection(direction); in CreateResConfigFromKeyParams() 438 resConfig->SetScreenDensity(screenDensity); in CreateResConfigFromKeyParams() 439 RState r = resConfig->SetLocaleInfo(language, script, region); in CreateResConfigFromKeyParams() 445 return resConfig; in CreateResConfigFromKeyParams()
|
/base/global/resource_management/frameworks/resmgr/src/utils/ |
H A D | hap_parser.cpp | 644 auto resConfig = std::make_shared<ResConfigImpl>(); in CreateResConfigFromKeyParams() local 645 if (resConfig == nullptr) { in CreateResConfigFromKeyParams() 652 resConfig->SetColorMode(COLOR_MODE_NOT_SET); in CreateResConfigFromKeyParams() 653 return resConfig; in CreateResConfigFromKeyParams() 695 auto resConfig = std::make_shared<ResConfigImpl>(); in BuildResConfig() local 696 if (resConfig == nullptr) { in BuildResConfig() 700 resConfig->SetDeviceType(configKey->deviceType); in BuildResConfig() 701 resConfig->SetDirection(configKey->direction); in BuildResConfig() 702 resConfig->SetColorMode(configKey->colorMode); in BuildResConfig() 703 resConfig in BuildResConfig() [all...] |
H A D | string_utils.cpp | 176 bool LocalizeNumber(std::string &inputOutputNum, const ResConfigImpl &resConfig, in LocalizeNumber() argument 180 const ResLocale *resLocale = resConfig.GetResLocale(); in LocalizeNumber() 292 bool ReplacePlaceholderWithParams(std::string &inputOutputValue, const ResConfigImpl &resConfig, in ReplacePlaceholderWithParams() argument 332 if (!GetReplaceStr(jsParams[paramIndex], placeholderType, precision, resConfig, replaceStr)) { in ReplacePlaceholderWithParams()
|
/base/usb/usb_manager/services/native/src/ |
H A D | usb_mass_storage_notification.cpp | 75 std::unique_ptr<Global::Resource::ResConfig> resConfig(Global::Resource::CreateResConfig()); in GetHapString() 76 if (resConfig == nullptr) { in GetHapString() 77 USB_HILOGE(MODULE_USB_SERVICE, "resConfig is null"); in GetHapString() 82 resConfig->SetLocaleInfo(locale.GetLanguage().c_str(), locale.GetScript().c_str(), locale.GetRegion().c_str()); in GetHapString() 83 resourceManager->UpdateResConfig(*resConfig); in GetHapString()
|
/base/global/resource_management/interfaces/inner_api/include/ |
H A D | resource_manager.h | 80 virtual RState UpdateResConfig(ResConfig &resConfig, bool isUpdateTheme = false) = 0; 82 virtual void GetResConfig(ResConfig &resConfig) = 0; 229 virtual RState UpdateOverrideResConfig(ResConfig &resConfig) = 0; 231 virtual void GetOverrideResConfig(ResConfig &resConfig) = 0; 274 * @param resConfig the device resConfig 280 ResConfig &resConfig, int32_t appType = 0, int32_t userId = 100);
|