NDEVR
API Documentation
BluetoothConnectionDialog.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: BluetoothConnectionDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include "NDEVRBluetooth/Headers/DLLInfo.h"
35#include "HardwareWidgets/Headers/ConnectionDialog.h"
36#include <NDEVR/Connection.h>
37#include "Base/Headers/Dictionary.h"
38#include <QWidget>
39namespace Ui
40{
41 class BluetoothSetupUI;
42}
43
44class QIntValidator;
45class QBluetoothSocket;
46class QBluetoothDeviceInfo;
47namespace NDEVR
48{
49 class Connection;
50 class InfoPipe;
51 class Thread;
55 class NDEVR_BLUETOOTH_API BluetoothConnectionDialog : public ConnectionDialog
56 {
57 Q_OBJECT
58 public:
63 explicit BluetoothConnectionDialog(QWidget* parent = nullptr);
67 ~BluetoothConnectionDialog();
72 void setDevice(const ConnectionInfo& device);
77 QBluetoothSocket* getBluetoothPort() const;
82 ConnectionInfo device() const;
86 virtual void clear() override;
91 virtual ConnectionInfo connectionInfo() const override;
96 virtual void setConnectionInfo(const ConnectionInfo& connection) override;
102 virtual bool handlesConnection(const ConnectionInfo& connection) override;
107 virtual void showEvent(QShowEvent* event) override;
108 private slots:
113 void showPortInfo(int idx);
117 void apply();
121 void cancel();
122 private:
126 void fillPortsParameters();
130 void fillPortsInfo();
131
132 private:
133 Dictionary<String, ConnectionInfo> m_devices;
134 Dictionary<String, ConnectionInfo> m_services;
135 Ui::BluetoothSetupUI* ui = nullptr;
136 ConnectionSearchParameters m_params;
137 ConnectionInfo m_selected_device;
138 Thread* m_find_device_thread = nullptr;
139 Thread* m_find_service_thread = nullptr;
140 };
145 {
146 public:
152 virtual bool handlesType(const StringView& connection) const override;
157 virtual TranslatedString title() const override;
162 virtual StringView icon() const override;
167 virtual ConnectionDialog* createConnectionDialog() const override;
168 };
169}
A ConnectionDialog that allows the user to modify a Bluetooth connection.
virtual ConnectionDialog * createConnectionDialog() const override
Creates a new BluetoothConnectionDialog instance.
virtual StringView icon() const override
Returns the icon name associated with Bluetooth connections.
virtual TranslatedString title() const override
Returns the display title for Bluetooth connections.
virtual bool handlesType(const StringView &connection) const override
Checks whether this factory handles the given connection type string.
Used to, given a Connection, generate an appropriate ConnectionDialog to allow adjustment of paramete...
A virtual dialog that provides an interface that allows the user to adjust certain parameters for a C...
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Definition Connection.h:316
A light-weight base class for Log that allows processes to update, without the need for additional in...
The core String View class for the NDEVR API.
Definition StringView.h:58
The default thread class for executing concurrent sequences in the NDEVR API.
Definition Thread.h:113
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.