nextcloud-desktop/src/gui/socketapi.h
Daniel Molkentin 4fc044d368 Merge branch 'master' into move_lib_to_sep_dir
Conflicts:
	cmake/modules/NSIS.template.in
	src/CMakeLists.txt
	src/creds/shibboleth/authenticationdialog.cpp
	src/creds/shibboleth/authenticationdialog.h
	src/gui/owncloudgui.cpp
	src/libsync/creds/shibboleth/authenticationdialog.cpp
	src/libsync/creds/shibboleth/authenticationdialog.h
	src/libsync/mirallaccessmanager.cpp
	src/mirall/authenticationdialog.cpp
	src/mirall/authenticationdialog.h
2014-08-12 21:08:44 +02:00

64 lines
1.7 KiB
C++

/*
* Copyright (C) by Dominik Schmidt <dev@dominik-schmidt.de>
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*/
#ifndef SOCKETAPI_H
#define SOCKETAPI_H
#include <QWeakPointer>
#include <QTcpSocket>
#include <QTcpServer>
#include "syncfileitem.h"
class QUrl;
class QLocalSocket;
class QStringList;
namespace Mirall {
class SocketApi : public QObject
{
Q_OBJECT
public:
SocketApi(QObject* parent);
virtual ~SocketApi();
public slots:
void slotUpdateFolderView(const QString&);
void slotUnregisterPath( const QString& alias );
void slotRegisterPath( const QString& alias );
private slots:
void slotNewConnection();
void onLostConnection();
void slotReadSocket();
void slotJobCompleted(const QString &, const SyncFileItem &);
private:
void sendMessage(QTcpSocket* socket, const QString& message);
void broadcastMessage(const QString& verb, const QString &path, const QString &status = QString::null);
Q_INVOKABLE void command_RETRIEVE_FOLDER_STATUS(const QString& argument, QTcpSocket* socket);
Q_INVOKABLE void command_RETRIEVE_FILE_STATUS(const QString& argument, QTcpSocket* socket);
private:
QTcpServer *_localServer;
QList<QTcpSocket*> _listeners;
};
}
#endif // SOCKETAPI_H