Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
wavelength_leaver.h
Go to the documentation of this file.
1#ifndef WAVELENGTH_LEAVER_H
2#define WAVELENGTH_LEAVER_H
3
4#include <QObject>
5
14class WavelengthLeaver final : public QObject {
15 Q_OBJECT
16
17public:
23 static WavelengthLeaver instance;
24 return &instance;
25 }
26
34 void LeaveWavelength();
35
44 void CloseWavelength(QString frequency);
45
46signals:
51 void wavelengthLeft(QString frequency);
52
57 void wavelengthClosed(QString frequency);
58
59private:
64 explicit WavelengthLeaver(QObject *parent = nullptr) : QObject(parent) {
65 }
66
70 ~WavelengthLeaver() override = default;
71
76
81};
82
83#endif // WAVELENGTH_LEAVER_H
WavelengthLeaver(const WavelengthLeaver &)=delete
Deleted copy constructor to prevent copying.
void LeaveWavelength()
Leaves the currently active wavelength. Retrieves the active frequency from the registry....
Definition wavelength_leaver.cpp:6
~WavelengthLeaver() override=default
Private destructor.
void wavelengthClosed(QString frequency)
Emitted after the host successfully closes a specific wavelength via CloseWavelength().
void wavelengthLeft(QString frequency)
Emitted after the user successfully leaves the active wavelength via LeaveWavelength().
WavelengthLeaver & operator=(const WavelengthLeaver &)=delete
Deleted assignment operator to prevent assignment.
WavelengthLeaver(QObject *parent=nullptr)
Private constructor to enforce the singleton pattern.
Definition wavelength_leaver.h:64
static WavelengthLeaver * GetInstance()
Gets the singleton instance of the WavelengthLeaver.
Definition wavelength_leaver.h:22
void CloseWavelength(QString frequency)
Closes a specific wavelength (only if the current user is the host). Checks if the user is the host f...
Definition wavelength_leaver.cpp:43