NDEVR
API Documentation
ConnectionWidget.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: ConnectionWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Connection.h>
35#include <NDEVR/Button.h>
36#include <QWidget>
37class QLabel;
38class QGridLayout;
39namespace NDEVR
40{
41 class Button;
42 class Connection;
43 struct ConnectionInfo;
49 class HARDWARE_WIDGETS_API ConnectionWidget : public QWidget
50 {
51 Q_OBJECT
52 public:
57 explicit ConnectionWidget(QWidget* parent = nullptr);
62 void setConnection(const ConnectionInfo& sensor);
67 void setConnection(const StringView& sensor_id);
74 void setAllowDisconnect(bool allow_disconnect);
79 void setAllowConnect(bool allow_connect);
94 void setAllowClearButton(bool show);
105 signals:
108 protected slots:
111 protected:
114 protected:
120 bool m_allow_disconnect = false;
121 bool m_allow_connect = false;
122 bool m_allow_clear_button = false;
123 };
124}
A core widget that allows the user to click one of many button types.
Definition Button.h:68
ButtonState
Defines the visual size and style of the button.
Definition Button.h:76
A dialog with many different ConnectionDialog objects that allow the user to specify a particular Con...
void setConnection(const ConnectionInfo &sensor)
Sets the connection to display and manage using connection info.
bool m_allow_connect
Whether the connect action is allowed.
void connectionModifiedSignal()
Emitted when the connection configuration has been modified.
void connectionRequested()
Emitted when the user requests a connection attempt.
void updateLayout()
Rebuilds the widget layout based on current settings.
void updatedSlot()
Slot called when the connection state or configuration is updated.
void setAllowConnect(bool allow_connect)
Sets whether the user is allowed to initiate a connection.
ConnectionSetupWidget * m_setup_widget
The connection setup dialog widget.
void setButtonState(Button::ButtonState button_state)
Sets the visual state of the connection buttons.
void clearConnection()
Clears the current connection and resets the widget.
Button * m_connection_state_button
Button showing connection state and toggling connect/disconnect.
void setShowBluetoothSettingsButton(bool show)
Sets whether to show a button for opening Bluetooth system settings.
void setConnection(const StringView &sensor_id)
Sets the connection to display and manage by its identifier string.
Button * m_clear_button
Button to clear the current connection.
void setAllowDisconnect(bool allow_disconnect)
Sets whether the user is allowed to disconnect.
void setAllowClearButton(bool show)
Sets whether to show a button for clearing the connection.
ConnectionWidget(QWidget *parent=nullptr)
Constructs a ConnectionWidget.
ConnectionInfo m_connection_info
The current connection configuration.
Button * m_connection_setup_button
Button to open the connection setup dialog.
bool m_allow_clear_button
Whether the clear button is shown.
bool m_allow_disconnect
Whether the disconnect action is allowed.
void setShowWiFiSettingsButton(bool show)
Sets whether to show a button for opening Wi-Fi system settings.
ConnectionInfo connectionInfo() const
Returns the current connection info.
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Definition Connection.h:316
The core String View class for the NDEVR API.
Definition StringView.h:58
The primary namespace for the NDEVR SDK.
A structure designed to store information about a specific Connection.
Definition Connection.h:90