author Johann Hofmann <jhofmann@mozilla.com>
Fri, 19 Oct 2018 14:21:41 +0000
changeset 500657 776414145c58b27c8135d102d71263164f1d329f
parent 453515 3d28ca7c05d8f9ba3ba6ff1cd5449dce42ae95c1
child 508163 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1500103 - Only test return_button_adv and exception_button for new cert error pages. r=nhnt11 exception_button can technically be clicked on the old error pages, too, but conditionally checking for the cert exception window to pop up is a bit overkill for this temporary workaround. Ideally we would remove this pref soon anyway. Differential Revision: https://phabricator.services.mozilla.com/D9243

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * 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 nsBaseFilePicker_h__
#define nsBaseFilePicker_h__

#include "nsISupports.h"
#include "nsIFilePicker.h"
#include "nsISimpleEnumerator.h"
#include "nsArrayEnumerator.h"
#include "nsCOMPtr.h"
#include "nsString.h"

class nsPIDOMWindowOuter;
class nsIWidget;

class nsBaseFilePicker : public nsIFilePicker
  class AsyncShowFilePicker;
  virtual ~nsBaseFilePicker();

  NS_IMETHOD Init(mozIDOMWindowProxy* aParent,
                  const nsAString& aTitle,
                  int16_t aMode) override;

  NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override;
  NS_IMETHOD AppendFilters(int32_t filterMask) override;
  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;


  virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle) = 0;
  virtual nsresult Show(int16_t *_retval) = 0;

  bool mAddToRecentDocs;
  nsCOMPtr<nsIFile> mDisplayDirectory;
  nsString mDisplaySpecialDirectory;

  nsCOMPtr<nsPIDOMWindowOuter> mParent;
  int16_t mMode;
  nsString mOkButtonLabel;

#endif // nsBaseFilePicker_h__