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
) MOZ_OVERRIDE
;
37 NS_IMETHODIMP
AppendFilter(const nsAString
& aTitle
, const nsAString
& aFilter
) MOZ_OVERRIDE
;
38 NS_IMETHODIMP
GetDefaultString(nsAString
& aDefaultString
) MOZ_OVERRIDE
;
39 NS_IMETHODIMP
SetDefaultString(const nsAString
& aDefaultString
) MOZ_OVERRIDE
;
40 NS_IMETHODIMP
GetDefaultExtension(nsAString
& aDefaultExtension
) MOZ_OVERRIDE
;
41 NS_IMETHODIMP
SetDefaultExtension(const nsAString
& aDefaultExtension
) MOZ_OVERRIDE
;
42 NS_IMETHODIMP
GetFilterIndex(int32_t* aFilterIndex
) MOZ_OVERRIDE
;
43 NS_IMETHODIMP
SetFilterIndex(int32_t aFilterIndex
) MOZ_OVERRIDE
;
44 NS_IMETHODIMP
GetFile(nsIFile
** aFile
) MOZ_OVERRIDE
;
45 NS_IMETHODIMP
GetFileURL(nsIURI
** aFileURL
) MOZ_OVERRIDE
;
46 NS_IMETHODIMP
GetFiles(nsISimpleEnumerator
** aFiles
) MOZ_OVERRIDE
;
48 NS_IMETHODIMP
GetDomfile(nsIDOMFile
** aFile
) MOZ_OVERRIDE
;
49 NS_IMETHODIMP
GetDomfiles(nsISimpleEnumerator
** aFiles
) MOZ_OVERRIDE
;
51 NS_IMETHODIMP
Show(int16_t* aReturn
) MOZ_OVERRIDE
;
52 NS_IMETHODIMP
Open(nsIFilePickerShownCallback
* aCallback
) MOZ_OVERRIDE
;
56 Recv__delete__(const MaybeInputFiles
& aFiles
, const int16_t& aResult
) MOZ_OVERRIDE
;
60 void InitNative(nsIWidget
*, const nsAString
&) MOZ_OVERRIDE
;
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