mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
1a279c5b2a
We no longer support creating CObjects on the stack. Use construct().
35 lines
876 B
C++
35 lines
876 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GDialog.h>
|
|
|
|
class GMessageBox : public GDialog {
|
|
C_OBJECT(GMessageBox)
|
|
public:
|
|
enum class Type {
|
|
None,
|
|
Information,
|
|
Warning,
|
|
Error,
|
|
};
|
|
|
|
enum class InputType {
|
|
OK,
|
|
OKCancel,
|
|
};
|
|
|
|
virtual ~GMessageBox() override;
|
|
|
|
static int show(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, CObject* parent = nullptr);
|
|
|
|
private:
|
|
explicit GMessageBox(const StringView& text, const StringView& title, Type type = Type::None, InputType = InputType::OK, CObject* parent = nullptr);
|
|
|
|
bool should_include_ok_button() const;
|
|
bool should_include_cancel_button() const;
|
|
void build();
|
|
RefPtr<GraphicsBitmap> icon() const;
|
|
|
|
String m_text;
|
|
Type m_type { Type::None };
|
|
InputType m_input_type { InputType::OK };
|
|
};
|