ollie/kde/gui/plumber.h

36 lines
801 B
C++

#ifndef PLUMBER_H
#define PLUMBER_H
#include <QObject>
#include <QProcess>
#include <QQmlEngine>
// Plumber wraps plan9port's plumb command for context-aware actions.
// B3-click on text → plumber routes to appropriate handler (editor, browser, etc.)
class Plumber : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
explicit Plumber(QObject *parent = nullptr);
// Plumb text to the plan9port plumber daemon
Q_INVOKABLE void plumb(const QString &text);
// Plumb with explicit source/destination
Q_INVOKABLE void plumbTo(const QString &text, const QString &dst);
// Check if plumber is available
Q_INVOKABLE bool available() const;
signals:
void plumbError(const QString &error);
private:
QString m_plumbPath;
};
#endif // PLUMBER_H