1999-11-16 04:51:39 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
1999-11-16 04:51:39 +03:00
|
|
|
|
|
|
|
#ifndef nsBaseFilePicker_h__
|
|
|
|
#define nsBaseFilePicker_h__
|
|
|
|
|
2009-04-02 01:59:02 +04:00
|
|
|
#include "nsISupports.h"
|
1999-11-16 04:51:39 +03:00
|
|
|
#include "nsIFilePicker.h"
|
2002-09-07 09:23:45 +04:00
|
|
|
#include "nsISimpleEnumerator.h"
|
2009-03-30 22:08:06 +04:00
|
|
|
#include "nsArrayEnumerator.h"
|
2009-04-02 01:59:02 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2016-08-24 02:07:21 +03:00
|
|
|
#include "nsString.h"
|
2009-04-02 01:59:02 +04:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
class nsPIDOMWindowOuter;
|
2009-04-02 01:59:02 +04:00
|
|
|
class nsIWidget;
|
1999-11-16 04:51:39 +03:00
|
|
|
|
|
|
|
class nsBaseFilePicker : public nsIFilePicker {
|
2017-08-06 07:15:31 +03:00
|
|
|
class AsyncShowFilePicker;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
1999-11-16 04:51:39 +03:00
|
|
|
public:
|
|
|
|
nsBaseFilePicker();
|
|
|
|
virtual ~nsBaseFilePicker();
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
|
2017-11-06 06:37:28 +03:00
|
|
|
int16_t aMode) override;
|
|
|
|
|
|
|
|
NS_IMETHOD Open(nsIFilePickerShownCallback* aCallback) override;
|
|
|
|
NS_IMETHOD AppendFilters(int32_t filterMask) override;
|
2019-01-24 19:21:05 +03:00
|
|
|
NS_IMETHOD AppendRawFilter(const nsAString& aFilter) override;
|
2017-11-06 06:37:28 +03:00
|
|
|
NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override;
|
|
|
|
NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
|
|
|
|
NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override;
|
|
|
|
NS_IMETHOD GetDisplayDirectory(nsIFile** aDisplayDirectory) override;
|
|
|
|
NS_IMETHOD SetDisplayDirectory(nsIFile* aDisplayDirectory) override;
|
|
|
|
NS_IMETHOD GetDisplaySpecialDirectory(nsAString& aDisplayDirectory) override;
|
|
|
|
NS_IMETHOD SetDisplaySpecialDirectory(
|
|
|
|
const nsAString& aDisplayDirectory) override;
|
|
|
|
NS_IMETHOD GetAddToRecentDocs(bool* aFlag) override;
|
|
|
|
NS_IMETHOD SetAddToRecentDocs(bool aFlag) override;
|
|
|
|
NS_IMETHOD GetMode(int16_t* aMode) override;
|
|
|
|
NS_IMETHOD SetOkButtonLabel(const nsAString& aLabel) override;
|
|
|
|
NS_IMETHOD GetOkButtonLabel(nsAString& aLabel) override;
|
|
|
|
|
|
|
|
NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue) override;
|
|
|
|
NS_IMETHOD GetDomFileOrDirectoryEnumerator(
|
|
|
|
nsISimpleEnumerator** aValue) override;
|
2000-08-25 06:17:53 +04:00
|
|
|
|
1999-11-16 04:51:39 +03:00
|
|
|
protected:
|
2013-07-22 13:12:32 +04:00
|
|
|
virtual void InitNative(nsIWidget* aParent, const nsAString& aTitle) = 0;
|
2017-08-06 07:15:31 +03:00
|
|
|
virtual nsresult Show(int16_t* _retval) = 0;
|
1999-11-16 04:51:39 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mAddToRecentDocs;
|
2012-06-06 06:08:30 +04:00
|
|
|
nsCOMPtr<nsIFile> mDisplayDirectory;
|
2017-04-26 19:20:19 +03:00
|
|
|
nsString mDisplaySpecialDirectory;
|
2014-10-10 20:00:34 +04:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindowOuter> mParent;
|
2013-07-22 13:12:32 +04:00
|
|
|
int16_t mMode;
|
2016-08-24 02:07:21 +03:00
|
|
|
nsString mOkButtonLabel;
|
2019-01-24 19:21:05 +03:00
|
|
|
InfallibleTArray<nsString> mRawFilters;
|
1999-11-16 04:51:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsBaseFilePicker_h__
|