Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
wavelength_creator.h
Go to the documentation of this file.
1#ifndef WAVELENGTH_CREATOR_H
2#define WAVELENGTH_CREATOR_H
3
4#include <QObject>
5
16class WavelengthCreator final : public QObject {
17 Q_OBJECT
18
19public:
25 static WavelengthCreator instance;
26 return &instance;
27 }
28
41 bool CreateWavelength(QString frequency, bool is_password_protected,
42 const QString &password);
43
44signals:
49 void wavelengthCreated(QString frequency);
50
56 void wavelengthClosed(QString frequency);
57
62 void connectionError(const QString &error_message);
63
64private:
69 explicit WavelengthCreator(QObject *parent = nullptr) : QObject(parent) {
70 }
71
75 ~WavelengthCreator() override = default;
76
81
86};
87
88#endif // WAVELENGTH_CREATOR_H
void wavelengthCreated(QString frequency)
Emitted when the wavelength has been successfully created and registered with the server.
WavelengthCreator(QObject *parent=nullptr)
Private constructor to enforce the singleton pattern.
Definition wavelength_creator.h:69
WavelengthCreator & operator=(const WavelengthCreator &)=delete
Deleted assignment operator to prevent assignment.
~WavelengthCreator() override=default
Private destructor.
void wavelengthClosed(QString frequency)
Emitted if the WebSocket connection for the wavelength is closed unexpectedly (e.g....
void connectionError(const QString &error_message)
Emitted if an error occurs during the connection or registration process.
bool CreateWavelength(QString frequency, bool is_password_protected, const QString &password)
Attempts to create and register a new wavelength with the relay server. Checks if the wavelength alre...
Definition wavelength_creator.cpp:13
static WavelengthCreator * GetInstance()
Gets the singleton instance of the WavelengthCreator.
Definition wavelength_creator.h:24
WavelengthCreator(const WavelengthCreator &)=delete
Deleted copy constructor to prevent copying.