Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
handprint_layer.h
Go to the documentation of this file.
1#ifndef HANDPRINT_LAYER_H
2#define HANDPRINT_LAYER_H
3
4#include "../security_layer.h"
5
6class QSvgRenderer;
7class QProgressBar;
8class QLabel;
9
19class HandprintLayer final : public SecurityLayer {
20 Q_OBJECT
21
22public:
30 explicit HandprintLayer(QWidget *parent = nullptr);
31
36 ~HandprintLayer() override;
37
42 void Initialize() override;
43
49 void Reset() override;
50
51private slots:
57 void UpdateProgress();
58
65 void ProcessHandprint(bool completed);
66
67private:
74
82 bool eventFilter(QObject *obj, QEvent *event) override;
83
90 void UpdateHandprintScan(int progress_value) const;
91
95 QProgressBar *handprint_progress_;
98
100 QSvgRenderer *svg_renderer_;
104 QStringList handprint_files_;
107};
108
109#endif // HANDPRINT_LAYER_H
QImage base_handprint_
The base image of the handprint (rendered SVG in gray).
Definition handprint_layer.h:102
void LoadRandomHandprint()
Loads the handprint SVG file from handprint_files_ and renders it into base_handprint_....
Definition handprint_layer.cpp:127
~HandprintLayer() override
Destructor. Stops and deletes the progress timer and the SVG renderer.
Definition handprint_layer.cpp:77
QSvgRenderer * svg_renderer_
Renderer used to load and draw the SVG handprint image.
Definition handprint_layer.h:100
void UpdateHandprintScan(int progress_value) const
Updates the visual appearance of the handprint image during the scan. Renders the SVG and applies a c...
Definition handprint_layer.cpp:249
QLabel * handprint_image_
Label displaying the handprint image.
Definition handprint_layer.h:93
QStringList handprint_files_
List of paths to available handprint SVG files (currently only one).
Definition handprint_layer.h:104
void UpdateProgress()
Slot called periodically by handprint_timer_ when the user is holding the mouse button....
Definition handprint_layer.cpp:180
QProgressBar * handprint_progress_
Progress bar indicating the scan progress.
Definition handprint_layer.h:95
HandprintLayer(QWidget *parent=nullptr)
Constructs a HandprintLayer. Initializes the UI elements (title, handprint image label,...
Definition handprint_layer.cpp:17
void ProcessHandprint(bool completed)
Handles the completion of the handprint scan. Changes the UI element styles (border,...
Definition handprint_layer.cpp:195
QTimer * handprint_timer_
Timer controlling the progress update while the mouse button is held.
Definition handprint_layer.h:97
QString current_handprint_
Path to the currently loaded handprint SVG file.
Definition handprint_layer.h:106
void Initialize() override
Initializes the layer for display. Resets the progress bar and styles, loads the handprint image,...
Definition handprint_layer.cpp:90
void Reset() override
Resets the layer to its initial state. Stops the progress timer, resets the progress bar value and st...
Definition handprint_layer.cpp:98
bool eventFilter(QObject *obj, QEvent *event) override
Filters mouse press and release events on the handprint_image_ label. Starts the handprint_timer_ on ...
Definition handprint_layer.cpp:276
SecurityLayer(QWidget *parent=nullptr)
Constructs a SecurityLayer.
Definition security_layer.h:20