selectfile.h 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _SELECTFILE_H
  2. #define _SELECTFILE_H
  3. #include <bfc/common.h>
  4. #include <bfc/ptrlist.h>
  5. #include <bfc/string/StringW.h>
  6. class svc_fileSelector;
  7. class ifc_window;
  8. class SelectFile
  9. {
  10. public:
  11. SelectFile(ifc_window *parent, const wchar_t *menu_prefix = NULL, const wchar_t *menu_suffix = NULL);
  12. ~SelectFile();
  13. void setDefaultDir(const wchar_t *dir); // default dir to use
  14. const wchar_t *getDirectory(); // return base directory after ok clicked
  15. void setIdent(const wchar_t *id); // unless you saved one under this id
  16. void setPopPosition(int x, int y); // in screen coords
  17. int runSelector(const wchar_t *type = NULL, int allow_multiple = FALSE, const wchar_t *extlist = NULL); // if NULL, generate popup
  18. const wchar_t *getType();
  19. int getNumFiles();
  20. const wchar_t *enumFilename(int n);
  21. private:
  22. int xpos, ypos;
  23. int pos_set;
  24. ifc_window *parentWnd;
  25. svc_fileSelector *svc;
  26. PtrList<StringW> types;
  27. StringW prefix_str, suffix_str;
  28. StringW default_dir, ident;
  29. StringW saved_type;
  30. };
  31. #endif