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 #ifndef INTELL_VOICE_TRIGGER_CONNECTOR_INTERNAL_IMPL_H 16 #define INTELL_VOICE_TRIGGER_CONNECTOR_INTERNAL_IMPL_H 17 18 #include <map> 19 #include <vector> 20 #include "i_intell_voice_trigger_connector_internal.h" 21 #include "trigger_connector.h" 22 23 namespace OHOS { 24 namespace IntellVoiceTrigger { 25 using OHOS::HDI::ServiceManager::V1_0::IServiceManager; 26 27 class TriggerConnectorInternalImpl : public IIntellVoiceTriggerConnectorInternal { 28 public: 29 explicit TriggerConnectorInternalImpl(OnServiceStartCb cb); 30 ~TriggerConnectorInternalImpl() override; 31 std::vector<TriggerConnectorModuleDesc> ListModuleDescriptors() override; 32 std::shared_ptr<IIntellVoiceTriggerConnectorModule> GetModule(const std::string &adapterName, 33 std::shared_ptr<IIntellVoiceTriggerConnectorCallback> callback) override; 34 35 private: 36 std::map<std::string, sptr<TriggerConnector>> connectors_; 37 sptr<IServiceManager> servmgr_ = nullptr; 38 }; 39 } 40 } 41 #endif