]> git.cworth.org Git - apitrace/blobdiff - gui/traceprocess.h
Implement tracing from the ui.
[apitrace] / gui / traceprocess.h
diff --git a/gui/traceprocess.h b/gui/traceprocess.h
new file mode 100644 (file)
index 0000000..b65f41c
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef TRACEPROCESS_H
+#define TRACEPROCESS_H
+
+#include <QObject>
+#include <QProcess>
+
+class TraceProcess : public QObject
+{
+    Q_OBJECT
+public:
+    TraceProcess(QObject *parent=0);
+    ~TraceProcess();
+
+    bool canTrace() const;
+
+    void setExecutablePath(const QString &str);
+    QString executablePath() const;
+
+    void setArguments(const QStringList &args);
+    QStringList arguments() const;
+
+public slots:
+    void start();
+
+signals:
+    void tracedFile(const QString &tracePath);
+    void error(const QString &msg);
+
+private slots:
+    void traceFinished();
+    void traceError(QProcess::ProcessError err);
+
+private:
+    QString m_execPath;
+    QStringList m_args;
+    QString m_tracePath;
+    QProcess *m_process;
+
+    bool m_canTrace;
+};
+
+#endif