system_unlock.h 871 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. class QWidget;
  9. class QString;
  10. namespace base {
  11. struct SystemUnlockAvailability {
  12. bool known : 1 = false;
  13. bool available : 1 = false;
  14. bool withBiometrics : 1 = false;
  15. bool withCompanion : 1 = false;
  16. friend inline bool operator==(
  17. SystemUnlockAvailability,
  18. SystemUnlockAvailability) = default;
  19. };
  20. [[nodiscard]] rpl::producer<SystemUnlockAvailability> SystemUnlockStatus(
  21. bool lookupDetails = false);
  22. enum class SystemUnlockResult {
  23. Success,
  24. Cancelled,
  25. FloodError,
  26. };
  27. void SuggestSystemUnlock(
  28. not_null<QWidget*> parent,
  29. const QString &text,
  30. Fn<void(SystemUnlockResult)> done);
  31. } // namespace base