1 /*
2  * Copyright (c) 2024 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 COMMON_EXTERNAL_INCLUDE_EXTERNAL_MANAGER_FACTORY_H
17 #define COMMON_EXTERNAL_INCLUDE_EXTERNAL_MANAGER_FACTORY_H
18 
19 #include "edm_access_token_manager_impl.h"
20 #include "edm_app_manager_impl.h"
21 #include "edm_bundle_manager_impl.h"
22 #include "edm_os_account_manager_impl.h"
23 #include "iexternal_manager_factory.h"
24 
25 namespace OHOS {
26 namespace EDM {
27 class ExternalManagerFactory : public IExternalManagerFactory {
28 public:
29     ~ExternalManagerFactory() override = default;
30     std::shared_ptr<IEdmAppManager> CreateAppManager() override;
31     std::shared_ptr<IEdmBundleManager> CreateBundleManager() override;
32     std::shared_ptr<IEdmOsAccountManager> CreateOsAccountManager() override;
33     std::shared_ptr<IEdmAccessTokenManager> CreateAccessTokenManager() override;
34 
35 private:
36     std::shared_ptr<IEdmAppManager> appMgr_ = std::make_shared<EdmAppManagerImpl>();
37     std::shared_ptr<IEdmBundleManager> bundleMgr_ = std::make_shared<EdmBundleManagerImpl>();
38     std::shared_ptr<IEdmOsAccountManager> osAccountMgr_ = std::make_shared<EdmOsAccountManagerImpl>();
39     std::shared_ptr<IEdmAccessTokenManager> accessTokenMgr_ = std::make_shared<EdmAccessTokenManagerImpl>();
40 };
41 } // namespace EDM
42 } // namespace OHOS
43 
44 #endif // COMMON_EXTERNAL_INCLUDE_IEXTERNAL_MANAGER_FACTORY_H