ladybird/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h
Lenny Maiorani fe3b846ac8 Libraries: Use default constructors/destructors in LibGUI
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-12 14:44:43 -08:00

40 lines
846 B
C++

/*
* Copyright (c) 2021, Nick Vella <nick@nxk.io>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtrVector.h>
#include <LibGUI/Widget.h>
namespace GUI {
class AbstractWizardPage : public Widget {
C_OBJECT_ABSTRACT(AbstractWizardPage);
public:
virtual ~AbstractWizardPage() override = default;
Function<RefPtr<AbstractWizardPage>()> on_next_page;
virtual RefPtr<AbstractWizardPage> next_page();
virtual bool can_go_next();
Function<void()> on_page_enter;
virtual void page_enter();
Function<void()> on_page_leave;
virtual void page_leave();
bool is_final_page() const { return m_is_final_page; }
void set_is_final_page(bool val) { m_is_final_page = val; }
protected:
AbstractWizardPage() = default;
private:
bool m_is_final_page { false };
};
}