Files
MuditaOS/module-apps/application-settings-new/widgets/ChangePasscodeLockHandler.hpp
Mateusz Grzegorzek 8856a65641 [EGD-4995] Add changing passcode windows flow
Implement changing passcode windows flow
2021-01-18 15:12:25 +01:00

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