not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / ksysguard / processcore / processes_remote_p.h
blob40ac620edd92033f78bef471a90abe086e989b67
1 /* This file is part of the KDE project
3 Copyright (C) 2007 John Tapsell <tapsell@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef PROCESSES_REMOTE_P_H_
22 #define PROCESSES_REMOTE_P_H_
24 #include "processes_base_p.h"
25 #include <QSet>
26 class Process;
27 namespace KSysGuard
29 /**
30 * This is used to connect to a remote host
32 class ProcessesRemote : public AbstractProcesses {
33 Q_OBJECT
34 public:
35 ProcessesRemote(const QString &hostname);
36 virtual ~ProcessesRemote();
37 virtual QSet<long> getAllPids();
38 virtual long getParentPid(long pid);
39 virtual bool updateProcessInfo(long pid, Process *process);
40 virtual bool sendSignal(long pid, int sig);
41 virtual bool setNiceness(long pid, int priority);
42 virtual bool setScheduler(long pid, int priorityClass, int priority);
43 virtual long long totalPhysicalMemory();
44 virtual bool setIoNiceness(long pid, int priorityClass, int priority);
45 virtual bool supportsIoNiceness();
46 virtual long numberProcessorCores();
47 virtual void updateAllProcesses();
50 Q_SIGNALS:
51 /** For a remote machine, we rely on being able to communicate with ksysguardd.
52 * This must be dealt with by the program including this widget. It must listen to our
53 * 'runCommand' signal, and run the given command, with the given id. */
54 void runCommand(const QString &command, int id);
56 public Q_SLOTS:
57 /** For a remote machine, we rely on being able to communicate with ksysguardd.
58 * The programming using this must call this slot when an answer is received from ksysguardd,
59 * in response to a runCommand request. The id identifies the answer */
60 void answerReceived( int id, const QList<QByteArray>& answer );
61 /** Called soon after */
62 void setup();
64 protected:
65 enum { PsInfo, Ps, UsedMemory, FreeMemory, Kill, Renice, Ionice };
67 private:
68 /**
69 * You can use this for whatever data you want. Be careful about preserving state in between getParentPid and updateProcessInfo calls
70 * if you chose to do that. getParentPid may be called several times for different pids before the relevant updateProcessInfo calls are made.
71 * This is because the tree structure has to be sorted out first.
73 class Private;
74 Private *d;
78 #endif