Bug 1746870: part 1) Minorly extend documentation in <jsactors.rst>. r=hsivonen
[gecko.git] / widget / nsBaseFilePicker.h
blob27e37b0f30d412ec6489529e08c20a71c7b6c702
1 /* -*- Mode: C++; tab-width: 2; 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/. */
7 #ifndef nsBaseFilePicker_h__
8 #define nsBaseFilePicker_h__
10 #include "nsISupports.h"
11 #include "nsIFilePicker.h"
12 #include "nsISimpleEnumerator.h"
13 #include "nsArrayEnumerator.h"
14 #include "nsCOMPtr.h"
15 #include "nsString.h"
16 #include "nsTArray.h"
18 class nsPIDOMWindowOuter;
19 class nsIWidget;
21 class nsBaseFilePicker : public nsIFilePicker {
22 class AsyncShowFilePicker;
24 public:
25 nsBaseFilePicker();
26 virtual ~nsBaseFilePicker();
28 NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
29 int16_t aMode) override;
31 NS_IMETHOD Open(nsIFilePickerShownCallback* aCallback) override;
32 NS_IMETHOD AppendFilters(int32_t filterMask) override;
33 NS_IMETHOD AppendRawFilter(const nsAString& aFilter) override;
34 NS_IMETHOD GetCapture(int16_t* aCapture) override;
35 NS_IMETHOD SetCapture(int16_t aCapture) override;
36 NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override;
37 NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
38 NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override;
39 NS_IMETHOD GetDisplayDirectory(nsIFile** aDisplayDirectory) override;
40 NS_IMETHOD SetDisplayDirectory(nsIFile* aDisplayDirectory) override;
41 NS_IMETHOD GetDisplaySpecialDirectory(nsAString& aDisplayDirectory) override;
42 NS_IMETHOD SetDisplaySpecialDirectory(
43 const nsAString& aDisplayDirectory) override;
44 NS_IMETHOD GetAddToRecentDocs(bool* aFlag) override;
45 NS_IMETHOD SetAddToRecentDocs(bool aFlag) override;
46 NS_IMETHOD GetMode(int16_t* aMode) override;
47 NS_IMETHOD SetOkButtonLabel(const nsAString& aLabel) override;
48 NS_IMETHOD GetOkButtonLabel(nsAString& aLabel) override;
50 NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue) override;
51 NS_IMETHOD GetDomFileOrDirectoryEnumerator(
52 nsISimpleEnumerator** aValue) override;
54 protected:
55 virtual void InitNative(nsIWidget* aParent, const nsAString& aTitle) = 0;
56 virtual nsresult Show(int16_t* _retval) = 0;
58 bool mAddToRecentDocs;
59 nsCOMPtr<nsIFile> mDisplayDirectory;
60 nsString mDisplaySpecialDirectory;
62 nsCOMPtr<nsPIDOMWindowOuter> mParent;
63 int16_t mMode;
64 nsString mOkButtonLabel;
65 nsTArray<nsString> mRawFilters;
68 #endif // nsBaseFilePicker_h__