Akonadi

asapcat/session.h
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2013 Volker Krause <[email protected]> *
3  * *
4  * SPDX-License-Identifier: LGPL-2.0-or-later *
5  ***************************************************************************/
6 
7 #ifndef SESSION_H
8 #define SESSION_H
9 
10 #include <QObject>
11 #include <QLocalSocket>
12 #include <QElapsedTimer>
13 
14 class QIODevice;
15 class QSocketNotifier;
16 
18 class Session : public QObject
19 {
20  Q_OBJECT
21 public:
22  explicit Session(const QString &input, QObject *parent = nullptr);
23  ~Session();
24 
25  void printStats() const;
26 
27 public Q_SLOTS:
28  void connectToHost();
29 
30 Q_SIGNALS:
31  void disconnected();
32 
33 private Q_SLOTS:
34  void inputAvailable();
35  void serverDisconnected();
36  void serverError(QLocalSocket::LocalSocketError socketError);
37  void serverRead();
38 
39 private:
40  QIODevice *m_input = nullptr;
41  QIODevice *m_session = nullptr;
42  QSocketNotifier *m_notifier = nullptr;
43 
44  QElapsedTimer m_connectionTime;
45  qint64 m_receivedBytes = 0;
46  qint64 m_sentBytes = 0;
47 };
48 
49 #endif // SESSION_H
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
ASAP CLI session.
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:18:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.