widget/nsBaseFilePicker.h
author Mike Hommey <mh+mozilla@glandium.org>
Fri, 01 Apr 2016 22:28:26 +0900
changeset 329440 ae2f8bdfec618098a37f4cab42a58f548e44f76e
parent 318762 e22b3043887ed36bf2c634c2924a7c8d39d226b1
child 347889 e58e63e362ff2a402bc7f22f0193097d07c418f1
permissions -rw-r--r--
Bug 1261531 - Remove most obvious cases of useless AC_DEFINEs. r=chmanchester - HW_THREADS doesn't appear to be doing anything. - USE_ARM_KUSER is not used since bug 675078. This also removes the configure flag that sets it. - HAVE_SETBUF and HAVE_SNPRINTF are leftover from bug 944935. - MOZ_MEMORY_GONK is leftover from bug 804303.

/* -*- 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"

class nsPIDOMWindowOuter;
class nsIWidget;

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

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

  NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback);
  NS_IMETHOD AppendFilters(int32_t filterMask);
  NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex);
  NS_IMETHOD SetFilterIndex(int32_t aFilterIndex);
  NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles);
  NS_IMETHOD GetDisplayDirectory(nsIFile * *aDisplayDirectory);
  NS_IMETHOD SetDisplayDirectory(nsIFile * aDisplayDirectory);
  NS_IMETHOD GetAddToRecentDocs(bool *aFlag);
  NS_IMETHOD SetAddToRecentDocs(bool aFlag);
  NS_IMETHOD GetMode(int16_t *aMode);

  NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue);
  NS_IMETHOD GetDomFileOrDirectoryEnumerator(nsISimpleEnumerator** aValue);

protected:

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

  bool mAddToRecentDocs;
  nsCOMPtr<nsIFile> mDisplayDirectory;

  nsCOMPtr<nsPIDOMWindowOuter> mParent;
  int16_t mMode;
};

#endif // nsBaseFilePicker_h__