GFilePicker.h 785 B

12345678910111213141516171819202122232425262728
  1. #include <AK/FileSystemPath.h>
  2. #include <LibGUI/GDialog.h>
  3. #include <LibGUI/GTableView.h>
  4. class GDirectoryModel;
  5. class GLabel;
  6. class GFilePicker final : public GDialog {
  7. public:
  8. GFilePicker(const StringView& path = "/", CObject* parent = nullptr);
  9. virtual ~GFilePicker() override;
  10. FileSystemPath selected_file() const { return m_selected_file; }
  11. virtual const char* class_name() const override { return "GFilePicker"; }
  12. private:
  13. void set_preview(const FileSystemPath&);
  14. void clear_preview();
  15. GTableView* m_view { nullptr };
  16. NonnullRefPtr<GDirectoryModel> m_model;
  17. FileSystemPath m_selected_file;
  18. GLabel* m_preview_image_label { nullptr };
  19. GLabel* m_preview_name_label { nullptr };
  20. GLabel* m_preview_geometry_label { nullptr };
  21. };