NDEVR
API Documentation
ConnectionDialog.h
1#pragma once
2#include "DLLInfo.h"
3#include "NDEVR/SoftwareService.h"
4#include <NDEVR/Connection.h>
5#include <QWidget>
6namespace NDEVR
7{
12 class HARDWARE_WIDGETS_API ConnectionDialog : public QWidget
13 {
14 Q_OBJECT
15 public:
20 ConnectionDialog(QWidget* parent = nullptr);
26 virtual Connection* createConnection(const Model& model) const;
28 virtual void clear() = 0;
33 virtual ConnectionInfo connectionInfo() const = 0;
38 virtual void setConnectionInfo(const ConnectionInfo& connection) = 0;
44 virtual bool handlesConnection(const ConnectionInfo& connection) = 0;
45 signals:
47 void cancelSignal();
48 };
49
53 class HARDWARE_WIDGETS_API ConnectionDialogFactory : public SoftwareService, public SoftwareServiceManager
54 {
55 public:
61 virtual bool handlesConnection(const ConnectionInfo& connection) const;
66 virtual TranslatedString title() const = 0;
71 virtual StringView icon() const = 0;
77 virtual bool handlesType(const StringView& type) const = 0;
83 public:
94 protected:
96 };
97}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Used to, given a Connection, generate an appropriate ConnectionDialog to allow adjustment of paramete...
virtual TranslatedString title() const =0
Returns the display title for this connection type.
virtual bool handlesType(const StringView &type) const =0
Checks whether this factory handles the specified connection type string.
virtual ConnectionDialog * createConnectionDialog() const =0
Creates a new ConnectionDialog instance for this connection type.
static void RegisterConnectionFactory(ConnectionDialogFactory *factory)
Registers a connection dialog factory for use by the application.
virtual bool handlesConnection(const ConnectionInfo &connection) const
Checks whether this factory can produce a dialog for the given connection.
virtual StringView icon() const =0
Returns the icon name associated with this connection type.
static Buffer< ConnectionDialogFactory * > s_registered_factories
All registered connection dialog factories.
static Buffer< ConnectionDialogFactory * > ConnectionDialogFactories()
Returns all registered ConnectionDialogFactory instances.
A virtual dialog that provides an interface that allows the user to adjust certain parameters for a C...
ConnectionDialog(QWidget *parent=nullptr)
Constructs a ConnectionDialog.
virtual void clear()=0
Clears all user-entered connection parameters in the dialog.
virtual ConnectionInfo connectionInfo() const =0
Returns the connection info configured by the user in this dialog.
void cancelSignal()
Emitted when the user cancels the dialog.
void acceptedSignal()
Emitted when the user accepts the connection configuration.
virtual void setConnectionInfo(const ConnectionInfo &connection)=0
Populates the dialog fields from the given connection info.
virtual bool handlesConnection(const ConnectionInfo &connection)=0
Checks whether this dialog can handle the given connection type.
virtual Connection * createConnection(const Model &model) const
Creates a Connection object from the current dialog settings and associates it with a model.
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Definition Connection.h:316
A core class that represents a node on model hierarchy.
Definition Model.h:292
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String View class for the NDEVR API.
Definition StringView.h:58
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
A structure designed to store information about a specific Connection.
Definition Connection.h:90