Akonadi

asapcat/session.h
1 /***************************************************************************
2  * Copyright (C) 2013 by Volker Krause <[email protected]> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License as *
6  * published by the Free Software Foundation; either version 2 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Library General Public *
15  * License along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 
20 #ifndef SESSION_H
21 #define SESSION_H
22 
23 #include <QObject>
24 #include <QLocalSocket>
25 #include <QElapsedTimer>
26 
27 class QIODevice;
28 class QSocketNotifier;
29 
31 class Session : public QObject
32 {
33  Q_OBJECT
34 public:
35  explicit Session(const QString &input, QObject *parent = nullptr);
36  ~Session();
37 
38  void printStats() const;
39 
40 public Q_SLOTS:
41  void connectToHost();
42 
43 Q_SIGNALS:
44  void disconnected();
45 
46 private Q_SLOTS:
47  void inputAvailable();
48  void serverDisconnected();
49  void serverError(QLocalSocket::LocalSocketError socketError);
50  void serverRead();
51 
52 private:
53  QIODevice *m_input = nullptr;
54  QIODevice *m_session = nullptr;
55  QSocketNotifier *m_notifier = nullptr;
56 
57  QElapsedTimer m_connectionTime;
58  qint64 m_receivedBytes = 0;
59  qint64 m_sentBytes = 0;
60 };
61 
62 #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 Wed Jul 1 2020 23:14:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.