Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
MyEncryptionsScene.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "Scene.hpp"
3 
4 #include <Database/Database.hpp>
5 
7 
8 class MyEncryptionsScene : public Enigma::Scene {
9  public: /* Constructors / Destructor */
10  explicit MyEncryptionsScene();
11  virtual ~MyEncryptionsScene() noexcept = default;
12 
13  private: /* Overrides */
14  void OnCreate() override;
15  [[maybe_unused]] void OnUpdate(const float&) override;
16  void OnDraw() override;
17  void OnImGuiDraw() override;
18  [[maybe_unused]] void OnEvent(Event&) override;
19  void OnDestroy() override;
20 
21  private: /* Callbacks */
22  void OnBackButtonPressed();
23  void OnViewEncryptionButtonPressed(const std::int64_t ide);
24  // returns true if item deleted successfully to notify draw loop that vector range changed
25  bool OnDeleteEncryptionButtonPressed(const std::int64_t ide);
26  void OnSearchEncryptionsByTitle();
27  void OnDeleteAllEncryptions();
28  //void OnExportAllEncryptionsJSON();
29 
30  private: /* Initializers */
31  // Get all Encryptions from database
32  void GetAllEncryptions();
34  void ReformatEncryptionsDateTime();
35 
36  private:
37  std::vector<std::unique_ptr<Encryption>> m_encryptions{}; // encryption records from database
38  Database::OrderBy m_order_by = Database::OrderBy::ID; // order by column
39  Database::Order m_order = Database::Order::Descending; // order desc/asc
40 
41 
42  std::string m_query{}; // title search query
43  bool m_isSearching{false};
44 };
45 
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Definition: Event.hpp:66
virtual ~MyEncryptionsScene() noexcept=default