layout/build/nsContentDLF.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/build/nsContentDLF.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,91 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsContentDLF_h__
    1.10 +#define nsContentDLF_h__
    1.11 +
    1.12 +#include "nsIDocumentLoaderFactory.h"
    1.13 +#include "nsMimeTypes.h"
    1.14 +
    1.15 +class nsIChannel;
    1.16 +class nsIContentViewer;
    1.17 +class nsIFile;
    1.18 +class nsIInputStream;
    1.19 +class nsILoadGroup;
    1.20 +class nsIStreamListener;
    1.21 +
    1.22 +#define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
    1.23 +#define PLUGIN_DLF_CONTRACTID "@mozilla.org/content/plugin/document-loader-factory;1"
    1.24 +
    1.25 +class nsContentDLF : public nsIDocumentLoaderFactory
    1.26 +{
    1.27 +public:
    1.28 +  nsContentDLF();
    1.29 +  virtual ~nsContentDLF();
    1.30 +
    1.31 +  NS_DECL_ISUPPORTS
    1.32 +  NS_DECL_NSIDOCUMENTLOADERFACTORY
    1.33 +
    1.34 +  nsresult InitUAStyleSheet();
    1.35 +
    1.36 +  nsresult CreateDocument(const char* aCommand,
    1.37 +                          nsIChannel* aChannel,
    1.38 +                          nsILoadGroup* aLoadGroup,
    1.39 +                          nsIDocShell* aContainer,
    1.40 +                          const nsCID& aDocumentCID,
    1.41 +                          nsIStreamListener** aDocListener,
    1.42 +                          nsIContentViewer** aContentViewer);
    1.43 +
    1.44 +  nsresult CreateXULDocument(const char* aCommand,
    1.45 +                             nsIChannel* aChannel,
    1.46 +                             nsILoadGroup* aLoadGroup,
    1.47 +                             const char* aContentType,
    1.48 +                             nsIDocShell* aContainer,
    1.49 +                             nsISupports* aExtraInfo,
    1.50 +                             nsIStreamListener** aDocListener,
    1.51 +                             nsIContentViewer** aContentViewer);
    1.52 +
    1.53 +private:
    1.54 +  static nsresult EnsureUAStyleSheet();
    1.55 +  static bool IsImageContentType(const char* aContentType);
    1.56 +};
    1.57 +
    1.58 +nsresult
    1.59 +NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
    1.60 +
    1.61 +#ifdef MOZ_WEBM
    1.62 +#define CONTENTDLF_WEBM_CATEGORIES \
    1.63 +    { "Gecko-Content-Viewers", VIDEO_WEBM, "@mozilla.org/content/document-loader-factory;1" }, \
    1.64 +    { "Gecko-Content-Viewers", AUDIO_WEBM, "@mozilla.org/content/document-loader-factory;1" },
    1.65 +#else
    1.66 +#define CONTENTDLF_WEBM_CATEGORIES
    1.67 +#endif
    1.68 +
    1.69 +#define CONTENTDLF_CATEGORIES \
    1.70 +    { "Gecko-Content-Viewers", TEXT_HTML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.71 +    { "Gecko-Content-Viewers", TEXT_PLAIN, "@mozilla.org/content/document-loader-factory;1" }, \
    1.72 +    { "Gecko-Content-Viewers", TEXT_CACHE_MANIFEST, "@mozilla.org/content/document-loader-factory;1" }, \
    1.73 +    { "Gecko-Content-Viewers", TEXT_CSS, "@mozilla.org/content/document-loader-factory;1" }, \
    1.74 +    { "Gecko-Content-Viewers", TEXT_JAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
    1.75 +    { "Gecko-Content-Viewers", TEXT_ECMASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
    1.76 +    { "Gecko-Content-Viewers", APPLICATION_JAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
    1.77 +    { "Gecko-Content-Viewers", APPLICATION_ECMASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
    1.78 +    { "Gecko-Content-Viewers", APPLICATION_XJAVASCRIPT, "@mozilla.org/content/document-loader-factory;1" }, \
    1.79 +    { "Gecko-Content-Viewers", APPLICATION_JSON, "@mozilla.org/content/document-loader-factory;1" }, \
    1.80 +    { "Gecko-Content-Viewers", APPLICATION_XHTML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.81 +    { "Gecko-Content-Viewers", TEXT_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.82 +    { "Gecko-Content-Viewers", APPLICATION_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.83 +    { "Gecko-Content-Viewers", APPLICATION_RDF_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.84 +    { "Gecko-Content-Viewers", TEXT_RDF, "@mozilla.org/content/document-loader-factory;1" }, \
    1.85 +    { "Gecko-Content-Viewers", TEXT_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
    1.86 +    { "Gecko-Content-Viewers", APPLICATION_CACHED_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
    1.87 +    { "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" }, \
    1.88 +    { "Gecko-Content-Viewers", IMAGE_SVG_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.89 +    { "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
    1.90 +    CONTENTDLF_WEBM_CATEGORIES
    1.91 +
    1.92 +
    1.93 +#endif
    1.94 +

mercurial