# Plutonium framework API: pu::ui::Application Class Reference

pu::ui::Application Class Referenceabstract

`#include <ui_Application.hpp>`

## Public Types

using | OnInputCallback = std::function< void(const u64, const u64, const u64, const TouchPoint)>
using | RenderCallback = std::function< void()>
using | RenderOverFunction = std::function< bool(render::Renderer::Ref &)>

## Public Member Functions

| Application (render::Renderer::Ref renderer)
void | LoadLayout (Layout::Ref lyt)
template<typename L >
std::shared_ptr< L > | GetLayout ()
void | Prepare ()
virtual void | OnLoad ()=0
void | AddRenderCallback (RenderCallback render_cb)
void | SetOnInput (OnInputCallback on_ipt_cb)
i32 | ShowDialog (Dialog::Ref &dialog)
i32 | CreateShowDialog (const std::string &title, const std::string &content, const std::vector< std::string > &opts, const bool use_last_opt_as_cancel, const std::string &icon_path="")
void | StartOverlay (Overlay::Ref ovl)
void | StartOverlayWithTimeout (Overlay::Ref ovl, const u64 ms)
void | EndOverlay ()
void | Show ()
void | ShowWithFadeIn ()
bool | IsShown ()
bool | CanBeShown ()
bool | CallForRender ()
bool | CallForRenderWithRenderOver (RenderOverFunction render_over_fn)
void | FadeIn ()
void | FadeOut ()
bool | IsFadedIn ()
void | SetFadeAlphaIncrement (const u8 fade_alpha_increment)
void | OnRender ()
void | Close ()
void | CloseWithFadeOut ()
u64 | GetButtonsDown ()
u64 | GetButtonsUp ()
u64 | GetButtonsHeld ()
HidTouchScreenState | GetTouchState ()

## Static Public Attributes

static constexpr u8 | DefaultFadeAlphaIncrement = 35

## Protected Attributes

bool | loaded
bool | in_render_over
RenderOverFunction | render_over_fn
bool | is_shown
u8 | fade_alpha_increment
i32 | fade_alpha
Layout::Ref | lyt
Overlay::Ref | ovl
u64 | ovl_timeout_ms
std::chrono::steady_clock::time_point | ovl_start_time
std::vector< RenderCallback > | render_cbs
OnInputCallback | on_ipt_cb
render::Renderer::Ref | renderer
PadState | input_pad

## Member Typedef Documentation

## OnInputCallback

using pu::ui::Application::OnInputCallback = std::function<void(const u64, const u64, const u64, const TouchPoint)>

## RenderCallback

using pu::ui::Application::RenderCallback = std::function<void()>

## RenderOverFunction

using pu::ui::Application::RenderOverFunction = std::function<bool(render::Renderer::Ref&)>

## Constructor & Destructor Documentation

## Application()

pu::ui::Application::Application | ( | render::Renderer::Ref | renderer | ) |

## Member Function Documentation

## AddRenderCallback()

void pu::ui::Application::AddRenderCallback | ( | RenderCallback | render_cb | ) |

inline

## CallForRender()

bool pu::ui::Application::CallForRender | ( |  | ) |

## CallForRenderWithRenderOver()

bool pu::ui::Application::CallForRenderWithRenderOver | ( | RenderOverFunction | render_over_fn | ) |

## CanBeShown()

bool pu::ui::Application::CanBeShown | ( |  | ) |

inline

## Close()

void pu::ui::Application::Close | ( |  | ) |

## CloseWithFadeOut()

void pu::ui::Application::CloseWithFadeOut | ( |  | ) |

inline

## CreateShowDialog()

i32 pu::ui::Application::CreateShowDialog | ( | const std::string & | title,
|  | const std::string & | content,
|  | const std::vector< std::string > & | opts,
|  | const bool | use_last_opt_as_cancel,
|  | const std::string & | icon_path = `""`
| ) |  |

## EndOverlay()

void pu::ui::Application::EndOverlay | ( |  | ) |

## FadeIn()

void pu::ui::Application::FadeIn | ( |  | ) |

## FadeOut()

void pu::ui::Application::FadeOut | ( |  | ) |

## GetButtonsDown()

u64 pu::ui::Application::GetButtonsDown | ( |  | ) |

inline

## GetButtonsHeld()

u64 pu::ui::Application::GetButtonsHeld | ( |  | ) |

inline

## GetButtonsUp()

u64 pu::ui::Application::GetButtonsUp | ( |  | ) |

inline

## GetLayout()

template<typename L >

std::shared_ptr< L > pu::ui::Application::GetLayout | ( |  | ) |

inline

## GetTouchState()

HidTouchScreenState pu::ui::Application::GetTouchState | ( |  | ) |

inline

## IsFadedIn()

bool pu::ui::Application::IsFadedIn | ( |  | ) |

inline

## IsShown()

bool pu::ui::Application::IsShown | ( |  | ) |

inline

## LoadLayout()

void pu::ui::Application::LoadLayout | ( | Layout::Ref | lyt | ) |

inline

## OnLoad()

virtual void pu::ui::Application::OnLoad | ( |  | ) |

pure virtual

## OnRender()

void pu::ui::Application::OnRender | ( |  | ) |

## Prepare()

void pu::ui::Application::Prepare | ( |  | ) |

## SetFadeAlphaIncrement()

void pu::ui::Application::SetFadeAlphaIncrement | ( | const u8 | fade_alpha_increment | ) |

inline

## SetOnInput()

void pu::ui::Application::SetOnInput | ( | OnInputCallback | on_ipt_cb | ) |

inline

## Show()

void pu::ui::Application::Show | ( |  | ) |

## ShowDialog()

i32 pu::ui::Application::ShowDialog | ( | Dialog::Ref & | dialog | ) |

inline

## ShowWithFadeIn()

void pu::ui::Application::ShowWithFadeIn | ( |  | ) |

inline

## StartOverlay()

void pu::ui::Application::StartOverlay | ( | Overlay::Ref | ovl | ) |

inline

## StartOverlayWithTimeout()

void pu::ui::Application::StartOverlayWithTimeout | ( | Overlay::Ref | ovl,
|  | const u64 | ms
| ) |  |

## Member Data Documentation

## DefaultFadeAlphaIncrement

constexpr u8 pu::ui::Application::DefaultFadeAlphaIncrement = 35

staticconstexpr

## fade_alpha

i32 pu::ui::Application::fade_alpha

protected

## fade_alpha_increment

u8 pu::ui::Application::fade_alpha_increment

protected

## in_render_over

bool pu::ui::Application::in_render_over

protected

## input_pad

PadState pu::ui::Application::input_pad

protected

## is_shown

bool pu::ui::Application::is_shown

protected

## loaded

bool pu::ui::Application::loaded

protected

## lyt

Layout::Ref pu::ui::Application::lyt

protected

## on_ipt_cb

OnInputCallback pu::ui::Application::on_ipt_cb

protected

## ovl

Overlay::Ref pu::ui::Application::ovl

protected

## ovl_start_time

std::chrono::steady_clock::time_point pu::ui::Application::ovl_start_time

protected

## ovl_timeout_ms

u64 pu::ui::Application::ovl_timeout_ms

protected

## render_cbs

std::vector<RenderCallback> pu::ui::Application::render_cbs

protected

## render_over_fn

RenderOverFunction pu::ui::Application::render_over_fn

protected

## renderer

render::Renderer::Ref pu::ui::Application::renderer

protected

The documentation for this class was generated from the following file:

- Plutonium/include/pu/ui/ui_Application.hpp