IGUIFileOpenDialog.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "IGUIElement.h"
  6. #include "path.h"
  7. namespace irr
  8. {
  9. namespace gui
  10. {
  11. //! Standard file chooser dialog.
  12. /** \warning When the user selects a folder this does change the current working directory
  13. \par This element can create the following events of type EGUI_EVENT_TYPE:
  14. \li EGET_DIRECTORY_SELECTED
  15. \li EGET_FILE_SELECTED
  16. \li EGET_FILE_CHOOSE_DIALOG_CANCELLED
  17. */
  18. class IGUIFileOpenDialog : public IGUIElement
  19. {
  20. public:
  21. //! constructor
  22. IGUIFileOpenDialog(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect<s32> rectangle) :
  23. IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {}
  24. //! Returns the filename of the selected file converted to wide characters. Returns NULL if no file was selected.
  25. virtual const wchar_t *getFileName() const = 0;
  26. //! Returns the filename of the selected file. Is empty if no file was selected.
  27. virtual const io::path &getFileNameP() const = 0;
  28. //! Returns the directory of the selected file. Empty if no directory was selected.
  29. virtual const io::path &getDirectoryName() const = 0;
  30. //! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected.
  31. virtual const wchar_t *getDirectoryNameW() const = 0;
  32. };
  33. } // end namespace gui
  34. } // end namespace irr