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 PRINT_SERVICE_HELPER_H 17 #define PRINT_SERVICE_HELPER_H 18 19 #include <string> 20 #include "ability_manager_client.h" 21 #include "bundle_mgr_proxy.h" 22 #include "bundle_mgr_client.h" 23 #include "system_ability.h" 24 25 namespace OHOS::Print { 26 class PrintServiceHelper { 27 public: 28 virtual ~PrintServiceHelper(); 29 virtual bool CheckPermission(const std::string &name); 30 virtual bool StartAbility(const AAFwk::Want &want); 31 virtual bool StartPrintServiceExtension(const AAFwk::Want &want, int32_t requestCode_); 32 virtual sptr<IRemoteObject> GetBundleMgr(); 33 virtual bool QueryAccounts(std::vector<int> &accountList); 34 virtual bool QueryExtension(sptr<AppExecFwk::IBundleMgr> mgr, int userId, 35 std::vector<AppExecFwk::ExtensionAbilityInfo> &extensionInfos); 36 virtual bool QueryNameForUid(sptr<AppExecFwk::IBundleMgr> mgr, int32_t userId, std::string& name); 37 virtual bool IsSyncMode(); 38 }; 39 } // namespace OHOS 40 #endif // PRINT_SERVICE_HELPER_H 41