Permalink
Browse files

Moving nsIContentViewer over from webshell to docshell, converting fr…

…om .h to .idl. Needed for bug 46200, r=moa=adam@netscape.com, a=alecf
  • Loading branch information...
1 parent b83c5f5 commit 87187c390cfbd9807c26e7cc63aff5437b168970 disttsc%bart.nl committed Nov 9, 2000
View
1 content/xul/document/src/nsXULDocument.cpp
@@ -54,6 +54,7 @@
#include "nsIComponentManager.h"
#include "nsICodebasePrincipal.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
+#include "nsIScrollableView.h"
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
View
1 docshell/base/MANIFEST_IDL
@@ -30,5 +30,6 @@ nsIDocShellTreeOwner.idl
nsIMarkupDocumentViewer.idl
nsIScrollable.idl
nsITextScroll.idl
+nsIContentViewer.idl
nsIContentViewerEdit.idl
nsIURIFixup.idl
View
1 docshell/base/Makefile.in
@@ -41,6 +41,7 @@ XPIDLSRCS = \
nsIScrollable.idl \
nsITextScroll.idl \
nsIWebNavigation.idl \
+ nsIContentViewer.idl \
nsIContentViewerEdit.idl \
nsIURIFixup.idl \
$(NULL)
View
1 docshell/base/makefile.win
@@ -33,6 +33,7 @@ XPIDLSRCS= \
.\nsIDocShellTreeItem.idl \
.\nsIDocShellTreeNode.idl \
.\nsIDocShellTreeOwner.idl \
+ .\nsIContentViewer.idl \
.\nsIContentViewerEdit.idl \
# .\nsIContentViewerFile.idl \
.\nsIMarkupDocumentViewer.idl \
View
6 docshell/base/nsDocShell.cpp
@@ -46,6 +46,7 @@
#include "nsIHTTPEventSink.h"
#include "nsISecurityEventSink.h"
#include "nsScriptSecurityManager.h"
+#include "nsDocumentCharsetInfoCID.h"
// Local Includes
#include "nsDocShell.h"
@@ -124,10 +125,10 @@ nsDocShell::nsDocShell() :
mLastViewMode(viewNormal),
mRestoreViewMode(PR_FALSE),
mEODForCurrentDocument (PR_FALSE),
+ mURIResultedInDocument(PR_FALSE),
mUseExternalProtocolHandler (PR_FALSE),
mParent(nsnull),
mTreeOwner(nsnull),
- mURIResultedInDocument(PR_FALSE),
mChromeEventHandler(nsnull)
{
NS_INIT_REFCNT();
@@ -1110,7 +1111,8 @@ NS_IMETHODIMP nsDocShell::AddChild(nsIDocShellTreeItem *aChild)
if (NS_FAILED(res)) return NS_OK;
// set the child's parentCharset
- res = dcInfo->SetParentCharset(&parentCS);
+ nsCOMPtr<nsIAtom> parentCSAtom(dont_AddRef(NS_NewAtom(parentCS)));
+ res = dcInfo->SetParentCharset(parentCSAtom);
if (NS_FAILED(res)) return NS_OK;
// printf("### 1 >>> Adding child. Parent CS = %s. ItemType = %d.\n", parentCS.ToNewCString(), mItemType);
View
42 docshell/base/nsIContentViewer.idl
@@ -0,0 +1,42 @@
+#include "nsISupports.idl"
+#include "domstubs.idl"
+
+%{ C++
+#include "nsIWidget.h"
+
+class nsIDeviceContext;
+struct nsRect;
+%}
+
+[ptr] native nsIWidgetPtr(nsIWidget);
+[ptr] native nsIDeviceContextPtr(nsIDeviceContext);
+[ref] native nsRectRef(nsRect);
+
+[scriptable, uuid(a6cf9056-15b3-11d2-932e-00805f8add32)]
+interface nsIContentViewer : nsISupports
+{
+
+ [noscript] void init(in nsIWidgetPtr aParentWidget,
+ in nsIDeviceContextPtr aDeviceContext,
+ [const] in nsRectRef aBounds);
+
+ void bindToDocument(in nsISupports aDoc, in string aCommand);
+
+ attribute nsISupports container;
+
+ void loadComplete(in unsigned long aStatus);
+ void destroy();
+ void stop();
+
+ attribute nsIDOMDocument DOMDocument;
+
+ [noscript] void getBounds(in nsRectRef aBounds);
+ [noscript] void setBounds([const] in nsRectRef aBounds);
+
+ void move(in long aX, in long aY);
+
+ void show();
+ void hide();
+
+ attribute boolean enableRendering;
+};
View
5 docshell/base/nsIDocShell.idl
@@ -25,10 +25,10 @@
#include "domstubs.idl"
#include "nsIURIContentListener.idl"
#include "nsIURI.idl"
+#include "nsIContentViewer.idl"
%{ C++
#include "nsIPresContext.h"
-#include "nsIContentViewer.h"
#include "nsIDocumentLoaderObserver.h"
%}
@@ -38,7 +38,6 @@
[ptr] native nsIPresContext(nsIPresContext);
[ptr] native nsIPresShell(nsIPresShell);
-[ptr] native nsIContentViewer(nsIContentViewer);
interface nsIChromeEventHandler;
interface nsIDocumentLoaderObserver;
@@ -118,7 +117,7 @@ interface nsIDocShell : nsISupports
Content Viewer that is currently loaded for this DocShell. This may change
as the underlying content changes.
*/
- [noscript] readonly attribute nsIContentViewer contentViewer;
+ readonly attribute nsIContentViewer contentViewer;
/*
This attribute allows chrome to tie in to handle DOM events that may be of
View
5 modules/plugin/base/src/nsPluginViewer.cpp
@@ -49,14 +49,11 @@ static NS_DEFINE_IID(kChildWindowCID, NS_CHILD_CID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
// Interface IDs
-static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENT_VIEWER_IID);
+static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENTVIEWER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
-static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
static NS_DEFINE_IID(kIPluginInstanceOwnerIID, NS_IPLUGININSTANCEOWNER_IID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
-static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
-static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
View
5 modules/plugin/nglsrc/nsPluginViewer.cpp
@@ -49,14 +49,11 @@ static NS_DEFINE_IID(kChildWindowCID, NS_CHILD_CID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
// Interface IDs
-static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENT_VIEWER_IID);
+static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENTVIEWER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
-static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
static NS_DEFINE_IID(kIPluginInstanceOwnerIID, NS_IPLUGININSTANCEOWNER_IID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
-static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
-static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
View
1 rdf/content/src/nsXULDocument.cpp
@@ -54,6 +54,7 @@
#include "nsIComponentManager.h"
#include "nsICodebasePrincipal.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
+#include "nsIScrollableView.h"
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
View
1 webshell/public/MANIFEST
@@ -2,7 +2,6 @@
# This is a list of local files which get copied to the mozilla:dist:webshell directory
#
-nsIContentViewer.h
nsIDocStreamLoaderFactory.h
nsILinkHandler.h
nsIWebShell.h
View
1 webshell/public/Makefile.in
@@ -37,7 +37,6 @@ XPIDLSRCS = \
$(NULL)
EXPORTS = \
- nsIContentViewer.h \
nsIDocStreamLoaderFactory.h \
nsILinkHandler.h \
nsIWebShell.h \
View
1 webshell/public/makefile.win
@@ -34,7 +34,6 @@ XPIDLSRCS = \
$(NULL)
EXPORTS = \
- nsIContentViewer.h \
nsIDocStreamLoaderFactory.h \
nsILinkHandler.h \
nsIWebShell.h \
View
86 webshell/public/nsIContentViewer.h
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- */
-#ifndef nsIContentViewer_h___
-#define nsIContentViewer_h___
-
-#include "nsIWidget.h"
-#include "nsIScrollableView.h"
-
-// Forward declarations...
-class nsIDeviceContext;
-class nsString;
-struct nsRect;
-class nsIContentViewerContainer;
-class nsIDOMDocument;
-
-// IID for the nsIContentViewer interface
-#define NS_ICONTENT_VIEWER_IID \
- { 0xa6cf9056, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
-
-/**
- * Content viewer interface. When a stream of data is to be presented
- * visually to the user, a content viewer is found for the underlying
- * mime-type associated with the data in the stream. This interface
- * defines the capabilities of the viewer.
- */
-class nsIContentViewer : public nsISupports
-{
-public:
- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENT_VIEWER_IID)
-
- /**
- * Initialize the content viewer. Make it a child of the
- * the given native parent widget.
- */
- NS_IMETHOD Init(nsIWidget* aParentWidget,
- nsIDeviceContext* aDeviceContext,
- const nsRect& aBounds)=0;
-
- NS_IMETHOD BindToDocument(nsISupports* aDoc, const char* aCommand) = 0;
-
- NS_IMETHOD SetContainer(nsISupports* aContainer) = 0;
-
- NS_IMETHOD GetContainer(nsISupports** aContainerResult) = 0;
-
- NS_IMETHOD LoadComplete(nsresult aStatus) = 0;
- NS_IMETHOD Destroy(void) = 0;
- NS_IMETHOD Stop(void) = 0;
-
- NS_IMETHOD GetDOMDocument(nsIDOMDocument **aResult) = 0;
- NS_IMETHOD SetDOMDocument(nsIDOMDocument *aDocument) = 0;
-
- NS_IMETHOD GetBounds(nsRect& aBounds) = 0;
-
- NS_IMETHOD SetBounds(const nsRect& aBounds) = 0;
-
- NS_IMETHOD Move(PRInt32 aX, PRInt32 aY) = 0;
-
- NS_IMETHOD Show(void) = 0;
-
- NS_IMETHOD Hide(void) = 0;
-
- NS_IMETHOD SetEnableRendering(PRBool aOn) = 0;
-
- NS_IMETHOD GetEnableRendering(PRBool* aResult) = 0;
-};
-
-#endif /* nsIContentViewer_h___ */
View
16 xpfe/global/resources/content/xulBindings.xml
@@ -679,9 +679,21 @@
<binding id="browser">
<implementation>
- <property name="webBrowser"
+ <property name="docShell"
+ readonly="true"
+ onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;"/>
+ <property name="webNavigation"
+ readonly="true"
+ onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"/>
+ <property name="markupDocumentViewer"
+ readonly="true"
+ onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);"/>
+ <property name="contentViewerEdit"
+ readonly="true"
+ onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerEdit);"/>
+ <property name="contentViewerFile"
readonly="true"
- onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).webBrowser"/>
+ onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerFile);"/>
</implementation>
</binding>

0 comments on commit 87187c3

Please sign in to comment.