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 #pragma once
8 
9 #include <QElapsedTimer>
10 #include <QLocalSocket>
11 #include <QObject>
12 
13 class QIODevice;
14 class QSocketNotifier;
15 
16 /** ASAP CLI session. */
17 class Session : public QObject
18 {
19  Q_OBJECT
20 public:
21  explicit Session(const QString &input, QObject *parent = nullptr);
22  ~Session() override;
23 
24  void printStats() const;
25 
26 public Q_SLOTS:
27  void connectToHost();
28 
29 Q_SIGNALS:
30  void disconnected();
31 
32 private Q_SLOTS:
33  void inputAvailable();
34  void serverDisconnected();
35  void serverError(QLocalSocket::LocalSocketError socketError);
36  void serverRead();
37 
38 private:
39  QIODevice *m_input = nullptr;
40  QIODevice *m_session = nullptr;
41  QSocketNotifier *m_notifier = nullptr;
42 
43  QElapsedTimer m_connectionTime;
44  qint64 m_receivedBytes = 0;
45  qint64 m_sentBytes = 0;
46 };
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
ASAP CLI session.
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Sep 25 2023 03:49:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.