applets.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <vector>
  7. #include "common/swap.h"
  8. union ResultCode;
  9. namespace Frontend {
  10. class SoftwareKeyboardApplet;
  11. }
  12. namespace Service::AM {
  13. class IStorage;
  14. namespace Applets {
  15. class Applet {
  16. public:
  17. Applet();
  18. virtual ~Applet();
  19. virtual void Initialize(std::vector<std::shared_ptr<IStorage>> storage);
  20. virtual bool TransactionComplete() const = 0;
  21. virtual ResultCode GetStatus() const = 0;
  22. virtual void ReceiveInteractiveData(std::shared_ptr<IStorage> storage) = 0;
  23. virtual IStorage Execute() = 0;
  24. bool IsInitialized() const {
  25. return initialized;
  26. }
  27. protected:
  28. struct CommonArguments {
  29. u32_le arguments_version;
  30. u32_le size;
  31. u32_le library_version;
  32. u32_le theme_color;
  33. u8 play_startup_sound;
  34. u64_le system_tick;
  35. };
  36. static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size.");
  37. std::vector<std::shared_ptr<IStorage>> storage_stack;
  38. bool initialized = false;
  39. };
  40. } // namespace Applets
  41. } // namespace Service::AM