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 16 #ifndef SERVICES_INCLUDE_IME_INFO_ENQUIRER_H 17 #define SERVICES_INCLUDE_IME_INFO_ENQUIRER_H 18 19 #include <memory> 20 #include <mutex> 21 #include <string> 22 #include <vector> 23 24 #include "input_method_property.h" 25 #include "input_method_status.h" 26 27 namespace OHOS { 28 namespace MiscServices { 29 class ImeInfoInquirer { 30 public: 31 static ImeInfoInquirer &GetInstance(); 32 std::shared_ptr<ImeInfo> GetDefaultImeInfo(int32_t userId); 33 std::shared_ptr<Property> GetCurrentInputMethod(int32_t userId); 34 std::shared_ptr<Property> GetDefaultImeCfgProp(); 35 bool GetImeAppId(int32_t userId, const std::string &bundleName, std::string &appId); 36 bool GetImeVersionCode(int32_t userId, const std::string &bundleName, uint32_t &versionCode); 37 38 private: 39 static std::shared_ptr<ImeInfo> defaultIme_; 40 static std::shared_ptr<Property> currentIme_; 41 static std::shared_ptr<Property> defaultImeProperty_; 42 }; 43 } // namespace MiscServices 44 } // namespace OHOS 45 #endif // SERVICES_INCLUDE_IME_INFO_ENQUIRER_H 46