coastline 0.0.4
Loading...
Searching...
No Matches
coastline::SetupWizard Class Reference

Manage setup screens, their controls and focus, the file browser, and the import. More...

#include <setupwizard.h>

Public Member Functions

 SetupWizard (WizardServices services)
 Create the initial setup screen without importing assets.
 ~SetupWizard ()
 Cancel active search or import work and wait for the worker thread.
 SetupWizard (const SetupWizard &)=delete
 Prevent copying active search and import threads.
SetupWizard & operator= (const SetupWizard &)=delete
 Prevent assignment of active search and import threads.
void Handle (const WizardEvent &event)
 Act on an event of the keyboard or the mouse.
void Update ()
 Take the progress of the import, and move to the next screen when it ends.
void Draw (TextGrid &grid, double seconds) const
 Draw the wizard.
WizardScreen Screen () const
bool Checking () const
WizardEnd End () const
bool Portable () const
std::vector< WizardControl > Controls () const
std::optional< WizardControlId > Focus () const
bool BrowserOpen () const
const std::vector< BrowserEntry > & BrowserEntries () const
int BrowserSelection () const
std::vector< std::string > MessageLines () const
std::string Text (WizardControlId id) const
std::string Reason (WizardControlId id) const
std::string SelectedText () const
const WizardSearchResult & SearchResult () const
const std::filesystem::path & LastDirectory () const

Detailed Description

Manage setup screens, their controls and focus, the file browser, and the import.

Constructor & Destructor Documentation

◆ SetupWizard() [1/2]

coastline::SetupWizard::SetupWizard ( WizardServices services)
explicit

Create the initial setup screen without importing assets.

Parameters
servicesThe checks and the import of the files.

◆ ~SetupWizard()

coastline::SetupWizard::~SetupWizard ( )

Cancel active search or import work and wait for the worker thread.

◆ SetupWizard() [2/2]

coastline::SetupWizard::SetupWizard ( const SetupWizard & )
delete

Prevent copying active search and import threads.

Member Function Documentation

◆ operator=()

SetupWizard & coastline::SetupWizard::operator= ( const SetupWizard & )
delete

Prevent assignment of active search and import threads.

◆ Handle()

void coastline::SetupWizard::Handle ( const WizardEvent & event)

Act on an event of the keyboard or the mouse.

Parameters
eventThe event.

◆ Update()

void coastline::SetupWizard::Update ( )

Take the progress of the import, and move to the next screen when it ends.

◆ Draw()

void coastline::SetupWizard::Draw ( TextGrid & grid,
double seconds ) const

Draw the wizard.

Parameters
gridThe grid, every cell of which is written.
secondsThe time, for the blink of the text cursor.

◆ Screen()

WizardScreen coastline::SetupWizard::Screen ( ) const
Returns
The screen that shows.

◆ Checking()

bool coastline::SetupWizard::Checking ( ) const
Returns
Whether a check of a disc or ROM path runs on a thread, with Update() applying it.

◆ End()

WizardEnd coastline::SetupWizard::End ( ) const
Returns
How the wizard ended, or WizardEnd::Running.

◆ Portable()

bool coastline::SetupWizard::Portable ( ) const
Returns
Whether the import targets portable storage.

◆ Controls()

std::vector< WizardControl > coastline::SetupWizard::Controls ( ) const
Returns
The controls of the dialog on top: the message, the browser, or the screen.

◆ Focus()

std::optional< WizardControlId > coastline::SetupWizard::Focus ( ) const
Returns
The control with the focus in the dialog on top, or nothing.

◆ BrowserOpen()

bool coastline::SetupWizard::BrowserOpen ( ) const
Returns
Whether the file browser shows.

◆ BrowserEntries()

const std::vector< BrowserEntry > & coastline::SetupWizard::BrowserEntries ( ) const
Returns
The entries the file browser lists.

◆ BrowserSelection()

int coastline::SetupWizard::BrowserSelection ( ) const
Returns
The entry of the browser chosen, from 0.

◆ MessageLines()

std::vector< std::string > coastline::SetupWizard::MessageLines ( ) const
Returns
The lines of the message that shows, or none.

◆ Text()

std::string coastline::SetupWizard::Text ( WizardControlId id) const
Parameters
idA text box.
Returns
The text of the text box in UTF-8.

◆ Reason()

std::string coastline::SetupWizard::Reason ( WizardControlId id) const
Parameters
idA text box.
Returns
Why the path of the text box failed its check, or empty when it passed or is empty.

◆ SelectedText()

std::string coastline::SetupWizard::SelectedText ( ) const
Returns
The selection of the focused text field, in UTF-8.

◆ SearchResult()

const WizardSearchResult & coastline::SetupWizard::SearchResult ( ) const
Returns
The images discovered during the directory search.

◆ LastDirectory()

const std::filesystem::path & coastline::SetupWizard::LastDirectory ( ) const
Returns
The directory last browsed, or empty.

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