Bug 1073336 part 5 - Add AnimationPlayerCollection::PlayerUpdated; r=dbaron
[gecko.git] / widget / nsFilePickerProxy.h
blob85f82b8bbd24d33c318fe53572b654c617f68879
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"
10 #include "nsString.h"
11 #include "nsIURI.h"
12 #include "nsTArray.h"
13 #include "nsCOMArray.h"
15 #include "mozilla/dom/PFilePickerChild.h"
17 class nsIWidget;
18 class nsIFile;
19 class nsPIDOMWindow;
21 /**
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
30 public:
31 nsFilePickerProxy();
33 NS_DECL_ISUPPORTS
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);
54 // PFilePickerChild
55 virtual bool
56 Recv__delete__(const MaybeInputFiles& aFiles, const int16_t& aResult);
58 private:
59 ~nsFilePickerProxy();
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;
68 nsString mFile;
69 nsString mDefault;
70 nsString mDefaultExtension;
72 InfallibleTArray<nsString> mFilters;
73 InfallibleTArray<nsString> mFilterNames;
76 #endif // NSFILEPICKERPROXY_H