122736c2fSopenharmony_ci/*
222736c2fSopenharmony_ci * Copyright (c) 2022-2022 Huawei Device Co., Ltd.
322736c2fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
422736c2fSopenharmony_ci * you may not use this file except in compliance with the License.
522736c2fSopenharmony_ci * You may obtain a copy of the License at
622736c2fSopenharmony_ci *
722736c2fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
822736c2fSopenharmony_ci *
922736c2fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1022736c2fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1122736c2fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1222736c2fSopenharmony_ci * See the License for the specific language governing permissions and
1322736c2fSopenharmony_ci * limitations under the License.
1422736c2fSopenharmony_ci */
1522736c2fSopenharmony_ci
1622736c2fSopenharmony_ci#ifndef INPUTMETHOD_DUMP_H
1722736c2fSopenharmony_ci#define INPUTMETHOD_DUMP_H
1822736c2fSopenharmony_ci
1922736c2fSopenharmony_ci#include <cstdlib>
2022736c2fSopenharmony_ci#include <functional>
2122736c2fSopenharmony_ci#include <iosfwd>
2222736c2fSopenharmony_ci#include <list>
2322736c2fSopenharmony_ci#include <string>
2422736c2fSopenharmony_ci#include <vector>
2522736c2fSopenharmony_ci
2622736c2fSopenharmony_ci#include "singleton.h"
2722736c2fSopenharmony_ci
2822736c2fSopenharmony_cinamespace OHOS {
2922736c2fSopenharmony_cinamespace MiscServices {
3022736c2fSopenharmony_ciclass InputmethodDump : public Singleton<InputmethodDump> {
3122736c2fSopenharmony_cipublic:
3222736c2fSopenharmony_ci    using DumpNoParamFunc = std::function<void(int)>;
3322736c2fSopenharmony_ci    InputmethodDump() = default;
3422736c2fSopenharmony_ci    virtual ~InputmethodDump() = default;
3522736c2fSopenharmony_ci    void AddDumpAllMethod(const DumpNoParamFunc dumpAllMethod);
3622736c2fSopenharmony_ci    bool Dump(int fd, const std::vector<std::string> &args);
3722736c2fSopenharmony_ci
3822736c2fSopenharmony_ciprivate:
3922736c2fSopenharmony_ci    void ShowHelp(int fd);
4022736c2fSopenharmony_ci    void ShowIllegalInformation(int fd);
4122736c2fSopenharmony_ci    mutable std::mutex hidumperMutex_;
4222736c2fSopenharmony_ci    DumpNoParamFunc dumpAllMethod_;
4322736c2fSopenharmony_ci};
4422736c2fSopenharmony_ci} // namespace MiscServices
4522736c2fSopenharmony_ci} // namespace OHOS
4622736c2fSopenharmony_ci#endif // INPUTMETHOD_DUMP_H