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_DEFAULT_APPLICATION_FRAMEWORK_IDEFAULT_APP_DB 17 #define FOUNDATION_DEFAULT_APPLICATION_FRAMEWORK_IDEFAULT_APP_DB 18 19 #include <map> 20 21 #include "bundle_constants.h" 22 #include "default_app_data.h" 23 #include "element.h" 24 #include "inner_bundle_info.h" 25 26 namespace OHOS { 27 namespace AppExecFwk { 28 class IDefaultAppDb { 29 public: 30 IDefaultAppDb() = default; 31 virtual ~IDefaultAppDb() = default; 32 virtual bool GetDefaultApplicationInfos(int32_t userId, std::map<std::string, Element>& infos) = 0; 33 virtual bool GetDefaultApplicationInfo(int32_t userId, const std::string& type, Element& element) = 0; 34 virtual bool SetDefaultApplicationInfos(int32_t userId, const std::map<std::string, Element>& infos) = 0; 35 virtual bool SetDefaultApplicationInfo(int32_t userId, const std::string& type, const Element& element) = 0; 36 virtual bool DeleteDefaultApplicationInfos(int32_t userId) = 0; 37 virtual bool DeleteDefaultApplicationInfo(int32_t userId, const std::string& type) = 0; 38 virtual void RegisterDeathListener() = 0; 39 virtual void UnRegisterDeathListener() = 0; 40 }; 41 } // namespace AppExecFwk 42 } // namespace OHOS 43 #endif // FOUNDATION_DEFAULT_APPLICATION_FRAMEWORK_IDEFAULT_APP_DB 44