2001-08-07 06:55:54 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
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/. */
|
2001-08-07 06:55:54 +04:00
|
|
|
|
|
|
|
#ifndef nsContentDLF_h__
|
|
|
|
#define nsContentDLF_h__
|
|
|
|
|
|
|
|
#include "nsIDocumentLoaderFactory.h"
|
2010-06-10 22:11:11 +04:00
|
|
|
#include "nsMimeTypes.h"
|
2001-08-07 06:55:54 +04:00
|
|
|
|
2017-07-26 13:02:58 +03:00
|
|
|
class nsDocShell;
|
2001-08-07 06:55:54 +04:00
|
|
|
class nsIChannel;
|
|
|
|
class nsIContentViewer;
|
|
|
|
class nsILoadGroup;
|
|
|
|
class nsIStreamListener;
|
|
|
|
|
2010-06-10 20:42:16 +04: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 20:12:22 +04:00
|
|
|
class nsContentDLF : public nsIDocumentLoaderFactory
|
2001-08-07 06:55:54 +04:00
|
|
|
{
|
2014-06-24 02:40:01 +04:00
|
|
|
protected:
|
|
|
|
virtual ~nsContentDLF();
|
|
|
|
|
2001-08-07 06:55:54 +04:00
|
|
|
public:
|
|
|
|
nsContentDLF();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
2001-11-06 04:24:39 +03:00
|
|
|
NS_DECL_NSIDOCUMENTLOADERFACTORY
|
2001-08-07 06:55:54 +04:00
|
|
|
|
|
|
|
nsresult InitUAStyleSheet();
|
|
|
|
|
|
|
|
nsresult CreateDocument(const char* aCommand,
|
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
2013-11-15 11:12:43 +04:00
|
|
|
nsIDocShell* aContainer,
|
2001-08-07 06:55:54 +04:00
|
|
|
const nsCID& aDocumentCID,
|
|
|
|
nsIStreamListener** aDocListener,
|
2017-07-25 15:34:14 +03:00
|
|
|
nsIContentViewer** aContentViewer);
|
2001-08-07 06:55:54 +04:00
|
|
|
|
2007-03-07 07:23:27 +03:00
|
|
|
nsresult CreateXULDocument(const char* aCommand,
|
2001-08-07 06:55:54 +04:00
|
|
|
nsIChannel* aChannel,
|
|
|
|
nsILoadGroup* aLoadGroup,
|
2013-11-15 11:12:43 +04:00
|
|
|
nsIDocShell* aContainer,
|
2001-08-07 06:55:54 +04:00
|
|
|
nsISupports* aExtraInfo,
|
|
|
|
nsIStreamListener** aDocListener,
|
2011-10-15 11:33:26 +04:00
|
|
|
nsIContentViewer** aContentViewer);
|
2001-08-07 06:55:54 +04:00
|
|
|
|
2017-07-26 12:32:45 +03:00
|
|
|
/**
|
|
|
|
* Create a blank document using the given loadgroup and given
|
|
|
|
* principal. aPrincipal is allowed to be null, in which case the
|
|
|
|
* new document will get the about:blank codebase principal.
|
|
|
|
*/
|
2017-07-26 12:47:18 +03:00
|
|
|
static already_AddRefed<nsIDocument>
|
2017-07-26 13:02:58 +03:00
|
|
|
CreateBlankDocument(nsILoadGroup* aLoadGroup,
|
|
|
|
nsIPrincipal* aPrincipal,
|
|
|
|
nsDocShell* aContainer);
|
2017-07-26 12:32:45 +03:00
|
|
|
|
2002-01-22 08:30:28 +03:00
|
|
|
private:
|
|
|
|
static nsresult EnsureUAStyleSheet();
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool IsImageContentType(const char* aContentType);
|
2001-08-07 06:55:54 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
|
|
|
|
|
2010-06-10 22:11:11 +04: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 10:13:20 +04:00
|
|
|
{ "Gecko-Content-Viewers", TEXT_CACHE_MANIFEST, "@mozilla.org/content/document-loader-factory;1" }, \
|
2010-06-10 22:11:11 +04: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 22:32:07 +04:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_JSON, "@mozilla.org/content/document-loader-factory;1" }, \
|
2015-10-05 19:23:26 +03:00
|
|
|
{ "Gecko-Content-Viewers", TEXT_JSON, "@mozilla.org/content/document-loader-factory;1" }, \
|
2010-06-10 22:11:11 +04: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 07:27:34 +04:00
|
|
|
{ "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" }, \
|
2011-05-30 11:34:50 +04:00
|
|
|
{ "Gecko-Content-Viewers", IMAGE_SVG_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
2011-06-02 15:11:33 +04:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
2015-10-05 19:23:26 +03:00
|
|
|
{ "Gecko-Content-Viewers", TEXT_VTT, "@mozilla.org/content/document-loader-factory;1" }, \
|
2016-09-28 17:48:17 +03:00
|
|
|
{ "Gecko-Content-Viewers", APPLICATION_WAPXHTML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
|
2013-11-07 08:08:30 +04:00
|
|
|
CONTENTDLF_WEBM_CATEGORIES
|
2013-01-29 06:34:28 +04:00
|
|
|
|
2010-06-10 22:11:11 +04:00
|
|
|
|
2001-08-07 06:55:54 +04:00
|
|
|
#endif
|
2017-07-25 15:34:14 +03:00
|
|
|
|