1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/io/nsAppFileLocationProvider.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsAppFileLocationProvider_h 1.10 +#define nsAppFileLocationProvider_h 1.11 + 1.12 +#include "nsIDirectoryService.h" 1.13 +#include "nsIFile.h" 1.14 +#include "mozilla/Attributes.h" 1.15 + 1.16 +class nsIFile; 1.17 + 1.18 +//***************************************************************************** 1.19 +// class nsAppFileLocationProvider 1.20 +//***************************************************************************** 1.21 + 1.22 +class nsAppFileLocationProvider MOZ_FINAL : public nsIDirectoryServiceProvider2 1.23 +{ 1.24 +public: 1.25 + nsAppFileLocationProvider(); 1.26 + 1.27 + NS_DECL_THREADSAFE_ISUPPORTS 1.28 + NS_DECL_NSIDIRECTORYSERVICEPROVIDER 1.29 + NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 1.30 + 1.31 +private: 1.32 + ~nsAppFileLocationProvider() {} 1.33 + 1.34 +protected: 1.35 + NS_METHOD CloneMozBinDirectory(nsIFile **aLocalFile); 1.36 + /** 1.37 + * Get the product directory. This is a user-specific directory for storing 1.38 + * application settings (e.g. the Application Data directory on windows 1.39 + * systems). 1.40 + * @param aLocal If true, should try to get a directory that is only stored 1.41 + * locally (ie not transferred with roaming profiles) 1.42 + */ 1.43 + NS_METHOD GetProductDirectory(nsIFile **aLocalFile, 1.44 + bool aLocal = false); 1.45 + NS_METHOD GetDefaultUserProfileRoot(nsIFile **aLocalFile, 1.46 + bool aLocal = false); 1.47 + 1.48 +#if defined(MOZ_WIDGET_COCOA) 1.49 + static bool IsOSXLeopard(); 1.50 +#endif 1.51 + 1.52 + nsCOMPtr<nsIFile> mMozBinDirectory; 1.53 +}; 1.54 + 1.55 +#endif