|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
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/. */ |
|
6 |
|
7 #ifndef nsBaseFilePicker_h__ |
|
8 #define nsBaseFilePicker_h__ |
|
9 |
|
10 #include "nsISupports.h" |
|
11 #include "nsIFilePicker.h" |
|
12 #include "nsISimpleEnumerator.h" |
|
13 #include "nsArrayEnumerator.h" |
|
14 #include "nsCOMPtr.h" |
|
15 |
|
16 class nsIWidget; |
|
17 |
|
18 class nsBaseFilePicker : public nsIFilePicker |
|
19 { |
|
20 public: |
|
21 nsBaseFilePicker(); |
|
22 virtual ~nsBaseFilePicker(); |
|
23 |
|
24 NS_IMETHOD Init(nsIDOMWindow *aParent, |
|
25 const nsAString& aTitle, |
|
26 int16_t aMode); |
|
27 |
|
28 NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback); |
|
29 NS_IMETHOD AppendFilters(int32_t filterMask); |
|
30 NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex); |
|
31 NS_IMETHOD SetFilterIndex(int32_t aFilterIndex); |
|
32 NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles); |
|
33 NS_IMETHOD GetDisplayDirectory(nsIFile * *aDisplayDirectory); |
|
34 NS_IMETHOD SetDisplayDirectory(nsIFile * aDisplayDirectory); |
|
35 NS_IMETHOD GetAddToRecentDocs(bool *aFlag); |
|
36 NS_IMETHOD SetAddToRecentDocs(bool aFlag); |
|
37 NS_IMETHOD GetMode(int16_t *aMode); |
|
38 |
|
39 NS_IMETHOD GetDomfile(nsIDOMFile** aDomfile); |
|
40 NS_IMETHOD GetDomfiles(nsISimpleEnumerator** aDomfiles); |
|
41 |
|
42 protected: |
|
43 |
|
44 virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle) = 0; |
|
45 |
|
46 bool mAddToRecentDocs; |
|
47 nsCOMPtr<nsIFile> mDisplayDirectory; |
|
48 int16_t mMode; |
|
49 }; |
|
50 |
|
51 #endif // nsBaseFilePicker_h__ |