Bug 1858509 add thread-safety annotations around MediaSourceDemuxer::mMonitor r=alwu
[gecko.git] / widget / nsFilePickerProxy.h
blobef90f9d9c5a0e236107fd7501618a1a82a284839
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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/. */
6 #ifndef NSFILEPICKERPROXY_H
7 #define NSFILEPICKERPROXY_H
9 #include "nsBaseFilePicker.h"
10 #include "nsString.h"
11 #include "nsIURI.h"
12 #include "nsTArray.h"
13 #include "nsCOMArray.h"
15 #include "mozilla/dom/PFilePickerChild.h"
16 #include "mozilla/dom/UnionTypes.h"
18 class nsIWidget;
19 class nsIFile;
20 class nsPIDOMWindowInner;
22 /**
23 This class creates a proxy file picker to be used in content processes.
24 The file picker just collects the initialization data and when Show() is
25 called, remotes everything to the chrome process which in turn can show a
26 platform specific file picker.
28 class nsFilePickerProxy : public nsBaseFilePicker,
29 public mozilla::dom::PFilePickerChild {
30 public:
31 nsFilePickerProxy();
33 NS_DECL_ISUPPORTS
35 // nsIFilePicker (less what's in nsBaseFilePicker)
36 NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
37 nsIFilePicker::Mode aMode) override;
38 NS_IMETHOD AppendFilter(const nsAString& aTitle,
39 const nsAString& aFilter) override;
40 NS_IMETHOD GetCapture(nsIFilePicker::CaptureTarget* aCapture) override;
41 NS_IMETHOD SetCapture(nsIFilePicker::CaptureTarget aCapture) override;
42 NS_IMETHOD GetDefaultString(nsAString& aDefaultString) override;
43 NS_IMETHOD SetDefaultString(const nsAString& aDefaultString) override;
44 NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension) override;
45 NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension) override;
46 NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override;
47 NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
48 NS_IMETHOD GetFile(nsIFile** aFile) override;
49 NS_IMETHOD GetFileURL(nsIURI** aFileURL) override;
50 NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override;
52 NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue) override;
53 NS_IMETHOD GetDomFileOrDirectoryEnumerator(
54 nsISimpleEnumerator** aValue) override;
56 NS_IMETHOD Open(nsIFilePickerShownCallback* aCallback) override;
58 // PFilePickerChild
59 virtual mozilla::ipc::IPCResult Recv__delete__(
60 const MaybeInputData& aData,
61 const nsIFilePicker::ResultCode& aResult) override;
63 private:
64 ~nsFilePickerProxy();
65 void InitNative(nsIWidget*, const nsAString&) override;
66 nsresult Show(nsIFilePicker::ResultCode* aReturn) override;
67 nsresult ResolveSpecialDirectory(const nsAString& aSpecialDirectory) override;
69 void ActorDestroy(ActorDestroyReason aWhy) override;
71 nsTArray<mozilla::dom::OwningFileOrDirectory> mFilesOrDirectories;
72 nsCOMPtr<nsIFilePickerShownCallback> mCallback;
74 int16_t mSelectedType;
75 nsString mFile;
76 nsString mDefault;
77 nsString mDefaultExtension;
78 nsIFilePicker::CaptureTarget mCapture;
80 bool mIPCActive;
82 nsTArray<nsString> mFilters;
83 nsTArray<nsString> mFilterNames;
86 #endif // NSFILEPICKERPROXY_H