PageRenderTime 525ms CodeModel.GetById 201ms app.highlight 4ms RepoModel.GetById 258ms app.codeStats 0ms

/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
  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
 27// OS specific dir selection dialog. This is implemented as a
 28// singleton class, so call the instance() method to get the working
 29// instance. 
 30
 31#ifndef LL_LLDIRPICKER_H
 32#define LL_LLDIRPICKER_H
 33
 34#include "stdtypes.h"
 35
 36#if LL_DARWIN
 37#include <Carbon/Carbon.h>
 38
 39// AssertMacros.h does bad things.
 40#undef verify
 41#undef check
 42#undef require
 43
 44#include <vector>
 45#include "llstring.h"
 46
 47#endif
 48
 49// Need commdlg.h for OPENDIRNAMEA
 50#ifdef LL_WINDOWS
 51#include <commdlg.h>
 52#endif
 53
 54class LLFilePicker;
 55
 56class LLDirPicker
 57{
 58public:
 59	// calling this before main() is undefined
 60	static LLDirPicker& instance( void ) { return sInstance; }
 61
 62	BOOL getDir(std::string* filename);
 63	std::string getDirName();
 64
 65	// clear any lists of buffers or whatever, and make sure the dir
 66	// picker isn't locked.
 67	void reset();
 68
 69private:
 70	enum
 71	{
 72		SINGLE_DIRNAME_BUFFER_SIZE = 1024,
 73		//DIRNAME_BUFFER_SIZE = 65536
 74		DIRNAME_BUFFER_SIZE = 65000 
 75	};
 76	
 77	void buildDirname( void );
 78	bool check_local_file_access_enabled();
 79
 80#if LL_DARWIN
 81	NavDialogCreationOptions mNavOptions;
 82	static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector,
 83										 NavCBRecPtr callBackParms, void* callBackUD);
 84	OSStatus	doNavChooseDialog();
 85	
 86#endif
 87
 88#if LL_LINUX || LL_SOLARIS
 89	// On Linux we just implement LLDirPicker on top of LLFilePicker
 90	LLFilePicker *mFilePicker;
 91#endif
 92
 93	std::string* mFileName;
 94	std::string  mDir;
 95	bool mLocked;
 96
 97	static LLDirPicker sInstance;
 98	
 99public:
100	// don't call these directly please.
101	LLDirPicker();
102	~LLDirPicker();
103};
104
105#endif