2010-06-14 12:04:16 -07:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
|
2012-05-21 04:12:37 -07: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/. */
|
2010-06-14 12:04:16 -07:00
|
|
|
|
|
|
|
#ifndef nsMIMEInfoAndroid_h
|
|
|
|
#define nsMIMEInfoAndroid_h
|
|
|
|
|
|
|
|
#include "nsMIMEInfoImpl.h"
|
|
|
|
#include "nsIMutableArray.h"
|
|
|
|
#include "nsAndroidHandlerApp.h"
|
2013-05-30 11:26:02 -07:00
|
|
|
|
|
|
|
class nsMIMEInfoAndroid MOZ_FINAL : public nsIMIMEInfo
|
2010-06-14 12:04:16 -07:00
|
|
|
{
|
|
|
|
public:
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool
|
2010-08-19 18:33:06 -07:00
|
|
|
GetMimeInfoForMimeType(const nsACString& aMimeType,
|
|
|
|
nsMIMEInfoAndroid** aMimeInfo);
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool
|
2010-08-19 18:33:06 -07:00
|
|
|
GetMimeInfoForFileExt(const nsACString& aFileExt,
|
|
|
|
nsMIMEInfoAndroid** aMimeInfo);
|
2010-11-23 15:40:46 -08:00
|
|
|
|
2010-08-19 18:33:06 -07:00
|
|
|
static nsresult
|
2011-09-28 23:19:26 -07:00
|
|
|
GetMimeInfoForURL(const nsACString &aURL, bool *found,
|
2010-11-23 15:40:46 -08:00
|
|
|
nsIHandlerInfo **info);
|
2010-06-14 12:04:16 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMIMEINFO
|
|
|
|
NS_DECL_NSIHANDLERINFO
|
2010-08-19 18:33:06 -07:00
|
|
|
|
2010-06-14 12:04:16 -07:00
|
|
|
nsMIMEInfoAndroid(const nsACString& aMIMEType);
|
|
|
|
|
|
|
|
protected:
|
2014-06-02 05:08:21 -07:00
|
|
|
virtual nsresult LaunchDefaultWithFile(nsIFile* aFile);
|
|
|
|
virtual nsresult LoadUriInternal(nsIURI *aURI);
|
2010-06-14 12:04:16 -07:00
|
|
|
nsCOMPtr<nsIMutableArray> mHandlerApps;
|
2011-02-09 11:40:24 -08:00
|
|
|
nsCString mType;
|
2010-06-14 12:04:16 -07:00
|
|
|
nsTArray<nsCString> mExtensions;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mAlwaysAsk;
|
2010-06-14 12:04:16 -07:00
|
|
|
nsHandlerInfoAction mPrefAction;
|
|
|
|
nsString mDescription;
|
|
|
|
nsCOMPtr<nsIHandlerApp> mPrefApp;
|
|
|
|
|
2013-05-30 11:26:02 -07:00
|
|
|
class SystemChooser MOZ_FINAL : public nsIHandlerApp {
|
2010-06-14 12:04:16 -07:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIHANDLERAPP
|
|
|
|
SystemChooser(nsMIMEInfoAndroid* aOuter): mOuter(aOuter) {};
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsMIMEInfoAndroid* mOuter;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMIMEInfoAndroid_h */
|