1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef CODEEDITORRECEIVER_H
6#define CODEEDITORRECEIVER_H
7
8#include "common/common.h"
9#include "framework.h"
10
11class CodeEditorReceiver: public dpf::EventHandler, dpf::AutoEventHandlerRegister<CodeEditorReceiver>
12{
13 friend class dpf::AutoEventHandlerRegister<CodeEditorReceiver>;
14public:
15 explicit CodeEditorReceiver(QObject * parent = nullptr);
16 static Type type();
17 static QStringList topics();
18 virtual void eventProcess(const dpf::Event& event) override;
19};
20
21class EditorCallProxy : public QObject
22{
23 Q_OBJECT
24 EditorCallProxy(const EditorCallProxy&) = delete;
25 EditorCallProxy();
26
27public:
28 static EditorCallProxy* instance();
29
30signals:
31 void toOpenFile(const QString &filePath);
32 void toRunClean();
33 void toDebugPointClean();
34 void toSearchText(const QString &srcText, int operateType);
35 void toReplaceText(const QString &srcText, const QString &destText, int operateType);
36 void toOpenFileWithKey(const newlsp::ProjectKey &key, const QString &filePath);
37 void toRunFileLineWithKey(const newlsp::ProjectKey &key, const QString &filePath, int line);
38 void toJumpFileLineWithKey(const newlsp::ProjectKey &key, const QString &filePath, int line);
39 void toSetLineBackground(const QString &filePath, int line, const QColor &color);
40 void toDelLineBackground(const QString &filePath, int line);
41 void toCleanLineBackground(const QString &filePath);
42 void toSetAnnotation(const QString &filePath, int line, const QString &title, const AnnotationInfo &info);
43 void toCleanAnnotation(const QString &filePath, const QString &title);
44 void toCleanAllAnnotation(const QString &title);
45 void toSwitchContext(const QString &name);
46 void toSwitchWorkspace(const QString &name);
47 void toSetModifiedAutoReload(const QString filePath, bool flag);
48 void toAddDebugPoint(const QString &filePath, int line);
49 void toRemoveDebugPoint(const QString &filePath, int line);
50};
51
52#endif // CODEEDITORRECEIVER_H
53