mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-02-06 12:22:00 -05:00
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "application-desktop/widgets/PinLock.hpp"
|
|
|
|
namespace gui
|
|
{
|
|
class ChangePasscodeLockHandler
|
|
{
|
|
public:
|
|
ChangePasscodeLockHandler();
|
|
|
|
auto checkPasscode(unsigned int currentLockPassHash) -> PinLock::LockState;
|
|
[[nodiscard]] auto getLock() -> PinLock &
|
|
{
|
|
return lock;
|
|
}
|
|
[[nodiscard]] auto getNewPasscodeHash() const noexcept -> unsigned int
|
|
{
|
|
return newPasscodeHash;
|
|
}
|
|
auto newPasscodeConfirmed() -> PinLock::LockState;
|
|
auto newPasscodeProvided() -> PinLock::LockState;
|
|
|
|
private:
|
|
using OnActivatedCallback = std::function<void(PinLock::LockType type, const std::vector<unsigned int> &)>;
|
|
auto activateLock(OnActivatedCallback onActivatedCallback) -> PinLock::LockState;
|
|
|
|
PinLock lock;
|
|
unsigned int newPasscodeHash;
|
|
};
|
|
} // namespace gui
|