KDESu 5.99.0
stubprocess.h
1/*
2 This file is part of the KDE project, module kdesu.
3 SPDX-FileCopyrightText: 1999, 2000 Geert Jansen <jansen@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-only
6*/
7
8#ifndef KDESUSTUBPROCESS_H
9#define KDESUSTUBPROCESS_H
10
11#include "ptyprocess.h"
12
13#include <kdesu/kdesu_export.h>
14
15#include <QByteArray>
16#include <QList>
17
18namespace KDESu
19{
20namespace KDESuPrivate
21{
22class KCookie;
23}
24class StubProcessPrivate;
25
32class KDESU_EXPORT StubProcess : public PtyProcess
33{
34public:
39 enum Scheduler {
40 SchedNormal,
41 SchedRealtime,
42 };
43
45 ~StubProcess() override;
46
50 void setCommand(const QByteArray &command);
51
55 void setUser(const QByteArray &user);
56
60 void setXOnly(bool xonly);
61
67 void setPriority(int prio);
68
72 void setScheduler(int sched);
73
74protected:
75 void virtual_hook(int id, void *data) override;
76
80 int converseStub(int check);
81
86 virtual QByteArray display();
87
91 virtual QByteArray displayAuth();
92
93 // KF6 TODO: move to StubProcessPrivate
94 bool m_XOnly;
95 int m_priority;
96 int m_scheduler;
97 QByteArray m_command;
98 QByteArray m_user;
99 KDESuPrivate::KCookie *m_cookie;
100
101private:
102 QByteArray commaSeparatedList(const QList<QByteArray> &lst);
103 void writeString(const QByteArray &str);
104
105protected:
106 explicit StubProcess(StubProcessPrivate &dd);
107
108private:
109 Q_DECLARE_PRIVATE_D(PtyProcess::d, StubProcess)
110#if KDESU_BUILD_DEPRECATED_SINCE(5, 79)
111 // Unused, kept for ABI compatibility
112 const void *__kdesu_d_do_not_use;
113#endif
114};
115
116}
117
118#endif // KDESUSTUBPROCESS_H
Synchronous communication with tty programs.
Definition: ptyprocess.h:36
Chat with kdesu_stub.
Definition: stubprocess.h:33
void virtual_hook(int id, void *data) override
Standard hack to add virtual methods in a BC way.
virtual QByteArray displayAuth()
See display.
virtual QByteArray display()
This virtual function can be overloaded when special behavior is desired.
Scheduler
Different schedulers.
Definition: stubprocess.h:39
void setPriority(int prio)
Set the priority of the process.
void setXOnly(bool xonly)
Set to "X only mode": Sycoca is not built and kdeinit is not launched.
void setScheduler(int sched)
Set the scheduler type.
void setCommand(const QByteArray &command)
Set the command.
int converseStub(int check)
Exchange all parameters with kdesu_stub.
void setUser(const QByteArray &user)
Set the target user.