diff --git a/CustomModels/channelmodel.cpp b/CustomModels/channelmodel.cpp index 9ef1cae618a762099cac161973280488625b3f4b..b0a2ded760cce0aff8058f857f8d33ade1b3675c 100644 --- a/CustomModels/channelmodel.cpp +++ b/CustomModels/channelmodel.cpp @@ -122,7 +122,7 @@ QVariant ChannelModel::data( const QModelIndex &index, int role ) const auto avatarImg = currentChannel->getAvatarImg(); if ( !avatarImg.isNull() ) { - auto path = QStringLiteral( "file://" ) + avatarImg->getFilePath(); + auto path = Utils::getPathPrefix() + avatarImg->getFilePath(); if ( path.endsWith( "svg" ) ) { return "qrc:res/user-identity.svg"; diff --git a/CustomModels/messagemodel.cpp b/CustomModels/messagemodel.cpp index 06dfaadf07208703865ef5e6cfdfeedb51858461..9a9ff24f4f9f3c839d3160a085fd07344c250aac 100644 --- a/CustomModels/messagemodel.cpp +++ b/CustomModels/messagemodel.cpp @@ -170,7 +170,7 @@ QVariant MessagesModel::data( const QModelIndex &index, int role ) const auto avatarImg = messageAtIndex->getAvatarImg(); if ( !avatarImg.isNull() ) { - auto path = QStringLiteral( "file://" ) + avatarImg->getFilePath(); + auto path = Utils::getPathPrefix() + avatarImg->getFilePath(); if ( path.endsWith( "svg" ) ) { return "qrc:res/user-identity.svg"; diff --git a/api/meteorddp.cpp b/api/meteorddp.cpp index 7c9097312755decc096ec25fa896298372cd07e8..4929d28ea18ba18435c9ef0ad95953518eb6095a 100755 --- a/api/meteorddp.cpp +++ b/api/meteorddp.cpp @@ -20,13 +20,13 @@ #include "meteorddp.h" -#include "websocket.h" #include "meteorddp.h" #include <QString> #include <QWebSocket> #include <QTime> #include <QCryptographicHash> #include <functional> +#include <QAbstractSocket> #include "ddpRequests/ddploginrequest.h" MeteorDDP::MeteorDDP( QObject *parent, const QString &pUri, bool pUnsecure ): QObject( parent ), unsecure( pUnsecure ) @@ -38,8 +38,6 @@ MeteorDDP::MeteorDDP( QObject *parent, const QString &pUri, bool pUnsecure ): QO void MeteorDDP::init( const QString &pUri ) { - mWsClient = new Websocket( this ); - QString protocol = QStringLiteral( "wss://" ); if ( unsecure ) { @@ -51,15 +49,16 @@ void MeteorDDP::init( const QString &pUri ) qDebug() << "meteor init" ; mWebsocketUri = pUri; mResponseBinding.reserve( 100 ); - connect( mWsClient, &Websocket::textMessageReceived, this, &MeteorDDP::onTextMessageReceived, Qt::UniqueConnection ); - connect( mWsClient, &Websocket::connected, this, &MeteorDDP::onConnected, Qt::UniqueConnection ); - connect( mWsClient, &Websocket::closed, this, &MeteorDDP::ddpDisconnected ); + connect( &mWebsocket, &QWebSocket::textMessageReceived, this, &MeteorDDP::onTextMessageReceived, Qt::UniqueConnection ); + connect( &mWebsocket, &QWebSocket::connected, this, &MeteorDDP::onConnected, Qt::UniqueConnection ); + connect( &mWebsocket, &QWebSocket::disconnected, this, &MeteorDDP::ddpDisconnected ); connect( this, &MeteorDDP::sendMessageSignal, this, &MeteorDDP::sendJson, Qt::UniqueConnection ); - connect( mWsClient, &Websocket::error, this, [ = ]( QString error ) { - qDebug() << "test"; - qDebug() << error; - } ); - mWsClient->open( wsUri ); + connect( &mWebsocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), + [=](QAbstractSocket::SocketError error){ + qDebug()<<mWebsocket.errorString(); + }); + + mWebsocket.open( wsUri ); QDateTime now = QDateTime::currentDateTime(); uint currentTime = now.toTime_t(); mLastPing = currentTime; @@ -88,13 +87,6 @@ void MeteorDDP::connectWithServer() sendJson( msgObj ); } -/*void MeteorDDP::loadLocale(){ - QJsonArray params; - params.append("de"); - method("loadLocale",params); -}*/ - - void MeteorDDP::onTextMessageReceived( const QString &pMsg ) { #if defined(Q_OS_LINUX)|| defined(Q_OS_IOS) @@ -190,7 +182,7 @@ void MeteorDDP::sendJson( const QJsonObject &pMsgObj ) QJsonDocument msgJson = QJsonDocument( pMsgObj ); QString msgString = msgJson.toJson( QJsonDocument::Compact ); qDebug() << "message String" << msgString; - mWsClient->sendTextMessage( msgString ); + mWebsocket.sendTextMessage( msgString ); } bool MeteorDDP::getUnsecure() const @@ -240,18 +232,17 @@ void MeteorDDP::resume() { qDebug() << "resuming ddp"; - if ( mWsClient ) { -#if defined(Q_OS_ANDROID) || defined(Q_OS_LINUX) - qDebug() << "websocket valid: " << mWsClient->isValid(); + #if defined(Q_OS_ANDROID) || defined(Q_OS_LINUX) ||defined(Q_OS_WIN) + qDebug() << "websocket valid: " << mWebsocket.isValid(); QUrl wsUri = QUrl( QStringLiteral( "wss://" ) + mWebsocketUri + QStringLiteral( "/websocket" ) ); - if ( mWsClient->isDisconnected() ) { - mWsClient->open( wsUri ); - } else if ( !mWsClient->isConnecting() ) { + if ( mWebsocket.state() == QAbstractSocket::UnconnectedState ) { + mWebsocket.open( wsUri ); + } else if ( mWebsocket.state() != QAbstractSocket::ConnectingState ) { auto const connection = new QMetaObject::Connection; - *connection = connect( mWsClient, &Websocket::closed, [ = ]() { + *connection = connect( &mWebsocket, &QWebSocket::disconnected, [ = ]() { qDebug() << "websocket closed"; - mWsClient->open( wsUri ); + mWebsocket.open( wsUri ); QDateTime now = QDateTime::currentDateTime(); uint currentTime = now.toTime_t(); mLastPing = currentTime; @@ -261,26 +252,25 @@ void MeteorDDP::resume() delete connection; } } ); - mWsClient->close(); + mWebsocket.close(); } - if ( mWsClient->isDisconnected() ) { + if ( mWebsocket.state() == QAbstractSocket::UnconnectedState ) { // connectWithServer(); } #else qDebug() << "resuming ddp"; - mWsClient->close(); - connect( mWsClient, &Websocket::destroyed, [&]() { - mWsClient = new Websocket( this ); - qDebug() << "new Websocket Object created"; + mWebsocket.close(); + connect(&mWebsocket , &QWebSocket::disconnected, [&]() { + qDebug()<<"disconnected"; init( mWebsocketUri ); } ); - mWsClient->deleteLater(); + mWebsocket.close(); #endif - } + } void MeteorDDP::unsetResponseBinding( const QString &pId ) @@ -292,12 +282,7 @@ void MeteorDDP::unsetResponseBinding( const QString &pId ) bool MeteorDDP::websocketIsValid() { - if ( mWsClient ) { - return mWsClient->isValid(); - } - - return false; - + return mWebsocket.isValid(); } uint MeteorDDP::diffToLastMessage() @@ -311,7 +296,7 @@ uint MeteorDDP::diffToLastMessage() void MeteorDDP::disconnectFromServer() { qDebug() << "disconnect from server"; - mWsClient->close(); + mWebsocket.close(); } void MeteorDDP::setResumeToken( const QString &pToken ) @@ -344,17 +329,3 @@ bool MeteorDDP::getWebsocketConnectionEstablished() const { return mWebsocketConnectionEstablished; } -/* -MeteorDDP::~MeteorDDP() -{ - qDebug()<<"destroying wsClient"; - - disconnect( mWsClient, &Websocket::textMessageReceived, this, &MeteorDDP::onTextMessageReceived ); - disconnect( mWsClient, &Websocket::connected, this, &MeteorDDP::onConnected); - disconnect( this, &MeteorDDP::sendMessageSignal, this, &MeteorDDP::sendJson ); - - mWsClient->close(); - - mWsClient->deleteLater(); -} -*/ diff --git a/api/meteorddp.h b/api/meteorddp.h index 0209c5ddb53056d4fad6a2acb4a627fe00fd328d..e2a304390b15cec0198a309b34753521afd96745 100755 --- a/api/meteorddp.h +++ b/api/meteorddp.h @@ -27,7 +27,6 @@ #include <QUrl> #include <QHash> #include <QtWebSockets/QtWebSockets> -#include "websocket/websocket.h" #include "ddpRequests/ddprequest.h" #include "messagelistener.h" @@ -77,7 +76,7 @@ class MeteorDDP : public QObject bool unsecure; int frameCount = 0; - Websocket *mWsClient = nullptr; + QString mServer; QUrl wsUri; QString mUid; @@ -94,6 +93,8 @@ class MeteorDDP : public QObject uint mMaxTimeout = 0; QSet<QString> mReceivedEvents; + QWebSocket mWebsocket; + signals: void websocketConnected(); diff --git a/engine.pro b/engine.pro index 9c6ef34cee72f382dbd57df62ee03f0cefd6874a..204158bf4a7b4715e1b8c82f67ffe8fd9d5caa1d 100644 --- a/engine.pro +++ b/engine.pro @@ -1,13 +1,9 @@ TEMPLATE = lib QT += core network websockets sql concurrent CONFIG += c++17 static -INCLUDEPATH += websocket\ - websocket/linuxwebsocket SOURCES += api/meteorddp.cpp \ api/restapi.cpp \ - websocket/websocket.cpp \ - websocket/websocketabstract.cpp \ ddpRequests/ddploginrequest.cpp \ ddpRequests/ddprequest.cpp \ ddpRequests/ddpsubscriptionrequest.cpp \ @@ -111,8 +107,6 @@ SOURCES += api/meteorddp.cpp \ HEADERS += \ api/meteorddp.h \ api/restapi.h \ - websocket/websocket.h \ - websocket/websocketabstract.h \ ddpRequests/ddploginrequest.h \ ddpRequests/ddpmethodrequest.h \ ddpRequests/ddprequest.h \ @@ -219,11 +213,8 @@ HEADERS += \ linux{ - SOURCES += websocket/linuxwebsocket/websocketlinux.cpp \ - segfaulthandler.cpp - - HEADERS += websocket/linuxwebsocket/websocketlinux.h \ - segfaulthandler.h + SOURCES += segfaulthandler.cpp + HEADERS += segfaulthandler.h } @@ -253,20 +244,21 @@ android{ } +win32{ + QMAKE_CXXFLAGS += /MP +} ios{ QT += gui-private - SOURCES += websocket/linuxwebsocket/websocketlinux.cpp \ - notifications/ios/applepushnotifications.cpp \ + SOURCES += notifications/ios/applepushnotifications.cpp \ notifications/ios/iosdevicetokenstorage.cpp \ segfaulthandler.cpp \ notifications/ios/iosnotificationreceiver.cpp - HEADERS += websocket/linuxwebsocket/websocketlinux.h \ - notifications/ios/applepushnotifications.h \ + HEADERS += notifications/ios/applepushnotifications.h \ notifications/ios/iosdevicetokenstorage.h \ notifications/ios/iosnotificationreceiver.h \ notifications/ios/DelegateClass.h @@ -293,6 +285,9 @@ CONFIG(release, debug|release) { CONFIG += ltcg QMAKE_CXXFLAGS += -Ofast -funroll-loops -fno-signed-zeros -fno-trapping-math } + win32:{ + QMAKE_CXXFLAGS += /O2 + } } RESOURCES += \ diff --git a/websocket/linuxwebsocket/websocketlinux.cpp b/websocket/linuxwebsocket/websocketlinux.cpp deleted file mode 100755 index 5ae39da27fc359a58a9cb4bc0e375dd2a0112558..0000000000000000000000000000000000000000 --- a/websocket/linuxwebsocket/websocketlinux.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - - -#include <QWebSocket> - -#include "websocketlinux.h" -#include "websocketabstract.h" - -websocketLinux::websocketLinux( QObject *parent ): WebsocketAbstract( parent ), mWebsocket( "rocket.chat.mobile", QWebSocketProtocol::VersionLatest, this ) -{ - connect( &mWebsocket, &QWebSocket::connected, this, &websocketLinux::connected, Qt::UniqueConnection ); - connect( &mWebsocket, &QWebSocket::textMessageReceived, this, &websocketLinux::received, Qt::UniqueConnection ); - connect( &mWebsocket, &QWebSocket::disconnected, this, &websocketLinux::closed, Qt::UniqueConnection ); - //connect(&websocket,&QWebSocket::error,this,&websocketLinux::error); - connect( &mWebsocket, &QWebSocket::stateChanged, this, &websocketLinux::onStatusChanged, Qt::UniqueConnection ); -} - -void websocketLinux::open( const QUrl &url ) -{ - qDebug() << "open url"; - mWebsocket.open( url ); -} - -void websocketLinux::close() -{ - mWebsocket.close(); -} - -void websocketLinux::sendTextMessage( const QString &pMessage ) -{ - if ( !mWebsocket.sendTextMessage( pMessage ) ) { - qWarning() << "ddp did not send message: " << pMessage; - } -} - -bool websocketLinux::isValid() -{ - qDebug() << "state: " << mWebsocket.state(); - return mWebsocket.isValid(); -} - -bool websocketLinux::isDisconnected() -{ - return mWebsocket.state() == QAbstractSocket::UnconnectedState; -} - -bool websocketLinux::isConnecting() -{ - return mWebsocket.state() == QAbstractSocket::ConnectingState; -} - -void websocketLinux::received( const QString &pMsg ) -{ - emit( textMessageReceived( pMsg ) ); -} - -void websocketLinux::onStatusChanged() -{ - // if(mWebsocket.state() == QAbstractSocket::UnconnectedState){ - // emit closed(); - // }else if(mWebsocket.state() == QAbstractSocket::ConnectedState){ - // emit connected(); - // } - qDebug() << "state linux websocket: " << mWebsocket.state(); -} diff --git a/websocket/linuxwebsocket/websocketlinux.h b/websocket/linuxwebsocket/websocketlinux.h deleted file mode 100755 index 1dc701f9f062f48784e91a2f0ac43490c795b121..0000000000000000000000000000000000000000 --- a/websocket/linuxwebsocket/websocketlinux.h +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - - -#ifndef WEBSOCKETLINUX_H -#define WEBSOCKETLINUX_H - -#include <QtWebSockets/QtWebSockets> -#include <QAbstractSocket> - -#include "websocketabstract.h" - - -class websocketLinux: public WebsocketAbstract -{ - public: - explicit websocketLinux( QObject *parent ); - virtual void open( const QUrl & ) override; - virtual void close() override; - virtual void sendTextMessage( const QString & ) override; - virtual bool isValid( void ) override; - virtual bool isDisconnected( void ) override; - virtual bool isConnecting( void ) override; - void received( const QString & ); - void onStatusChanged(); - private: - QWebSocket mWebsocket; - void emitConnected(); - -}; - -#endif // WEBSOCKETLINUX_H diff --git a/websocket/websocket.cpp b/websocket/websocket.cpp deleted file mode 100755 index b14f88bf798d4776fdf3ae86eb7a9aa14b7089ec..0000000000000000000000000000000000000000 --- a/websocket/websocket.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - - -#include <QUrl> -#include <QThread> -#include <QDebug> - -#include "websocket.h" -#include "websocketlinux.h" - -Websocket::Websocket( QObject *parent ): WebsocketAbstract( parent ) -{ - qRegisterMetaType<QAbstractSocket::SocketState>( "QAbstractSocket::SocketState" ); - mWebsocketInstance = new websocketLinux( this ); - connect( mWebsocketInstance, &WebsocketAbstract::connected, this, &Websocket::connected, Qt::UniqueConnection ); - connect( mWebsocketInstance, &WebsocketAbstract::textMessageReceived, this, &Websocket::textMessageReceived, Qt::UniqueConnection ); - connect( mWebsocketInstance, &WebsocketAbstract::error, this, &Websocket::error, Qt::UniqueConnection ); - connect( mWebsocketInstance, &WebsocketAbstract::closed, this, &Websocket::closed, Qt::UniqueConnection ); -} - -void Websocket::open( const QUrl &pUrl ) -{ - mWebsocketInstance->open( pUrl ); -} - -void Websocket::close() -{ - mWebsocketInstance->close(); -} - -void Websocket::sendTextMessage( const QString &pMessage ) -{ - mWebsocketInstance->sendTextMessage( pMessage ); -} - -bool Websocket::isValid() -{ - return mWebsocketInstance->isValid(); -} - -bool Websocket::isDisconnected() -{ - return mWebsocketInstance->isDisconnected(); -} - -bool Websocket::isConnecting() -{ - return mWebsocketInstance->isConnecting(); -} - - -void Websocket::updateConnectionStatus() -{ - qDebug() << "updated connection status"; - mConnectionStatus = true; - emit( connected() ); -} diff --git a/websocket/websocket.h b/websocket/websocket.h deleted file mode 100755 index e92c1f0ea17a65f533b35b2110276e288d4b90e3..0000000000000000000000000000000000000000 --- a/websocket/websocket.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - -#ifndef WEBSOCKET_H -#define WEBSOCKET_H - -#include <QObject> - -#include "websocketabstract.h" - - -class Websocket: public WebsocketAbstract -{ - public: - explicit Websocket( QObject *parent ); - - virtual void open( const QUrl & ) override; - virtual void close( void ) override; - virtual void sendTextMessage( const QString & ) override; - virtual bool isValid( void ) override; - virtual bool isDisconnected( void ) override; - virtual bool isConnecting( void ) override; - //~Websocket(); - private: - void updateConnectionStatus(); - - bool mConnectionStatus = false; - WebsocketAbstract *mWebsocketInstance; -}; - -#endif // WEBSOCKET_H diff --git a/websocket/websocketabstract.cpp b/websocket/websocketabstract.cpp deleted file mode 100755 index e6cb0cab14f45f3d739853d45a19403e897854ad..0000000000000000000000000000000000000000 --- a/websocket/websocketabstract.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - - -#include "websocketabstract.h" - -WebsocketAbstract::WebsocketAbstract( QObject *parent ): QObject( parent ) -{ - -} - -void WebsocketAbstract::sendTextMessage( const QString & ) -{ - -} - -void WebsocketAbstract::close() -{ - -} diff --git a/websocket/websocketabstract.h b/websocket/websocketabstract.h deleted file mode 100755 index 4fe927b8c21e3212a58cadb30cebf19d405b0543..0000000000000000000000000000000000000000 --- a/websocket/websocketabstract.h +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************************** - * * - * Copyright (C) 2017 Armin Felder, Dennis Beier * - * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>. * - * * - * RocketChatMobileEngine is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * RocketChatMobileEngine is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>. * - * * - ********************************************************************************************/ - - -#ifndef WEBSOCKETABSTRACT_H -#define WEBSOCKETABSTRACT_H - -#include <QObject> -#include <QUrl> -#include <QString> -#include <QAbstractSocket> - - -class WebsocketAbstract: public QObject -{ - Q_OBJECT - public: - WebsocketAbstract( QObject *parent ); - - virtual void open( const QUrl & ) = 0; - virtual void close( void ) = 0; - virtual void sendTextMessage( const QString & ) = 0; - virtual bool isValid( void ) = 0; - virtual bool isDisconnected( void ) = 0; - virtual bool isConnecting( void ) = 0; - - signals: - void connected(); - void closed(); - void textMessageReceived( const QString & ); - void error( const QString & ); -}; - -#endif // WEBSOCKET_H