16f2c2defSopenharmony_ci/*
26f2c2defSopenharmony_ci * Copyright (c) 2020 Huawei Device Co., Ltd.
36f2c2defSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
46f2c2defSopenharmony_ci * you may not use this file except in compliance with the License.
56f2c2defSopenharmony_ci * You may obtain a copy of the License at
66f2c2defSopenharmony_ci *
76f2c2defSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
86f2c2defSopenharmony_ci *
96f2c2defSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
106f2c2defSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
116f2c2defSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126f2c2defSopenharmony_ci * See the License for the specific language governing permissions and
136f2c2defSopenharmony_ci * limitations under the License.
146f2c2defSopenharmony_ci */
156f2c2defSopenharmony_ci
166f2c2defSopenharmony_ci#ifndef HOS_LITE_HIVIEW_SERVICE_H
176f2c2defSopenharmony_ci#define HOS_LITE_HIVIEW_SERVICE_H
186f2c2defSopenharmony_ci
196f2c2defSopenharmony_ci#include <service.h>
206f2c2defSopenharmony_ci#include <iunknown.h>
216f2c2defSopenharmony_ci#include "ohos_types.h"
226f2c2defSopenharmony_ci
236f2c2defSopenharmony_ci#ifdef __cplusplus
246f2c2defSopenharmony_ci#if __cplusplus
256f2c2defSopenharmony_ciextern "C" {
266f2c2defSopenharmony_ci#endif
276f2c2defSopenharmony_ci#endif /* End of #ifdef __cplusplus */
286f2c2defSopenharmony_ci
296f2c2defSopenharmony_citypedef enum {
306f2c2defSopenharmony_ci    HIVIEW_CMP_TYPE_DUMP = 0,
316f2c2defSopenharmony_ci    HIVIEW_CMP_TYPE_LOG,
326f2c2defSopenharmony_ci    HIVIEW_CMP_TYPE_LOG_LIMIT,
336f2c2defSopenharmony_ci    HIVIEW_CMP_TYPE_EVENT,
346f2c2defSopenharmony_ci    HIVIEW_CMP_TYPE_MAX
356f2c2defSopenharmony_ci} HiviewComponentType;
366f2c2defSopenharmony_ci
376f2c2defSopenharmony_citypedef enum {
386f2c2defSopenharmony_ci    HIVIEW_MSG_OUTPUT_LOG_FLOW = 0,
396f2c2defSopenharmony_ci    HIVIEW_MSG_OUTPUT_LOG_TEXT_FILE,
406f2c2defSopenharmony_ci    HIVIEW_MSG_OUTPUT_LOG_BIN_FILE,
416f2c2defSopenharmony_ci    HIVIEW_MSG_OUTPUT_EVENT_FLOW,
426f2c2defSopenharmony_ci    HIVIEW_MSG_OUTPUT_EVENT_BIN_FILE,
436f2c2defSopenharmony_ci    HIVIEW_MSG_MAX
446f2c2defSopenharmony_ci} HiviewInnerMessage;
456f2c2defSopenharmony_ci
466f2c2defSopenharmony_ci#define SYNC_FILE 1
476f2c2defSopenharmony_ci
486f2c2defSopenharmony_citypedef struct {
496f2c2defSopenharmony_ci    INHERIT_IUNKNOWN;
506f2c2defSopenharmony_ci    void (*Output)(IUnknown *iUnknown, int16 msgId, uint16 type);
516f2c2defSopenharmony_ci} HiviewInterface;
526f2c2defSopenharmony_ci
536f2c2defSopenharmony_citypedef struct {
546f2c2defSopenharmony_ci    INHERIT_SERVICE;
556f2c2defSopenharmony_ci    INHERIT_IUNKNOWNENTRY(HiviewInterface);
566f2c2defSopenharmony_ci    Identity identity;
576f2c2defSopenharmony_ci} HiviewService;
586f2c2defSopenharmony_ci
596f2c2defSopenharmony_citypedef void (* HiviewInitFunc)(void);
606f2c2defSopenharmony_citypedef void (* HiviewMsgHandle)(const Request *request);
616f2c2defSopenharmony_ci
626f2c2defSopenharmony_civoid HiviewRegisterInitFunc(HiviewComponentType type, HiviewInitFunc func);
636f2c2defSopenharmony_civoid HiviewRegisterMsgHandle(HiviewInnerMessage type, HiviewMsgHandle func);
646f2c2defSopenharmony_civoid HiviewSendMessage(const char *srvName, int16 msgId, uint16 msgValue);
656f2c2defSopenharmony_ci
666f2c2defSopenharmony_ci#ifdef __cplusplus
676f2c2defSopenharmony_ci#if __cplusplus
686f2c2defSopenharmony_ci}
696f2c2defSopenharmony_ci#endif
706f2c2defSopenharmony_ci#endif /* End of #ifdef __cplusplus */
716f2c2defSopenharmony_ci
726f2c2defSopenharmony_ci#endif /* End of #ifndef HOS_LITE_HIVIEW_SERVICE_H */
73