IGUIFileOpenDialog.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef IRR_I_GUI_FILE_OPEN_DIALOG_H_INCLUDED
  5. #define IRR_I_GUI_FILE_OPEN_DIALOG_H_INCLUDED
  6. #include "IGUIElement.h"
  7. #include "path.h"
  8. namespace irr
  9. {
  10. namespace gui
  11. {
  12. //! Standard file chooser dialog.
  13. /** \warning When the user selects a folder this does change the current working directory
  14. \par This element can create the following events of type EGUI_EVENT_TYPE:
  15. \li EGET_DIRECTORY_SELECTED
  16. \li EGET_FILE_SELECTED
  17. \li EGET_FILE_CHOOSE_DIALOG_CANCELLED
  18. */
  19. class IGUIFileOpenDialog : public IGUIElement
  20. {
  21. public:
  22. //! constructor
  23. IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
  24. : IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {}
  25. //! Returns the filename of the selected file converted to wide characters. Returns NULL if no file was selected.
  26. virtual const wchar_t* getFileName() const = 0;
  27. //! Returns the filename of the selected file. Is empty if no file was selected.
  28. virtual const io::path& getFileNameP() const = 0;
  29. //! Returns the directory of the selected file. Empty if no directory was selected.
  30. virtual const io::path& getDirectoryName() const = 0;
  31. //! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected.
  32. virtual const wchar_t* getDirectoryNameW() const = 0;
  33. };
  34. } // end namespace gui
  35. } // end namespace irr
  36. #endif