/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */#ifndef NSFILEPICKERPROXY_H#define NSFILEPICKERPROXY_H#include"nsBaseFilePicker.h"#include"nsString.h"#include"nsIURI.h"#include"nsTArray.h"#include"nsCOMArray.h"#include"mozilla/dom/PFilePickerChild.h"#include"mozilla/dom/UnionTypes.h"classnsIWidget;classnsIFile;classnsPIDOMWindowInner;/** This class creates a proxy file picker to be used in content processes. The file picker just collects the initialization data and when Show() is called, remotes everything to the chrome process which in turn can show a platform specific file picker.*/classnsFilePickerProxy:publicnsBaseFilePicker,publicmozilla::dom::PFilePickerChild{public:nsFilePickerProxy();NS_DECL_ISUPPORTS// nsIFilePicker (less what's in nsBaseFilePicker)NS_IMETHODInit(mozIDOMWindowProxy*aParent,constnsAString&aTitle,int16_taMode)override;NS_IMETHODAppendFilter(constnsAString&aTitle,constnsAString&aFilter)override;NS_IMETHODGetDefaultString(nsAString&aDefaultString)override;NS_IMETHODSetDefaultString(constnsAString&aDefaultString)override;NS_IMETHODGetDefaultExtension(nsAString&aDefaultExtension)override;NS_IMETHODSetDefaultExtension(constnsAString&aDefaultExtension)override;NS_IMETHODGetFilterIndex(int32_t*aFilterIndex)override;NS_IMETHODSetFilterIndex(int32_taFilterIndex)override;NS_IMETHODGetFile(nsIFile**aFile)override;NS_IMETHODGetFileURL(nsIURI**aFileURL)override;NS_IMETHODGetFiles(nsISimpleEnumerator**aFiles)override;NS_IMETHODGetDomFileOrDirectory(nsISupports**aValue)override;NS_IMETHODGetDomFileOrDirectoryEnumerator(nsISimpleEnumerator**aValue)override;NS_IMETHODOpen(nsIFilePickerShownCallback*aCallback)override;// PFilePickerChildvirtualmozilla::ipc::IPCResultRecv__delete__(constMaybeInputData&aData,constint16_t&aResult)override;private:~nsFilePickerProxy();voidInitNative(nsIWidget*,constnsAString&)override;nsresultShow(int16_t*aReturn)override;voidActorDestroy(ActorDestroyReasonaWhy)override;nsTArray<mozilla::dom::OwningFileOrDirectory>mFilesOrDirectories;nsCOMPtr<nsIFilePickerShownCallback>mCallback;int16_tmSelectedType;nsStringmFile;nsStringmDefault;nsStringmDefaultExtension;boolmIPCActive;InfallibleTArray<nsString>mFilters;InfallibleTArray<nsString>mFilterNames;};#endif // NSFILEPICKERPROXY_H