2001-08-07 02:55:54 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 11:12:37 +00: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/. */
|
2001-08-07 02:55:54 +00:00
|
|
|
|
|
|
|
#ifndef nsContentDLF_h__
|
|
|
|
#define nsContentDLF_h__
|
|
|
|
|
|
|
|
#include "nsIDocumentLoaderFactory.h"
|
2010-06-10 18:11:11 +00:00
|
|
|
#include "nsMimeTypes.h"
|
2001-08-07 02:55:54 +00:00
|
|
|
|
|
|
|
class nsIChannel;
|
|
|
|
class nsIContentViewer;
|
|
|
|
class nsIFile;
|
|
|
|
class nsIInputStream;
|
|
|
|
class nsILoadGroup;
|
|
|
|
class nsIStreamListener;
|
|
|
|
|
2010-06-10 16:42:16 +00:00
|
|
|
#define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
|
|
|
|
#define PLUGIN_DLF_CONTRACTID "@mozilla.org/content/plugin/document-loader-factory;1"
|
|
|
|
|
2004-07-15 16:12:22 +00:00
|
|
|
class nsContentDLF : public nsIDocumentLoaderFactory
|
2001-08-07 02:55:54 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsContentDLF();
|
|
|
|
virtual ~nsContentDLF();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
2001-11-06 01:24:39 +00:00
|
|
|
NS_DECL_NSIDOCUMENTLOADERFACTORY
|
2001-08-07 02:55:54 +00:00
|
|
|
|
|
|
|
nsresult InitUAStyleSheet();
|
|
|
|
|
|
|
|
nsresult CreateDocument(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
2013-11-15 07:12:43 +00:00
|
|
|
nsIDocShell* aContainer,
|
2001-08-07 02:55:54 +00:00
|
|
|
const nsCID& aDocumentCID,
|
|
|
|
nsIStreamListener** aDocListener,
|
2011-10-15 07:33:26 +00:00
|
|
|
nsIContentViewer** aContentViewer);
|
2001-08-07 02:55:54 +00:00
|
|
|
|
2007-03-07 04:23:27 +00:00
|
|
|
nsresult CreateXULDocument(const char* aCommand,
|
2001-08-07 02:55:54 +00:00
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
|
|
|
const char* aContentType,
|
2013-11-15 07:12:43 +00:00
|
|
|
nsIDocShell* aContainer,
|
2001-08-07 02:55:54 +00:00
|
|
|
nsISupports* aExtraInfo,
|
|
|
|
nsIStreamListener** aDocListener,
|
2011-10-15 07:33:26 +00:00
|
|
|
nsIContentViewer** aContentViewer);
|
2001-08-07 02:55:54 +00:00
|
|
|
|
2002-01-22 05:30:28 +00:00
|
|
|
private:
|
|
|
|
static nsresult EnsureUAStyleSheet();
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool IsImageContentType(const char* aContentType);
|
2001-08-07 02:55:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
|
|
|
|
|
2010-06-10 18:11:11 +00:00
|
|
|
#ifdef MOZ_WEBM
|
|
|
|
#define CONTENTDLF_WEBM_CATEGORIES \
|
|
|
|
{ "Gecko-Content-Viewers", VIDEO_WEBM, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", AUDIO_WEBM, "@mozilla.org/content/document-loader-factory;1" },
|
|
|
|
#else
|
|
|
|
#define CONTENTDLF_WEBM_CATEGORIES
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONTENTDLF_CATEGORIES \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_HTML, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_PLAIN, "@mozilla.org/content/document-loader-factory;1" }, \
|
2012-07-14 06:13:20 +00:00
|
|
|
{ "Gecko-Content-Viewers", TEXT_CACHE_MANIFEST, "@mozilla.org/content/document-loader-factory;1" }, \
|
2010-06-10 18:11:11 +00:00
|
|
|
{ "Gecko-Content-Viewers", TEXT_CSS, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_JAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_ECMASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_JAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_ECMASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_XJAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
|
2011-08-08 18:32:07 +00:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_JSON, "@mozilla.org/content/document-loader-factory;1" }, \
|
2010-06-10 18:11:11 +00:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_XHTML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_RDF_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_RDF, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", TEXT_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
|
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_CACHED_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
|
2010-08-25 03:27:34 +00:00
|
|
|
{ "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" }, \
|
2011-05-30 07:34:50 +00:00
|
|
|
{ "Gecko-Content-Viewers", IMAGE_SVG_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
2011-06-02 11:11:33 +00:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
2013-11-07 04:08:30 +00:00
|
|
|
CONTENTDLF_WEBM_CATEGORIES
|
2013-01-29 02:34:28 +00:00
|
|
|
|
2010-06-10 18:11:11 +00:00
|
|
|
|
2001-08-07 02:55:54 +00:00
|
|
|
#endif
|
|
|
|
|