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 INPUTMETHOD_IMF_IME_SETTING_LISTENER_TEST_IMPL_H
17 #define INPUTMETHOD_IMF_IME_SETTING_LISTENER_TEST_IMPL_H
18 
19 #include <condition_variable>
20 
21 #include "ime_event_listener.h"
22 
23 namespace OHOS {
24 namespace MiscServices {
25 class ImeSettingListenerTestImpl : public ImeEventListener {
26 public:
ImeSettingListenerTestImpl()27     ImeSettingListenerTestImpl(){};
~ImeSettingListenerTestImpl()28     ~ImeSettingListenerTestImpl(){};
29     void OnImeChange(const Property &property, const SubProperty &subProperty) override;
30     void OnImeShow(const ImeWindowInfo &info) override;
31     void OnImeHide(const ImeWindowInfo &info) override;
32     static void ResetParam();
33     static bool WaitPanelHide();
34     static bool WaitPanelShow();
35     static bool WaitImeChange(const SubProperty &subProperty);
36     static bool WaitImeChange();
37     static bool WaitTargetImeChange(const std::string &bundleName);
38 
39 private:
40     static InputWindowStatus status_;
41     static SubProperty subProperty_;
42     static bool isImeChange_;
43     static std::mutex imeSettingListenerLock_;
44     static std::condition_variable imeSettingListenerCv_;
45     static Property property_;
46 }; // namespace MiscServices
47 } // namespace MiscServices
48 } // namespace OHOS
49 
50 #endif // INPUTMETHOD_IMF_IME_SETTING_LISTENER_TEST_IMPL_H
51