CFx SDK Documentation
2020SP3
SDK
CFx
commonui_inc
NA
FxNAWebSocket.h
Go to the documentation of this file.
1
//
2
// (C) Copyright 2005-2020 by Graebert GmbH.
3
//
4
// Permission to use, copy, modify, and distribute this software in
5
// object code form for any purpose and without fee is hereby granted,
6
// provided that the above copyright notice appears in all copies and
7
// that both that copyright notice and the limited warranty and
8
// restricted rights notice below appear in all supporting
9
// documentation.
10
//
11
// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12
// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15
// UNINTERRUPTED OR ERROR FREE.
16
17
#pragma once
18
19
#include "../FxCommonFramework.h"
20
#include "../UI/FxUIObject.h"
21
#include "../UI/FxUISignal.h"
22
#include "
FxNANetworkRequest.h
"
23
#include "
FxNAWebSocketProtocol.h
"
24
25
#include <QtCore/QString>
26
27
using
CFxNAString
= QString;
28
33
class
COMMONUI_API
CFxNAWebSocket
:
public
CFxUIObject
34
{
35
public
:
36
enum
SocketState
37
{
38
UnconnectedState
,
39
HostLookupState
,
40
ConnectingState
,
41
ConnectedState
,
42
BoundState
,
43
ListeningState
,
44
ClosingState
45
};
46
56
explicit
CFxNAWebSocket
(
const
CFxNAString
&origin =
CFxNAString
(),
57
CFxNAWebSocketProtocol::Version
version
=
CFxNAWebSocketProtocol::VersionLatest
);
58
60
~CFxNAWebSocket
();
61
69
long
long
sendTextMessage
(
const
CFxUIString
&textMessage );
70
71
// Slots
72
78
void
open
(
const
CFxNANetworkRequest
&request );
79
87
void
close
(
CFxNAWebSocketProtocol::CloseCode
closeCode =
CFxNAWebSocketProtocol::CloseCodeNormal
,
const
CFxNAString
&reason =
CFxNAString
() );
88
89
// Signals
90
94
CFxUISignal
<
void
(
void
) >&
connected
();
95
99
CFxUISignal
<
void
(
int
) >&
error
();
100
104
CFxUISignal
<
void
(
void
) >&
disconnected
();
105
109
CFxUISignal
<
void
(
const
CFxNAString
& ) >&
textMessageReceived
();
110
111
//...
112
};
CFxNAWebSocketProtocol::Version
Version
Definition:
FxNAWebSocketProtocol.h:22
OdTf::version
@ version
Definition:
Tf.h:335
CFxNAWebSocket::BoundState
@ BoundState
Definition:
FxNAWebSocket.h:42
CFxNAWebSocket::~CFxNAWebSocket
~CFxNAWebSocket()
CFxNAWebSocket::ListeningState
@ ListeningState
Definition:
FxNAWebSocket.h:43
CFxNAWebSocket
Definition:
FxNAWebSocket.h:34
CFxNAWebSocket::close
void close(CFxNAWebSocketProtocol::CloseCode closeCode=CFxNAWebSocketProtocol::CloseCodeNormal, const CFxNAString &reason=CFxNAString())
CFxNAWebSocket::ConnectedState
@ ConnectedState
Definition:
FxNAWebSocket.h:41
CFxUISignal
Definition:
FxUISignal.h:74
CFxNANetworkRequest
Definition:
FxNANetworkRequest.h:54
CFxNAString
QString CFxNAString
Definition:
FxNANetworkReply.h:38
CFxNAWebSocketProtocol::CloseCodeNormal
@ CloseCodeNormal
Normal closure.
Definition:
FxNAWebSocketProtocol.h:44
CFxNAWebSocketProtocol::VersionLatest
@ VersionLatest
Refers to the latest known version to CFxNAWebSockets.
Definition:
FxNAWebSocketProtocol.h:36
CFxNAWebSocket::ConnectingState
@ ConnectingState
Definition:
FxNAWebSocket.h:40
CFxNAWebSocket::connected
CFxUISignal< void(void) > & connected()
CFxNAWebSocket::disconnected
CFxUISignal< void(void) > & disconnected()
FxNAWebSocketProtocol.h
CFxNAWebSocket::textMessageReceived
CFxUISignal< void(const CFxNAString &) > & textMessageReceived()
CFxNAWebSocket::UnconnectedState
@ UnconnectedState
Definition:
FxNAWebSocket.h:38
CFxUIString
QString CFxUIString
Definition:
FxUIObject.h:46
CFxNAWebSocket::sendTextMessage
long long sendTextMessage(const CFxUIString &textMessage)
COMMONUI_API
#define COMMONUI_API
Definition:
FxCommonFramework.h:4
CFxNAString
QString CFxNAString
Definition:
FxNAWebSocket.h:27
FxNANetworkRequest.h
CFxNAWebSocketProtocol::CloseCode
CloseCode
Definition:
FxNAWebSocketProtocol.h:43
CFxNAWebSocket::open
void open(const CFxNANetworkRequest &request)
CFxUIObject
Definition:
FxUIObject.h:101
void
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
CFxNAWebSocket::CFxNAWebSocket
CFxNAWebSocket(const CFxNAString &origin=CFxNAString(), CFxNAWebSocketProtocol::Version version=CFxNAWebSocketProtocol::VersionLatest)
CFxNAWebSocket::error
CFxUISignal< void(int) > & error()
CFxNAWebSocket::SocketState
SocketState
Definition:
FxNAWebSocket.h:37
CFxNAWebSocket::HostLookupState
@ HostLookupState
Definition:
FxNAWebSocket.h:39
Generated on Mon Oct 12 2020 11:49:32