Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
fingerprint_layer.h
Go to the documentation of this file.
1#ifndef FINGERPRINT_LAYER_H
2#define FINGERPRINT_LAYER_H
3
4#include "../security_layer.h"
5
6class QSvgRenderer;
7class QProgressBar;
8class QLabel;
9
19class FingerprintLayer final : public SecurityLayer {
20 Q_OBJECT
21
22public:
30 explicit FingerprintLayer(QWidget *parent = nullptr);
31
36 ~FingerprintLayer() override;
37
42 void Initialize() override;
43
49 void Reset() override;
50
51private slots:
57 void UpdateProgress();
58
65 void ProcessFingerprint(bool completed);
66
67private:
73
81 bool eventFilter(QObject *obj, QEvent *event) override;
82
89 void UpdateFingerprintScan(int progress_value) const;
90
94 QProgressBar *fingerprint_progress_;
98 QSvgRenderer *svg_renderer_;
105};
106
107#endif // FINGERPRINT_LAYER_H
QProgressBar * fingerprint_progress_
Progress bar indicating the scan progress.
Definition fingerprint_layer.h:94
QSvgRenderer * svg_renderer_
Renderer used to load and draw SVG fingerprint images.
Definition fingerprint_layer.h:98
~FingerprintLayer() override
Destructor. Stops and deletes the progress timer and the SVG renderer.
Definition fingerprint_layer.cpp:77
void UpdateFingerprintScan(int progress_value) const
Updates the visual appearance of the fingerprint image during the scan. Renders the SVG and applies a...
Definition fingerprint_layer.cpp:247
QTimer * fingerprint_timer_
Timer controlling the progress update while the mouse button is held.
Definition fingerprint_layer.h:96
QLabel * fingerprint_image_
Label displaying the fingerprint image.
Definition fingerprint_layer.h:92
void LoadRandomFingerprint()
Loads a random fingerprint SVG file from fingerprint_files_ and renders it into base_fingerprint_....
Definition fingerprint_layer.cpp:126
void ProcessFingerprint(bool completed)
Handles the completion of the fingerprint scan. Changes the UI element styles (border,...
Definition fingerprint_layer.cpp:193
void Initialize() override
Initializes the layer for display. Resets the progress bar and styles, loads a random fingerprint ima...
Definition fingerprint_layer.cpp:90
FingerprintLayer(QWidget *parent=nullptr)
Constructs a FingerprintLayer. Initializes the UI elements (title, fingerprint image label,...
Definition fingerprint_layer.cpp:16
void UpdateProgress()
Slot called periodically by fingerprint_timer_ when the user is holding the mouse button....
Definition fingerprint_layer.cpp:179
QString current_fingerprint_
Path to the currently loaded fingerprint SVG file.
Definition fingerprint_layer.h:104
QImage base_fingerprint_
The base image of the fingerprint (rendered SVG in gray).
Definition fingerprint_layer.h:100
void Reset() override
Resets the layer to its initial state. Stops the progress timer, resets the progress bar value and st...
Definition fingerprint_layer.cpp:98
bool eventFilter(QObject *obj, QEvent *event) override
Filters mouse press and release events on the fingerprint_image_ label. Starts the fingerprint_timer_...
Definition fingerprint_layer.cpp:276
QStringList fingerprint_files_
List of paths to available fingerprint SVG files.
Definition fingerprint_layer.h:102
SecurityLayer(QWidget *parent=nullptr)
Constructs a SecurityLayer.
Definition security_layer.h:20