summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Wizards/AbstractWizardPage.h
blob: a1d6d4131699b10b5c4d6eced80248540cef17c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * 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;

    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();

private:
    bool m_is_final_page { false };
};

}