00001 00032 // OS specific dir selection dialog. This is implemented as a 00033 // singleton class, so call the instance() method to get the working 00034 // instance. 00035 00036 #ifndef LL_LLDIRPICKER_H 00037 #define LL_LLDIRPICKER_H 00038 00039 #include "stdtypes.h" 00040 00041 #if LL_DARWIN 00042 #include <Carbon/Carbon.h> 00043 00044 // AssertMacros.h does bad things. 00045 #undef verify 00046 #undef check 00047 #undef require 00048 00049 #include <vector> 00050 #include "llstring.h" 00051 00052 #endif 00053 00054 // Need commdlg.h for OPENDIRNAMEA 00055 #ifdef LL_WINDOWS 00056 #include <commdlg.h> 00057 #endif 00058 00059 class LLFilePicker; 00060 00061 class LLDirPicker 00062 { 00063 public: 00064 // calling this before main() is undefined 00065 static LLDirPicker& instance( void ) { return sInstance; } 00066 00067 BOOL getDir(LLString* filename); 00068 LLString getDirName(); 00069 00070 // clear any lists of buffers or whatever, and make sure the dir 00071 // picker isn't locked. 00072 void reset(); 00073 00074 private: 00075 enum 00076 { 00077 SINGLE_DIRNAME_BUFFER_SIZE = 1024, 00078 //DIRNAME_BUFFER_SIZE = 65536 00079 DIRNAME_BUFFER_SIZE = 65000 00080 }; 00081 00082 void buildDirname( void ); 00083 00084 #if LL_DARWIN 00085 NavDialogCreationOptions mNavOptions; 00086 static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector, 00087 NavCBRecPtr callBackParms, void* callBackUD); 00088 OSStatus doNavChooseDialog(); 00089 00090 #endif 00091 00092 #if LL_LINUX 00093 // On Linux we just implement LLDirPicker on top of LLFilePicker 00094 LLFilePicker *mFilePicker; 00095 #endif 00096 00097 char mDirs[DIRNAME_BUFFER_SIZE]; /*Flawfinder: ignore*/ 00098 LLString* mFileName; 00099 LLString mDir; 00100 BOOL mLocked; 00101 00102 static LLDirPicker sInstance; 00103 00104 public: 00105 // don't call these directly please. 00106 LLDirPicker(); 00107 ~LLDirPicker(); 00108 }; 00109 00110 #endif