ImagingTools Core SDK
IServerConnectionInterface.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <iser/ISerializable.h>
7
8#ifdef Q_OS_WIN
9#undef SetPort
10#endif
11
12
13namespace imtcom
14{
15
16
96class IServerConnectionInterface : virtual public iser::ISerializable
97{
98public:
110 {
115 PT_GRPC
116 };
118
129 {
131 CF_SECURE = 0x2
132 };
133 I_DECLARE_FLAGS(ConnectionFlags, CF_DEFAULT, CF_SECURE);
134
140 typedef QList<ProtocolType> ProtocolTypes;
141
151 virtual int GetConnectionFlags() const = 0;
152
173 virtual void SetConnectionFlags(int connectionFlags) = 0;
174
187 virtual QString GetHost() const = 0;
188
206 virtual void SetHost(const QString& host) = 0;
207
224 virtual int GetPort(ProtocolType protocol) const = 0;
225
246 virtual void SetPort(ProtocolType protocol, int port) = 0;
247
268
307 virtual bool GetUrl(ProtocolType protocol, QUrl& url) const = 0;
308};
309
310
311} // namespace imtcom
312
313
Interface for describing server connection configuration with multi-protocol support.
ProtocolType
Communication protocols supported by server connections.
@ PT_FILE
File-based protocol for local file system access.
@ PT_WEBSOCKET
WebSocket/WSS protocol for real-time bidirectional communication (default port: 9000)
@ PT_HTTP
HTTP/HTTPS protocol for RESTful APIs (default port: 9001)
@ PT_GRPC
gRPC protocol for high-performance RPC (default port: 50101)
@ PT_UNKNOWN
Unknown or unspecified protocol.
virtual void SetHost(const QString &host)=0
Set the server host name or address.
ConnectionFlags
Flags controlling connection security and behavior.
@ CF_SECURE
Secure connection with SSL/TLS encryption (HTTPS, WSS)
@ CF_DEFAULT
Default insecure connection (HTTP, WS)
virtual void SetPort(ProtocolType protocol, int port)=0
Set the port number for a specific protocol.
QList< ProtocolType > ProtocolTypes
List of protocol types for querying supported protocols.
virtual void SetConnectionFlags(int connectionFlags)=0
Set the connection flags to control secure/insecure mode.
virtual bool GetUrl(ProtocolType protocol, QUrl &url) const =0
Generate a complete URL for the specified protocol.
virtual QString GetHost() const =0
Get the server host name or address.
virtual ProtocolTypes GetSupportedProtocols() const =0
Get the list of protocols supported by this connection.
virtual int GetConnectionFlags() const =0
Get the connection flags determining secure/insecure mode.
virtual int GetPort(ProtocolType protocol) const =0
Get the port number for a specific protocol.
Server Communication and Connection Management Module.