1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
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"
13 #include "nsCOMArray.h"
15 #include "mozilla/dom/PFilePickerChild.h"
22 This class creates a proxy file picker to be used in content processes.
23 The file picker just collects the initialization data and when Show() is
24 called, remotes everything to the chrome process which in turn can show a
25 platform specific file picker.
27 class nsFilePickerProxy
: public nsBaseFilePicker
,
28 public mozilla::dom::PFilePickerChild
35 // nsIFilePicker (less what's in nsBaseFilePicker)
36 NS_IMETHODIMP
Init(nsIDOMWindow
* aParent
, const nsAString
& aTitle
, int16_t aMode
);
37 NS_IMETHODIMP
AppendFilter(const nsAString
& aTitle
, const nsAString
& aFilter
);
38 NS_IMETHODIMP
GetDefaultString(nsAString
& aDefaultString
);
39 NS_IMETHODIMP
SetDefaultString(const nsAString
& aDefaultString
);
40 NS_IMETHODIMP
GetDefaultExtension(nsAString
& aDefaultExtension
);
41 NS_IMETHODIMP
SetDefaultExtension(const nsAString
& aDefaultExtension
);
42 NS_IMETHODIMP
GetFilterIndex(int32_t* aFilterIndex
);
43 NS_IMETHODIMP
SetFilterIndex(int32_t aFilterIndex
);
44 NS_IMETHODIMP
GetFile(nsIFile
** aFile
);
45 NS_IMETHODIMP
GetFileURL(nsIURI
** aFileURL
);
46 NS_IMETHODIMP
GetFiles(nsISimpleEnumerator
** aFiles
);
48 NS_IMETHODIMP
GetDomfile(nsIDOMFile
** aFile
);
49 NS_IMETHODIMP
GetDomfiles(nsISimpleEnumerator
** aFiles
);
51 NS_IMETHODIMP
Show(int16_t* aReturn
);
52 NS_IMETHODIMP
Open(nsIFilePickerShownCallback
* aCallback
);
56 Recv__delete__(const MaybeInputFiles
& aFiles
, const int16_t& aResult
);
60 void InitNative(nsIWidget
*, const nsAString
&);
62 // This is an innerWindow.
63 nsCOMPtr
<nsPIDOMWindow
> mParent
;
64 nsCOMArray
<nsIDOMFile
> mDomfiles
;
65 nsCOMPtr
<nsIFilePickerShownCallback
> mCallback
;
67 int16_t mSelectedType
;
70 nsString mDefaultExtension
;
72 InfallibleTArray
<nsString
> mFilters
;
73 InfallibleTArray
<nsString
> mFilterNames
;
76 #endif // NSFILEPICKERPROXY_H