PageRenderTime 16ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/indra/newview/lldirpicker.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 105 lines | 48 code | 21 blank | 36 comment | 1 complexity | 599993fbbdb27bb2a2f4ea37ad86adfe MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @dir lldirpicker.h
  3. * @brief OS-specific dir picker
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. // OS specific dir selection dialog. This is implemented as a
  27. // singleton class, so call the instance() method to get the working
  28. // instance.
  29. #ifndef LL_LLDIRPICKER_H
  30. #define LL_LLDIRPICKER_H
  31. #include "stdtypes.h"
  32. #if LL_DARWIN
  33. #include <Carbon/Carbon.h>
  34. // AssertMacros.h does bad things.
  35. #undef verify
  36. #undef check
  37. #undef require
  38. #include <vector>
  39. #include "llstring.h"
  40. #endif
  41. // Need commdlg.h for OPENDIRNAMEA
  42. #ifdef LL_WINDOWS
  43. #include <commdlg.h>
  44. #endif
  45. class LLFilePicker;
  46. class LLDirPicker
  47. {
  48. public:
  49. // calling this before main() is undefined
  50. static LLDirPicker& instance( void ) { return sInstance; }
  51. BOOL getDir(std::string* filename);
  52. std::string getDirName();
  53. // clear any lists of buffers or whatever, and make sure the dir
  54. // picker isn't locked.
  55. void reset();
  56. private:
  57. enum
  58. {
  59. SINGLE_DIRNAME_BUFFER_SIZE = 1024,
  60. //DIRNAME_BUFFER_SIZE = 65536
  61. DIRNAME_BUFFER_SIZE = 65000
  62. };
  63. void buildDirname( void );
  64. bool check_local_file_access_enabled();
  65. #if LL_DARWIN
  66. NavDialogCreationOptions mNavOptions;
  67. static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector,
  68. NavCBRecPtr callBackParms, void* callBackUD);
  69. OSStatus doNavChooseDialog();
  70. #endif
  71. #if LL_LINUX || LL_SOLARIS
  72. // On Linux we just implement LLDirPicker on top of LLFilePicker
  73. LLFilePicker *mFilePicker;
  74. #endif
  75. std::string* mFileName;
  76. std::string mDir;
  77. bool mLocked;
  78. static LLDirPicker sInstance;
  79. public:
  80. // don't call these directly please.
  81. LLDirPicker();
  82. ~LLDirPicker();
  83. };
  84. #endif