// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef LOGVIEWERADAPTOR_H #define LOGVIEWERADAPTOR_H #include #include QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; QT_END_NAMESPACE /* * Adaptor class for interface com.deepin.logviewer */ class LogViewerAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.deepin.logviewer") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: LogViewerAdaptor(QObject *parent); virtual ~LogViewerAdaptor(); public: // PROPERTIES public Q_SLOTS: // METHODS QString executeCmd(const QString &cmd); int exitCode(); bool exportLog(const QString &outDir, const QString &in, bool isFile); QStringList getFileInfo(const QString &file, bool unzip); qulonglong getFileSize(const QString &filePath); qlonglong getLineCount(const QString &filePath); QString isFileExist(const QString &filePath); QString openLogStream(const QString &filePath); void quit(); QString readLog(int fd); QString readLogInStream(const QString &token); QStringList readLogLinesInRange(int fd, qlonglong startLine, qlonglong lineCount); QStringList whiteListOutPaths(); Q_SIGNALS: // SIGNALS }; #endif