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 HDI_DEVICE_ENGINE_BASE_H
16 #define HDI_DEVICE_ENGINE_BASE_H
17 #include "i_engine.h"
18 
19 namespace OHOS {
20 namespace IntelligentVoice {
21 namespace Engine {
22 class EngineBase : public IEngine {
23 public:
24     EngineBase() = default;
25     ~EngineBase() = default;
26 
27     IntellVoiceStatus SetListener(std::shared_ptr<IEngineCallback> listener) override;
28     IntellVoiceStatus Release() override;
29     IntellVoiceStatus SetParameter(const std::string &keyValueList) override;
30     IntellVoiceStatus GetParameter(const std::string &keyList, getParameterCb cb) override;
31     IntellVoiceStatus Write(const uint8_t *buffer, uint32_t size) override;
32     IntellVoiceStatus Stop() override;
33     IntellVoiceStatus Cancel() override;
34     IntellVoiceStatus ReadFileData(ContentType type, getFileDataCb cb) override;
35     IntellVoiceStatus GetWakeupPcm(std::vector<uint8_t> &data) override;
36     IntellVoiceStatus Evaluate(const std::string &word, EvaluationResultInfo &info) override;
37 
38 protected:
39     std::shared_ptr<IEngineCallback> callback_ = nullptr;
40 };
41 }
42 }
43 }
44 #endif