Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / xpcom / io / CocoaFileUtils.h
blob4055787fb6718d25762b67063f6c9a541b8703ba
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // This namespace contains methods with Obj-C/Cocoa implementations. The header
8 // is C/C++ for inclusion in C/C++-only files.
10 #ifndef CocoaFileUtils_h_
11 #define CocoaFileUtils_h_
13 #include "nscore.h"
14 #include "nsString.h"
15 #include <CoreFoundation/CoreFoundation.h>
17 namespace CocoaFileUtils {
19 nsresult RevealFileInFinder(CFURLRef aUrl);
20 nsresult OpenURL(CFURLRef aUrl);
21 nsresult GetFileCreatorCode(CFURLRef aUrl, OSType* aCreatorCode);
22 nsresult SetFileCreatorCode(CFURLRef aUrl, OSType aCreatorCode);
23 nsresult GetFileTypeCode(CFURLRef aUrl, OSType* aTypeCode);
24 nsresult SetFileTypeCode(CFURLRef aUrl, OSType aTypeCode);
26 // Can be called off of the main thread.
27 void AddOriginMetadataToFile(const CFStringRef filePath,
28 const CFURLRef sourceURL,
29 const CFURLRef referrerURL);
30 // Can be called off of the main thread.
31 void AddQuarantineMetadataToFile(const CFStringRef filePath,
32 const CFURLRef sourceURL,
33 const CFURLRef referrerURL,
34 const bool isFromWeb,
35 const bool createProps = false);
36 // Can be called off of the main thread.
37 void CopyQuarantineReferrerUrl(const CFStringRef aFilePath,
38 nsAString& aReferrer);
40 CFURLRef GetTemporaryFolderCFURLRef();
42 CFURLRef GetProductDirectoryCFURLRef(bool aLocal);
44 } // namespace CocoaFileUtils
46 #endif