AboutDialog.h 981 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2018-2023, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/String.h>
  9. #include <LibCore/Version.h>
  10. #include <LibGUI/Dialog.h>
  11. namespace GUI {
  12. class AboutDialog final : public Dialog {
  13. C_OBJECT_ABSTRACT(AboutDialog)
  14. public:
  15. static ErrorOr<NonnullRefPtr<AboutDialog>> try_create(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
  16. virtual ~AboutDialog() override = default;
  17. static ErrorOr<void> show(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr, RefPtr<Gfx::Bitmap const> window_icon = nullptr);
  18. private:
  19. AboutDialog(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
  20. String m_name;
  21. String m_version_string;
  22. RefPtr<Gfx::Bitmap const> m_icon;
  23. };
  24. }