From 65489005946089cce537287387ee8e9368b516f6 Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Thu, 23 Mar 2000 22:29:36 +0000 Subject: [PATCH] Removed git-svn-id: svn://10.0.0.236/trunk@63896 18797224-902f-48f8-a5cc-f745e15eee43 --- .../embed/ActiveX/ActiveScriptSite.cpp | 384 --- .../webshell/embed/ActiveX/ActiveScriptSite.h | 85 - .../webshell/embed/ActiveX/ActiveXPlugin.cpp | 189 -- .../webshell/embed/ActiveX/ActiveXPlugin.h | 48 - .../embed/ActiveX/ActiveXPluginInstance.cpp | 125 - .../embed/ActiveX/ActiveXPluginInstance.h | 53 - mozilla/webshell/embed/ActiveX/ActiveXTypes.h | 40 - .../embed/ActiveX/BrowserDiagnostics.h | 56 - .../webshell/embed/ActiveX/CPMozillaControl.h | 934 ------ .../webshell/embed/ActiveX/ControlSite.cpp | 1028 ------ mozilla/webshell/embed/ActiveX/ControlSite.h | 301 -- .../embed/ActiveX/ControlSiteIPFrame.cpp | 119 - .../embed/ActiveX/ControlSiteIPFrame.h | 61 - mozilla/webshell/embed/ActiveX/DHTMLCmdIds.h | 97 - mozilla/webshell/embed/ActiveX/DropTarget.cpp | 277 -- mozilla/webshell/embed/ActiveX/DropTarget.h | 60 - .../webshell/embed/ActiveX/IEHtmlDocument.cpp | 810 ----- .../webshell/embed/ActiveX/IEHtmlDocument.h | 172 - .../webshell/embed/ActiveX/IEHtmlElement.cpp | 688 ---- .../webshell/embed/ActiveX/IEHtmlElement.h | 142 - .../embed/ActiveX/IEHtmlElementCollection.cpp | 356 --- .../embed/ActiveX/IEHtmlElementCollection.h | 84 - mozilla/webshell/embed/ActiveX/IEHtmlNode.cpp | 102 - mozilla/webshell/embed/ActiveX/IEHtmlNode.h | 46 - .../embed/ActiveX/IOleCommandTargetImpl.h | 272 -- .../webshell/embed/ActiveX/ItemContainer.cpp | 119 - .../webshell/embed/ActiveX/ItemContainer.h | 60 - .../webshell/embed/ActiveX/LegacyPlugin.cpp | 567 ---- .../webshell/embed/ActiveX/MozillaBrowser.cpp | 2800 ----------------- .../webshell/embed/ActiveX/MozillaBrowser.h | 429 --- .../webshell/embed/ActiveX/MozillaBrowser.htm | 47 - .../webshell/embed/ActiveX/MozillaBrowser.ico | Bin 4710 -> 0 bytes .../webshell/embed/ActiveX/MozillaBrowser.rgs | 34 - .../webshell/embed/ActiveX/MozillaControl.cpp | 105 - .../webshell/embed/ActiveX/MozillaControl.dsp | 317 -- .../embed/ActiveX/MozillaControl.html | 14 - .../webshell/embed/ActiveX/MozillaControl.idl | 433 --- .../webshell/embed/ActiveX/MozillaControl.rc | 189 -- .../embed/ActiveX/MozillaControlps.def | 11 - .../webshell/embed/ActiveX/PropertyBag.cpp | 98 - mozilla/webshell/embed/ActiveX/PropertyBag.h | 52 - mozilla/webshell/embed/ActiveX/PropertyList.h | 49 - mozilla/webshell/embed/ActiveX/StdAfx.cpp | 36 - mozilla/webshell/embed/ActiveX/StdAfx.h | 167 - .../embed/ActiveX/WebShellContainer.cpp | 607 ---- .../embed/ActiveX/WebShellContainer.h | 108 - mozilla/webshell/embed/ActiveX/guids.cpp | 47 - mozilla/webshell/embed/ActiveX/guids.h | 52 - mozilla/webshell/embed/ActiveX/makefile.win | 198 -- mozilla/webshell/embed/ActiveX/mkctldef.bat | 30 - .../embed/ActiveX/nsSetupRegistry.cpp | 29 - mozilla/webshell/embed/ActiveX/resource.h | 36 - 52 files changed, 13163 deletions(-) delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveScriptSite.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveScriptSite.h delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveXPlugin.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveXPlugin.h delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.h delete mode 100644 mozilla/webshell/embed/ActiveX/ActiveXTypes.h delete mode 100644 mozilla/webshell/embed/ActiveX/BrowserDiagnostics.h delete mode 100644 mozilla/webshell/embed/ActiveX/CPMozillaControl.h delete mode 100644 mozilla/webshell/embed/ActiveX/ControlSite.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ControlSite.h delete mode 100644 mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.h delete mode 100644 mozilla/webshell/embed/ActiveX/DHTMLCmdIds.h delete mode 100644 mozilla/webshell/embed/ActiveX/DropTarget.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/DropTarget.h delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlDocument.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlDocument.h delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlElement.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlElement.h delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.h delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlNode.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/IEHtmlNode.h delete mode 100644 mozilla/webshell/embed/ActiveX/IOleCommandTargetImpl.h delete mode 100644 mozilla/webshell/embed/ActiveX/ItemContainer.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/ItemContainer.h delete mode 100644 mozilla/webshell/embed/ActiveX/LegacyPlugin.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaBrowser.h delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaBrowser.htm delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaBrowser.ico delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaBrowser.rgs delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControl.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControl.dsp delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControl.html delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControl.idl delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControl.rc delete mode 100644 mozilla/webshell/embed/ActiveX/MozillaControlps.def delete mode 100644 mozilla/webshell/embed/ActiveX/PropertyBag.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/PropertyBag.h delete mode 100644 mozilla/webshell/embed/ActiveX/PropertyList.h delete mode 100644 mozilla/webshell/embed/ActiveX/StdAfx.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/StdAfx.h delete mode 100644 mozilla/webshell/embed/ActiveX/WebShellContainer.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/WebShellContainer.h delete mode 100644 mozilla/webshell/embed/ActiveX/guids.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/guids.h delete mode 100644 mozilla/webshell/embed/ActiveX/makefile.win delete mode 100755 mozilla/webshell/embed/ActiveX/mkctldef.bat delete mode 100644 mozilla/webshell/embed/ActiveX/nsSetupRegistry.cpp delete mode 100644 mozilla/webshell/embed/ActiveX/resource.h diff --git a/mozilla/webshell/embed/ActiveX/ActiveScriptSite.cpp b/mozilla/webshell/embed/ActiveX/ActiveScriptSite.cpp deleted file mode 100644 index 6e56b1b2bc2..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveScriptSite.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ - -#include "stdafx.h" -#include -#include -#include "ActiveScriptSite.h" - - -CActiveScriptSite::CActiveScriptSite() -{ - m_ssScriptState = SCRIPTSTATE_UNINITIALIZED; -} - - -CActiveScriptSite::~CActiveScriptSite() -{ - Detach(); -} - - -HRESULT CActiveScriptSite::Attach(CLSID clsidScriptEngine) -{ - // Detach to anything already attached to - Detach(); - - // Create the new script engine - HRESULT hr = m_spIActiveScript.CoCreateInstance(clsidScriptEngine); - if (FAILED(hr)) - { - return hr; - } - - // Attach the script engine to this site - m_spIActiveScript->SetScriptSite(this); - - // Initialise the script engine - CIPtr(IActiveScriptParse) spActiveScriptParse = m_spIActiveScript; - if (spActiveScriptParse) - { - spActiveScriptParse->InitNew(); - } - else - { - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::Detach() -{ - if (m_spIActiveScript) - { - StopScript(); - m_spIActiveScript->Close(); - m_spIActiveScript.Release(); - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::AttachVBScript() -{ - static const CLSID CLSID_VBScript = - { 0xB54F3741, 0x5B07, 0x11CF, { 0xA4, 0xB0, 0x00, 0xAA, 0x00, 0x4A, 0x55, 0xE8} }; - - return Attach(CLSID_VBScript); -} - - -HRESULT CActiveScriptSite::AttachJScript() -{ - static const CLSID CLSID_JScript = - { 0xF414C260, 0x6AC0, 0x11CF, { 0xB6, 0xD1, 0x00, 0xAA, 0x00, 0xBB, 0xBB, 0x58} }; - - return Attach(CLSID_JScript); -} - - -HRESULT CActiveScriptSite::AddNamedObject(const TCHAR *szName, IUnknown *pObject, BOOL bGlobalMembers) -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - if (pObject == NULL || szName == NULL) - { - return E_INVALIDARG; - } - - // Check for objects of the same name already - CNamedObjectList::iterator i = m_cObjectList.find(szName); - if (i != m_cObjectList.end()) - { - return E_FAIL; - } - - // Add object to the list - m_cObjectList.insert(CNamedObjectList::value_type(szName, pObject)); - - // Tell the script engine about the object - HRESULT hr; - USES_CONVERSION; - DWORD dwFlags = SCRIPTITEM_ISSOURCE | SCRIPTITEM_ISVISIBLE; - if (bGlobalMembers) - { - dwFlags |= SCRIPTITEM_GLOBALMEMBERS; - } - - hr = m_spIActiveScript->AddNamedItem(T2OLE(szName), dwFlags); - - if (FAILED(hr)) - { - m_cObjectList.erase(szName); - return hr; - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::ParseScriptFile(const TCHAR *szFile) -{ - USES_CONVERSION; - const char *pszFileName = T2CA(szFile); - - // Stat the file and get its length; - struct _stat cStat; - _stat(pszFileName, &cStat); - - // Allocate a buffer - size_t nBufSize = cStat.st_size + 1; - char *pBuffer = (char *) malloc(nBufSize); - if (pBuffer == NULL) - { - return E_OUTOFMEMORY; - } - memset(pBuffer, 0, nBufSize); - - // Read the script into the buffer and parse it - HRESULT hr = E_FAIL; - FILE *f = fopen(pszFileName, "rb"); - if (f) - { - fread(pBuffer, 1, nBufSize - 1, f); - hr = ParseScriptText(A2T(pBuffer)); - fclose(f); - } - - free(pBuffer); - - return hr; -} - - -HRESULT CActiveScriptSite::ParseScriptText(const TCHAR *szScript) -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - CIPtr(IActiveScriptParse) spIActiveScriptParse = m_spIActiveScript; - if (spIActiveScriptParse) - { - USES_CONVERSION; - - CComVariant vResult; - DWORD dwCookie = 0; // TODO - DWORD dwFlags = 0; - EXCEPINFO cExcepInfo; - HRESULT hr; - - hr = spIActiveScriptParse->ParseScriptText( - T2OLE(szScript), - NULL, NULL, NULL, dwCookie, 0, dwFlags, - &vResult, &cExcepInfo); - - if (FAILED(hr)) - { - return E_FAIL; - } - } - else - { - CIPtr(IPersistStream) spPersistStream = m_spIActiveScript; - CIPtr(IStream) spStream; - - // Load text into the stream IPersistStream - if (spPersistStream && - SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &spStream))) - { - USES_CONVERSION; - LARGE_INTEGER cPos = { 0, 0 }; - LPOLESTR szText = T2OLE(szScript); - spStream->Write(szText, wcslen(szText) * sizeof(WCHAR), NULL); - spStream->Seek(cPos, STREAM_SEEK_SET, NULL); - spPersistStream->Load(spStream); - } - else - { - return E_UNEXPECTED; - } - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::PlayScript() -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - m_spIActiveScript->SetScriptState(SCRIPTSTATE_CONNECTED); - - return S_OK; -} - - -HRESULT CActiveScriptSite::StopScript() -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - m_spIActiveScript->SetScriptState(SCRIPTSTATE_DISCONNECTED); - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IActiveScriptSite implementation - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetLCID(/* [out] */ LCID __RPC_FAR *plcid) -{ - // Use the system defined locale - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetItemInfo(/* [in] */ LPCOLESTR pstrName, /* [in] */ DWORD dwReturnMask, /* [out] */ IUnknown __RPC_FAR *__RPC_FAR *ppiunkItem, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppti) -{ - if (pstrName == NULL) - { - return E_INVALIDARG; - } - - if (ppiunkItem) - { - *ppiunkItem = NULL; - } - - if (ppti) - { - *ppti = NULL; - } - - USES_CONVERSION; - - // Find object in list - CIUnkPtr spUnkObject; - CNamedObjectList::iterator i = m_cObjectList.find(OLE2T(pstrName)); - if (i != m_cObjectList.end()) - { - spUnkObject = (*i).second; - } - - // Fill in the output values - if (spUnkObject == NULL) - { - return TYPE_E_ELEMENTNOTFOUND; - } - if (dwReturnMask & SCRIPTINFO_IUNKNOWN) - { - spUnkObject->QueryInterface(IID_IUnknown, (void **) ppiunkItem); - } - if (dwReturnMask & SCRIPTINFO_ITYPEINFO) - { - // Return the typeinfo in ptti - CIPtr(IDispatch) spIDispatch = spUnkObject; - if (spIDispatch) - { - HRESULT hr; - hr = spIDispatch->GetTypeInfo(0, GetSystemDefaultLCID(), ppti); - if (FAILED(hr)) - { - *ppti = NULL; - } - } - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetDocVersionString(/* [out] */ BSTR __RPC_FAR *pbstrVersion) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnScriptTerminate(/* [in] */ const VARIANT __RPC_FAR *pvarResult, /* [in] */ const EXCEPINFO __RPC_FAR *pexcepinfo) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnStateChange(/* [in] */ SCRIPTSTATE ssScriptState) -{ - m_ssScriptState = ssScriptState; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnScriptError(/* [in] */ IActiveScriptError __RPC_FAR *pscripterror) -{ - BSTR bstrSourceLineText = NULL; - DWORD dwSourceContext = 0; - ULONG pulLineNumber = 0; - LONG ichCharPosition = 0; - EXCEPINFO cExcepInfo; - - memset(&cExcepInfo, 0, sizeof(cExcepInfo)); - - // Get error information - pscripterror->GetSourcePosition(&dwSourceContext, &pulLineNumber, &ichCharPosition); - pscripterror->GetSourceLineText(&bstrSourceLineText); - pscripterror->GetExceptionInfo(&cExcepInfo); - - tstring szDescription(_T("(No description)")); - if (cExcepInfo.bstrDescription) - { - // Dump info - USES_CONVERSION; - szDescription = OLE2T(cExcepInfo.bstrDescription); - } - - ATLTRACE(_T("Script Error: %s, code=0x%08x\n"), szDescription.c_str(), cExcepInfo.scode); - - SysFreeString(bstrSourceLineText); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnEnterScript(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnLeaveScript(void) -{ - return S_OK; -} - - diff --git a/mozilla/webshell/embed/ActiveX/ActiveScriptSite.h b/mozilla/webshell/embed/ActiveX/ActiveScriptSite.h deleted file mode 100644 index 76567640be4..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveScriptSite.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 ACTIVESCRIPTSITE_H -#define ACTIVESCRIPTSITE_H - - -class CActiveScriptSite : public CComObjectRootEx, - public IActiveScriptSite -{ - // Pointer to owned script engine - CComQIPtr m_spIActiveScript; - - // List of registered, named objects - CNamedObjectList m_cObjectList; - - // Current script state - SCRIPTSTATE m_ssScriptState; - -public: - CActiveScriptSite(); - virtual ~CActiveScriptSite(); - -BEGIN_COM_MAP(CActiveScriptSite) - COM_INTERFACE_ENTRY(IActiveScriptSite) -END_COM_MAP() - - // Attach to the specified script engine - virtual HRESULT Attach(CLSID clsidScriptEngine); - // Helper to attach to the VBScript engine - virtual HRESULT AttachVBScript(); - // Helper to attach to the JScript engine - virtual HRESULT AttachJScript(); - // Detach from the script engine - virtual HRESULT Detach(); - // Return the current state of the script engine - virtual SCRIPTSTATE GetScriptState() const - { - return m_ssScriptState; - } - - // Parse the specified script - virtual HRESULT ParseScriptText(const TCHAR *szScript); - // Parse the specified script from a file - virtual HRESULT ParseScriptFile(const TCHAR *szFile); - // Add object to script address space - virtual HRESULT AddNamedObject(const TCHAR *szName, IUnknown *pObject, BOOL bGlobalMembers = FALSE); - // Play the script - virtual HRESULT PlayScript(); - // Stop the script - virtual HRESULT StopScript(); - -public: - // IActiveScriptSite - virtual HRESULT STDMETHODCALLTYPE GetLCID(/* [out] */ LCID __RPC_FAR *plcid); - virtual HRESULT STDMETHODCALLTYPE GetItemInfo(/* [in] */ LPCOLESTR pstrName, /* [in] */ DWORD dwReturnMask, /* [out] */ IUnknown __RPC_FAR *__RPC_FAR *ppiunkItem, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppti); - virtual HRESULT STDMETHODCALLTYPE GetDocVersionString(/* [out] */ BSTR __RPC_FAR *pbstrVersion); - virtual HRESULT STDMETHODCALLTYPE OnScriptTerminate(/* [in] */ const VARIANT __RPC_FAR *pvarResult, /* [in] */ const EXCEPINFO __RPC_FAR *pexcepinfo); - virtual HRESULT STDMETHODCALLTYPE OnStateChange(/* [in] */ SCRIPTSTATE ssScriptState); - virtual HRESULT STDMETHODCALLTYPE OnScriptError(/* [in] */ IActiveScriptError __RPC_FAR *pscripterror); - virtual HRESULT STDMETHODCALLTYPE OnEnterScript(void); - virtual HRESULT STDMETHODCALLTYPE OnLeaveScript(void); -}; - -typedef CComObject CActiveScriptSiteInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ActiveXPlugin.cpp b/mozilla/webshell/embed/ActiveX/ActiveXPlugin.cpp deleted file mode 100644 index 491b6a93fa9..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveXPlugin.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ -#include "stdafx.h" - -static CActiveXPlugin *gpFactory = NULL; - -extern "C" NS_EXPORT nsresult -NSGetFactory(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aProgID, - nsIFactory **aFactory) -{ - if (aClass.Equals(kIPluginIID)) - { - if (gpFactory) - { - gpFactory->AddRef(); - *aFactory = (nsIFactory *) gpFactory; - return NS_OK; - } - - CActiveXPlugin *pFactory = new CActiveXPlugin(); - if (pFactory == NULL) - { - return NS_ERROR_OUT_OF_MEMORY; - } - pFactory->AddRef(); - gpFactory = pFactory; - *aFactory = pFactory; - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr) -{ - return (_Module.GetLockCount() == 0); -} - -/////////////////////////////////////////////////////////////////////////////// - -CActiveXPlugin::CActiveXPlugin() -{ - NS_INIT_REFCNT(); -} - - -CActiveXPlugin::~CActiveXPlugin() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// nsISupports implementation - - -NS_IMPL_ADDREF(CActiveXPlugin) -NS_IMPL_RELEASE(CActiveXPlugin) - -nsresult CActiveXPlugin::QueryInterface(const nsIID& aIID, void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) - { - return NS_ERROR_NULL_POINTER; - } - - *aInstancePtrResult = NULL; - - if (aIID.Equals(kISupportsIID)) - { - *aInstancePtrResult = (void*) ((nsIPlugin*)this); - AddRef(); - return NS_OK; - } - - if (aIID.Equals(kIFactoryIID)) - { - *aInstancePtrResult = (void*) ((nsIPlugin*)this); - AddRef(); - return NS_OK; - } - - if (aIID.Equals(kIPluginIID)) - { - *aInstancePtrResult = (void*) ((nsIPlugin*)this); - AddRef(); - return NS_OK; - } - - return NS_NOINTERFACE; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIFactory overrides - -NS_IMETHODIMP CActiveXPlugin::CreateInstance(nsISupports *aOuter, REFNSIID aIID, void **aResult) -{ - CActiveXPluginInstance *pInst = new CActiveXPluginInstance(); - if (pInst == NULL) - { - return NS_ERROR_OUT_OF_MEMORY; - } - pInst->AddRef(); - *aResult = pInst; - return NS_OK; -} - -NS_IMETHODIMP CActiveXPlugin::LockFactory(PRBool aLock) -{ - if (aLock) - { - _Module.Lock(); - } - else - { - _Module.Unlock(); - } - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIPlugin overrides - -static const char *gpszMime = "application/x-oleobject:smp:Mozilla ActiveX Control Plug-in"; -static const char *gpszPluginName = "Mozilla ActiveX Control Plug-in"; -static const char *gpszPluginDesc = "ActiveX control host"; - -NS_IMETHODIMP CActiveXPlugin::CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, const char* aPluginMIMEType, void **aResult) -{ - return CreateInstance(aOuter, aIID, aResult); -} - -NS_IMETHODIMP CActiveXPlugin::Initialize() -{ - return NS_OK; -} - - -NS_IMETHODIMP CActiveXPlugin::Shutdown(void) -{ - return NS_OK; -} - - -NS_IMETHODIMP CActiveXPlugin::GetMIMEDescription(const char* *resultingDesc) -{ - *resultingDesc = gpszMime; - return NS_OK; -} - - -NS_IMETHODIMP CActiveXPlugin::GetValue(nsPluginVariable variable, void *value) -{ - nsresult err = NS_OK; - if (variable == nsPluginVariable_NameString) - { - *((char **)value) = const_cast(gpszPluginName); - } - else if (variable == nsPluginVariable_DescriptionString) - { - *((char **)value) = const_cast(gpszPluginDesc); - } - else - { - err = NS_ERROR_FAILURE; - } - return err; -} diff --git a/mozilla/webshell/embed/ActiveX/ActiveXPlugin.h b/mozilla/webshell/embed/ActiveX/ActiveXPlugin.h deleted file mode 100644 index 680bf20143a..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveXPlugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 ACTIVEXPLUGIN_H -#define ACTIVEXPLUGIN_H - -class CActiveXPlugin : public nsIPlugin -{ -protected: - virtual ~CActiveXPlugin(); - -public: - CActiveXPlugin(); - - // nsISupports overrides - NS_DECL_ISUPPORTS - - // nsIFactory overrides - NS_IMETHOD CreateInstance(nsISupports *aOuter, REFNSIID aIID, void **aResult); - NS_IMETHOD LockFactory(PRBool aLock); - - // nsIPlugin overrides - NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, const char* aPluginMIMEType, void **aResult); - NS_IMETHOD Initialize(); - NS_IMETHOD Shutdown(void); - NS_IMETHOD GetMIMEDescription(const char* *resultingDesc); - NS_IMETHOD GetValue(nsPluginVariable variable, void *value); -}; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.cpp b/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.cpp deleted file mode 100644 index d22928fe32b..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ -#include "stdafx.h" - -/////////////////////////////////////////////////////////////////////////////// - -CActiveXPluginInstance::CActiveXPluginInstance() -{ - NS_INIT_REFCNT(); - mControlSite = NULL; -} - - -CActiveXPluginInstance::~CActiveXPluginInstance() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// nsISupports implementation - -NS_IMPL_ADDREF(CActiveXPluginInstance) -NS_IMPL_RELEASE(CActiveXPluginInstance) - -nsresult CActiveXPluginInstance::QueryInterface(const nsIID& aIID, void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) - { - return NS_ERROR_NULL_POINTER; - } - - *aInstancePtrResult = NULL; - - if (aIID.Equals(kISupportsIID)) - { - *aInstancePtrResult = (void*) ((nsIPluginInstance*)this); - AddRef(); - return NS_OK; - } - - if (aIID.Equals(kIPluginInstanceIID)) - { - *aInstancePtrResult = (void*) ((nsIPluginInstance*)this); - AddRef(); - return NS_OK; - } - - return NS_NOINTERFACE; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIPluginInstance overrides - -NS_IMETHODIMP CActiveXPluginInstance::Initialize(nsIPluginInstancePeer* peer) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::GetPeer(nsIPluginInstancePeer* *resultingPeer) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::Start(void) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::Stop(void) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::Destroy(void) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::SetWindow(nsPluginWindow* window) -{ - if (window) - { - mPluginWindow = *window; - } - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::NewStream(nsIPluginStreamListener** listener) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::Print(nsPluginPrint* platformPrint) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::GetValue(nsPluginInstanceVariable variable, void *value) -{ - return NS_OK; -} - -NS_IMETHODIMP CActiveXPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* handled) -{ - return NS_OK; -} diff --git a/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.h b/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.h deleted file mode 100644 index b608d03527a..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveXPluginInstance.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 ACTIVEXPLUGININSTANCE_H -#define ACTIVEXPLUGININSTANCE_H - -class CActiveXPluginInstance : public nsIPluginInstance -{ -protected: - virtual ~CActiveXPluginInstance(); - - CControlSite *mControlSite; - nsPluginWindow mPluginWindow; - -public: - CActiveXPluginInstance(); - - // nsISupports overrides - NS_DECL_ISUPPORTS - - // nsIPluginInstance overrides - NS_IMETHOD Initialize(nsIPluginInstancePeer* peer); - NS_IMETHOD GetPeer(nsIPluginInstancePeer* *resultingPeer); - NS_IMETHOD Start(void); - NS_IMETHOD Stop(void); - NS_IMETHOD Destroy(void); - NS_IMETHOD SetWindow(nsPluginWindow* window); - NS_IMETHOD NewStream(nsIPluginStreamListener** listener); - NS_IMETHOD Print(nsPluginPrint* platformPrint); - NS_IMETHOD GetValue(nsPluginInstanceVariable variable, void *value); - NS_IMETHOD HandleEvent(nsPluginEvent* event, PRBool* handled); -}; - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ActiveXTypes.h b/mozilla/webshell/embed/ActiveX/ActiveXTypes.h deleted file mode 100644 index da85c2f1b16..00000000000 --- a/mozilla/webshell/embed/ActiveX/ActiveXTypes.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 ACTIVEXTYPES_H -#define ACTIVEXTYPES_H - -#include -#include - -// STL based class for handling TCHAR strings -typedef std::basic_string tstring; - -// IUnknown smart pointer -typedef CComPtr CIUnkPtr; - -// Smart pointer macro for CComQIPtr -#define CIPtr(iface) CComQIPtr< iface, &IID_ ## iface > - -typedef std::vector CObjectList; -typedef std::map CNamedObjectList; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/BrowserDiagnostics.h b/mozilla/webshell/embed/ActiveX/BrowserDiagnostics.h deleted file mode 100644 index 711544cef1f..00000000000 --- a/mozilla/webshell/embed/ActiveX/BrowserDiagnostics.h +++ /dev/null @@ -1,56 +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.org 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 BROWSER_DIAGNOSTICS_H -#define BROWSER_DIAGNOSTICS_H - -#ifdef _DEBUG -# include -# define NG_TRACE ATLTRACE -# define NG_TRACE_METHOD(fn) \ - { \ - NG_TRACE(_T("0x%04x %s()\n"), (int) GetCurrentThreadId(), _T(#fn)); \ - } -# define NG_TRACE_METHOD_ARGS(fn, pattern, args) \ - { \ - NG_TRACE(_T("0x%04x %s(") _T(pattern) _T(")\n"), (int) GetCurrentThreadId(), _T(#fn), args); \ - } -# define NG_ASSERT(expr) assert(expr) -# define NG_ASSERT_POINTER(p, type) \ - NG_ASSERT(((p) != NULL) && NgIsValidAddress((p), sizeof(type), FALSE)) -# define NG_ASSERT_NULL_OR_POINTER(p, type) \ - NG_ASSERT(((p) == NULL) || NgIsValidAddress((p), sizeof(type), FALSE)) -#else -# define NG_TRACE ATLTRACE -# define NG_TRACE_METHOD(fn) -# define NG_TRACE_METHOD_ARGS(fn, pattern, args) -# define NG_ASSERT(X) -# define NG_ASSERT_POINTER(p, type) -# define NG_ASSERT_NULL_OR_POINTER(p, type) -#endif - -inline BOOL NgIsValidAddress(const void* lp, UINT nBytes, BOOL bReadWrite = TRUE) -{ - return (lp != NULL && !IsBadReadPtr(lp, nBytes) && - (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes))); -} - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/CPMozillaControl.h b/mozilla/webshell/embed/ActiveX/CPMozillaControl.h deleted file mode 100644 index a192697c70f..00000000000 --- a/mozilla/webshell/embed/ActiveX/CPMozillaControl.h +++ /dev/null @@ -1,934 +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.org 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 CPMOZILLACONTROL_H -#define CPMOZILLACONTROL_H - -////////////////////////////////////////////////////////////////////////////// -// CProxyDWebBrowserEvents -template -class CProxyDWebBrowserEvents : public IConnectionPointImpl -{ -public: -//methods: -//DWebBrowserEvents : IDispatch -public: - void Fire_BeforeNavigate( - BSTR URL, - long Flags, - BSTR TargetFrameName, - VARIANT * PostData, - BSTR Headers, - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[6]; - for (int i = 0; i < 6; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[5].vt = VT_BSTR; - pvars[5].bstrVal= URL; - pvars[4].vt = VT_I4; - pvars[4].lVal= Flags; - pvars[3].vt = VT_BSTR; - pvars[3].bstrVal= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_BSTR; - pvars[1].bstrVal= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 6, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x64, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_NavigateComplete( - BSTR URL) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= URL; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x65, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_StatusTextChange( - BSTR Text) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= Text; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_ProgressChange( - long Progress, - long ProgressMax) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_I4; - pvars[1].lVal= Progress; - pvars[0].vt = VT_I4; - pvars[0].lVal= ProgressMax; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_DownloadComplete() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_CommandStateChange( - long Command, - VARIANT_BOOL Enable) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_I4; - pvars[1].lVal= Command; - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= Enable; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_DownloadBegin() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_NewWindow( - BSTR URL, - long Flags, - BSTR TargetFrameName, - VARIANT * PostData, - BSTR Headers, - VARIANT_BOOL * Processed) - { - VARIANTARG* pvars = new VARIANTARG[6]; - for (int i = 0; i < 6; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[5].vt = VT_BSTR; - pvars[5].bstrVal= URL; - pvars[4].vt = VT_I4; - pvars[4].lVal= Flags; - pvars[3].vt = VT_BSTR; - pvars[3].bstrVal= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_BSTR; - pvars[1].bstrVal= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Processed; - DISPPARAMS disp = { pvars, NULL, 6, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6b, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_TitleChange( - BSTR Text) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= Text; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_FrameBeforeNavigate( - BSTR URL, - long Flags, - BSTR TargetFrameName, - VARIANT * PostData, - BSTR Headers, - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[6]; - for (int i = 0; i < 6; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[5].vt = VT_BSTR; - pvars[5].bstrVal= URL; - pvars[4].vt = VT_I4; - pvars[4].lVal= Flags; - pvars[3].vt = VT_BSTR; - pvars[3].bstrVal= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_BSTR; - pvars[1].bstrVal= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 6, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xc8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_FrameNavigateComplete( - BSTR URL) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= URL; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xc9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_FrameNewWindow( - BSTR URL, - long Flags, - BSTR TargetFrameName, - VARIANT * PostData, - BSTR Headers, - VARIANT_BOOL * Processed) - { - VARIANTARG* pvars = new VARIANTARG[6]; - for (int i = 0; i < 6; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[5].vt = VT_BSTR; - pvars[5].bstrVal= URL; - pvars[4].vt = VT_I4; - pvars[4].lVal= Flags; - pvars[3].vt = VT_BSTR; - pvars[3].bstrVal= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_BSTR; - pvars[1].bstrVal= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Processed; - DISPPARAMS disp = { pvars, NULL, 6, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xcc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_Quit( - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x67, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_WindowMove() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6d, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_WindowResize() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6e, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_WindowActivate() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6f, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_PropertyChange( - BSTR Property) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= Property; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - -}; - - -////////////////////////////////////////////////////////////////////////////// -// CProxyDWebBrowserEvents2 -template -class CProxyDWebBrowserEvents2 : public IConnectionPointImpl -{ -public: -//methods: -//DWebBrowserEvents2 : IDispatch -public: - void Fire_StatusTextChange( - BSTR Text) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= Text; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_ProgressChange( - long Progress, - long ProgressMax) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_I4; - pvars[1].lVal= Progress; - pvars[0].vt = VT_I4; - pvars[0].lVal= ProgressMax; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_CommandStateChange( - long Command, - VARIANT_BOOL Enable) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_I4; - pvars[1].lVal= Command; - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= Enable; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_DownloadBegin() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_DownloadComplete() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_TitleChange( - BSTR Text) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= Text; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_PropertyChange( - BSTR szProperty) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BSTR; - pvars[0].bstrVal= szProperty; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_BeforeNavigate2( - IDispatch * pDisp, - VARIANT * URL, - VARIANT * Flags, - VARIANT * TargetFrameName, - VARIANT * PostData, - VARIANT * Headers, - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[7]; - for (int i = 0; i < 7; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[6].vt = VT_DISPATCH; - pvars[6].pdispVal= pDisp; - pvars[5].vt = VT_VARIANT | VT_BYREF; - pvars[5].byref= URL; - pvars[4].vt = VT_VARIANT | VT_BYREF; - pvars[4].byref= Flags; - pvars[3].vt = VT_VARIANT | VT_BYREF; - pvars[3].byref= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_VARIANT | VT_BYREF; - pvars[1].byref= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 7, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfa, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_NewWindow2( - IDispatch * * ppDisp, - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_DISPATCH | VT_BYREF; - pvars[1].byref= ppDisp; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfb, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_NavigateComplete2( - IDispatch * pDisp, - VARIANT * URL) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_DISPATCH; - pvars[1].pdispVal= pDisp; - pvars[0].vt = VT_VARIANT | VT_BYREF; - pvars[0].byref= URL; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_DocumentComplete( - IDispatch * pDisp, - VARIANT * URL) - { - VARIANTARG* pvars = new VARIANTARG[2]; - for (int i = 0; i < 2; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[1].vt = VT_DISPATCH; - pvars[1].pdispVal= pDisp; - pvars[0].vt = VT_VARIANT | VT_BYREF; - pvars[0].byref= URL; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x103, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnQuit() - { - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - DISPPARAMS disp = { NULL, NULL, 0, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfd, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_OnVisible( - VARIANT_BOOL Visible) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= Visible; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfe, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnToolBar( - VARIANT_BOOL ToolBar) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= ToolBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xff, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnMenuBar( - VARIANT_BOOL MenuBar) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= MenuBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x100, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnStatusBar( - VARIANT_BOOL StatusBar) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= StatusBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x101, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnFullScreen( - VARIANT_BOOL FullScreen) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= FullScreen; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x102, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnTheaterMode( - VARIANT_BOOL TheaterMode) - { - VARIANTARG* pvars = new VARIANTARG[1]; - for (int i = 0; i < 1; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[0].vt = VT_BOOL; - pvars[0].boolVal= TheaterMode; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x104, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - -}; - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ControlSite.cpp b/mozilla/webshell/embed/ActiveX/ControlSite.cpp deleted file mode 100644 index aa762fa0d0d..00000000000 --- a/mozilla/webshell/embed/ActiveX/ControlSite.cpp +++ /dev/null @@ -1,1028 +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.org 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): - */ - -#include "StdAfx.h" - -#include "ControlSite.h" - - -std::list CControlSite::m_cControlList; - -// Constructor -CControlSite::CControlSite() -{ - NG_TRACE_METHOD(CControlSite::CControlSite); - - m_hWndParent = NULL; - m_clsid = CLSID_NULL; - m_bSetClientSiteFirst = FALSE; - m_bVisibleAtRuntime = TRUE; - memset(&m_rcObjectPos, 0, sizeof(m_rcObjectPos)); - - m_bInPlaceActive = FALSE; - m_bUIActive = FALSE; - m_bInPlaceLocked = FALSE; - m_bWindowless = FALSE; - m_bSupportWindowlessActivation = TRUE; - m_bSafeForScriptingObjectsOnly = FALSE; - - // Initialise ambient properties - m_nAmbientLocale = 0; - m_clrAmbientForeColor = ::GetSysColor(COLOR_WINDOWTEXT); - m_clrAmbientBackColor = ::GetSysColor(COLOR_WINDOW); - m_bAmbientUserMode = true; - m_bAmbientShowHatching = true; - m_bAmbientShowGrabHandles = true; - - // Add the control to the list - m_cControlList.push_back(this); -} - - -// Destructor -CControlSite::~CControlSite() -{ - NG_TRACE_METHOD(CControlSite::~CControlSite); - Detach(); - m_cControlList.remove(this); -} - -// Helper method checks whether a class implements a particular category -HRESULT CControlSite::ClassImplementsCategory(const CLSID &clsid, const CATID &catid) -{ - CIPtr(ICatInformation) spCatInfo; - HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatInformation, (LPVOID*) &spCatInfo); - if (spCatInfo == NULL) - { - // Must fail if we can't open the category manager - return E_FAIL; - } - - // See what categories the class implements - CIPtr(IEnumCATID) spEnumCATID; - if (FAILED(spCatInfo->EnumImplCategoriesOfClass(clsid, &spEnumCATID))) - { - // Can't enumerate classes in category so fail - return E_FAIL; - } - - // Search for matching categories - BOOL bFound = FALSE; - CATID catidNext = GUID_NULL; - while (spEnumCATID->Next(1, &catidNext, NULL) == S_OK) - { - if (memcmp(&catid, &catidNext, sizeof(CATID)) == 0) - { - bFound = TRUE; - } - } - if (!bFound) - { - return S_FALSE; - } - - return S_OK; -} - - -#if 0 -// For use when the SDK does not define it (which isn't the case these days) -static const CATID CATID_SafeForScripting = -{ 0x7DD95801, 0x9882, 0x11CF, { 0x9F, 0xA9, 0x00, 0xAA, 0x00, 0x6C, 0x42, 0xC4 } }; -#endif - -// Create the specified control, optionally providing properties to initialise -// it with and a name. -HRESULT CControlSite::Create(REFCLSID clsid, PropertyList &pl, const tstring szName) -{ - NG_TRACE_METHOD_ARGS(CControlSite::Create, "...,...,\"%s\"", szName.c_str()); - - m_clsid = clsid; - m_ParameterList = pl; - m_szName = szName; - - // See if object is script safe - if (m_bSafeForScriptingObjectsOnly && - ClassImplementsCategory(clsid, CATID_SafeForScripting) != S_OK) - { - return E_FAIL; - } - - // Create the object - HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_IUnknown, (void **) &m_spObject); - if (FAILED(hr)) - { - return E_FAIL; - } - - return S_OK; -} - - -// Attach the created control to a window and activate it -HRESULT CControlSite::Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInitStream) -{ - NG_TRACE_METHOD(CControlSite::Attach); - - if (hwndParent == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - m_hWndParent = hwndParent; - m_rcObjectPos = rcPos; - - // Object must have been created - if (m_spObject == NULL) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - m_spIViewObject = m_spObject; - m_spIOleObject = m_spObject; - - if (m_spIOleObject == NULL) - { - return E_FAIL; - } - - DWORD dwMiscStatus; - m_spIOleObject->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus); - - if (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST) - { - m_bSetClientSiteFirst = TRUE; - } - if (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME) - { - m_bVisibleAtRuntime = FALSE; - } - - // Some objects like to have the client site as the first thing - // to be initialised (for ambient properties and so forth) - if (m_bSetClientSiteFirst) - { - m_spIOleObject->SetClientSite(this); - } - - // If there is a parameter list for the object and no init stream then - // create one here. - CPropertyBagInstance *pPropertyBag = NULL; - if (pInitStream == NULL && m_ParameterList.size() >= 1) - { - CPropertyBagInstance::CreateInstance(&pPropertyBag); - pPropertyBag->AddRef(); - for (PropertyList::const_iterator i = m_ParameterList.begin(); i != m_ParameterList.end(); i++) - { - pPropertyBag->Write((*i).szName, (VARIANT *) &(*i).vValue); - } - pInitStream = (IPersistPropertyBag *) pPropertyBag; - } - - // Initialise the control from store if one is provided - if (pInitStream) - { - CComQIPtr spPropertyBag = pInitStream; - CComQIPtr spStream = pInitStream; - CComQIPtr spIPersistStream = m_spIOleObject; - CComQIPtr spIPersistPropertyBag = m_spIOleObject; - - if (spIPersistPropertyBag && spPropertyBag) - { - spIPersistPropertyBag->Load(spPropertyBag, NULL); - } - else if (spIPersistStream && spStream) - { - spIPersistStream->Load(spStream); - } - } - else - { - // Initialise the object if possible - CComQIPtr spIPersistStreamInit = m_spIOleObject; - if (spIPersistStreamInit) - { - spIPersistStreamInit->InitNew(); - } - } - - m_spIOleInPlaceObject = m_spObject; - m_spIOleInPlaceObjectWindowless = m_spObject; - - m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos); - - // In-place activate the object - if (m_bVisibleAtRuntime) - { - DoVerb(OLEIVERB_INPLACEACTIVATE); - } - - // For those objects which haven't had their client site set yet, - // it's done here. - if (!m_bSetClientSiteFirst) - { - m_spIOleObject->SetClientSite(this); - } - - return S_OK; -} - - -// Unhook the control from the window and throw it all away -HRESULT CControlSite::Detach() -{ - NG_TRACE_METHOD(CControlSite::Detach); - - if (m_spIOleInPlaceObjectWindowless) - { - m_spIOleInPlaceObjectWindowless.Release(); - } - - if (m_spIOleInPlaceObject) - { - m_spIOleInPlaceObject->InPlaceDeactivate(); - m_spIOleInPlaceObject.Release(); - } - - if (m_spIOleObject) - { - m_spIOleObject->Close(OLECLOSE_NOSAVE); - m_spIOleObject->SetClientSite(NULL); - m_spIOleObject.Release(); - } - - m_spIViewObject.Release(); - m_spObject.Release(); - - return S_OK; -} - - -// Return the IUnknown of the contained control -HRESULT CControlSite::GetControlUnknown(IUnknown **ppObject) -{ - *ppObject = NULL; - if (m_spObject) - { - m_spObject->QueryInterface(IID_IUnknown, (void **) ppObject); - } - return S_OK; -} - - -// Subscribe to an event sink on the control -HRESULT CControlSite::Advise(IUnknown *pIUnkSink, const IID &iid, DWORD *pdwCookie) -{ - if (m_spObject == NULL) - { - return E_UNEXPECTED; - } - - if (pIUnkSink == NULL || pdwCookie == NULL) - { - return E_INVALIDARG; - } - - return AtlAdvise(m_spObject, pIUnkSink, iid, pdwCookie); -} - - -// Unsubscribe event sink from the control -HRESULT CControlSite::Unadvise(const IID &iid, DWORD dwCookie) -{ - if (m_spObject == NULL) - { - return E_UNEXPECTED; - } - - return AtlUnadvise(m_spObject, iid, dwCookie); -} - - -// Draw the control -HRESULT CControlSite::Draw(HDC hdc) -{ - NG_TRACE_METHOD(CControlSite::Draw); - - // Draw only when control is windowless or deactivated - if (m_spIViewObject) - { - if (m_bWindowless || !m_bInPlaceActive) - { - RECTL *prcBounds = (m_bWindowless) ? NULL : (RECTL *) &m_rcObjectPos; - m_spIViewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL, hdc, prcBounds, NULL, NULL, 0); - } - } - else - { - // Draw something to indicate no control is there - HBRUSH hbr = CreateSolidBrush(RGB(200,200,200)); - FillRect(hdc, &m_rcObjectPos, hbr); - DeleteObject(hbr); - } - - return S_OK; -} - - -// Execute the specified verb -HRESULT CControlSite::DoVerb(LONG nVerb, LPMSG lpMsg) -{ - NG_TRACE_METHOD(CControlSite::DoVerb); - - if (m_spIOleObject == NULL) - { - return E_FAIL; - } - - return m_spIOleObject->DoVerb(nVerb, lpMsg, this, 0, m_hWndParent, &m_rcObjectPos); -} - - -// Set the position on the control -HRESULT CControlSite::SetPosition(const RECT &rcPos) -{ - NG_TRACE_METHOD(CControlSite::SetPosition); - m_rcObjectPos = rcPos; - if (m_spIOleInPlaceObject) - { - m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos); - } - return S_OK; -} - - -void CControlSite::FireAmbientPropertyChange(DISPID id) -{ - if (m_spObject) - { - CIPtr(IOleControl) spControl = m_spObject; - if (spControl) - { - spControl->OnAmbientPropertyChange(id); - } - } -} - - -void CControlSite::SetAmbientUserMode(BOOL bUserMode) -{ - bool bNewMode = bUserMode ? true : false; - if (m_bAmbientUserMode != bNewMode) - { - m_bAmbientUserMode = bNewMode; - FireAmbientPropertyChange(DISPID_AMBIENT_USERMODE); - } -} - - -/////////////////////////////////////////////////////////////////////////////// -// IDispatch implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr) -{ - if (wFlags & DISPATCH_PROPERTYGET) - { - CComVariant vResult; - - switch (dispIdMember) - { - case DISPID_AMBIENT_FORECOLOR: - vResult = CComVariant((long) m_clrAmbientForeColor); - break; - - case DISPID_AMBIENT_BACKCOLOR: - vResult = CComVariant((long) m_clrAmbientBackColor); - break; - - case DISPID_AMBIENT_LOCALEID: - vResult = CComVariant((long) m_nAmbientLocale); - break; - - case DISPID_AMBIENT_USERMODE: - vResult = CComVariant(m_bAmbientUserMode); - break; - - case DISPID_AMBIENT_SHOWGRABHANDLES: - vResult = CComVariant(m_bAmbientShowGrabHandles); - break; - - case DISPID_AMBIENT_SHOWHATCHING: - vResult = CComVariant(m_bAmbientShowHatching); - break; - - default: - return DISP_E_MEMBERNOTFOUND; - } - - VariantCopy(pVarResult, &vResult); - return S_OK; - } - - return E_FAIL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSink implementation - - -void STDMETHODCALLTYPE CControlSite::OnDataChange(/* [unique][in] */ FORMATETC __RPC_FAR *pFormatetc, /* [unique][in] */ STGMEDIUM __RPC_FAR *pStgmed) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnViewChange(/* [in] */ DWORD dwAspect, /* [in] */ LONG lindex) -{ - // Redraw the control - InvalidateRect(NULL, FALSE); -} - - -void STDMETHODCALLTYPE CControlSite::OnRename(/* [in] */ IMoniker __RPC_FAR *pmk) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnSave(void) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnClose(void) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSink2 implementation - - -void STDMETHODCALLTYPE CControlSite::OnLinkSrcChange(/* [unique][in] */ IMoniker __RPC_FAR *pmk) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSinkEx implementation - - -void STDMETHODCALLTYPE CControlSite::OnViewStatusChange(/* [in] */ DWORD dwViewStatus) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSite::GetWindow(/* [out] */ HWND __RPC_FAR *phwnd) -{ - *phwnd = m_hWndParent; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ContextSensitiveHelp(/* [in] */ BOOL fEnterMode) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleClientSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::SaveObject(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetMoniker(/* [in] */ DWORD dwAssign, /* [in] */ DWORD dwWhichMoniker, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmk) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetContainer(/* [out] */ IOleContainer __RPC_FAR *__RPC_FAR *ppContainer) -{ - return E_NOINTERFACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ShowObject(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnShowWindow(/* [in] */ BOOL fShow) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::RequestNewObjectLayout(void) -{ - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::CanInPlaceActivate(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceActivate(void) -{ - m_bInPlaceActive = TRUE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnUIActivate(void) -{ - m_bUIActive = TRUE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetWindowContext(/* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, /* [out] */ LPRECT lprcPosRect, /* [out] */ LPRECT lprcClipRect, /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo) -{ - *lprcPosRect = m_rcObjectPos; - *lprcClipRect = m_rcObjectPos; - - CControlSiteIPFrameInstance *pIPFrame = NULL; - CControlSiteIPFrameInstance::CreateInstance(&pIPFrame); - pIPFrame->AddRef(); - - *ppFrame = (IOleInPlaceFrame *) pIPFrame; - *ppDoc = NULL; - - lpFrameInfo->fMDIApp = FALSE; - lpFrameInfo->hwndFrame = NULL; - lpFrameInfo->haccel = NULL; - lpFrameInfo->cAccelEntries = 0; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::Scroll(/* [in] */ SIZE scrollExtant) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnUIDeactivate(/* [in] */ BOOL fUndoable) -{ - m_bUIActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceDeactivate(void) -{ - m_bInPlaceActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::DiscardUndoState(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::DeactivateAndUndo(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnPosRectChange(/* [in] */ LPCRECT lprcPosRect) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSiteEx implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceActivateEx(/* [out] */ BOOL __RPC_FAR *pfNoRedraw, /* [in] */ DWORD dwFlags) -{ - m_bInPlaceActive = TRUE; - - if (pfNoRedraw) - { - *pfNoRedraw = FALSE; - } - if (dwFlags & ACTIVATE_WINDOWLESS) - { - // TODO check if control is windowless - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceDeactivateEx(/* [in] */ BOOL fNoRedraw) -{ - m_bInPlaceActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::RequestUIActivate(void) -{ - return S_FALSE; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSiteWindowless implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::CanWindowlessActivate(void) -{ - // Allow windowless activation? - return (m_bSupportWindowlessActivation) ? S_OK : S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetCapture(void) -{ - // TODO capture the mouse for the object - return S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::SetCapture(/* [in] */ BOOL fCapture) -{ - // TODO capture the mouse for the object - return S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetFocus(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::SetFocus(/* [in] */ BOOL fFocus) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetDC(/* [in] */ LPCRECT pRect, /* [in] */ DWORD grfFlags, /* [out] */ HDC __RPC_FAR *phDC) -{ - if (phDC == NULL) - { - return E_INVALIDARG; - } - - // Can't do nested painting - if (m_hDCBuffer != NULL) - { - return E_UNEXPECTED; - } - - m_rcBuffer = m_rcObjectPos; - if (pRect != NULL) - { - m_rcBuffer = *pRect; - } - - m_hBMBuffer = NULL; - m_dwBufferFlags = grfFlags; - - // See if the control wants a DC that is onscreen or offscreen - - if (m_dwBufferFlags & OLEDC_OFFSCREEN) - { - m_hDCBuffer = CreateCompatibleDC(NULL); - if (m_hDCBuffer == NULL) - { - // Error - return E_OUTOFMEMORY; - } - - long cx = m_rcBuffer.right - m_rcBuffer.left; - long cy = m_rcBuffer.bottom - m_rcBuffer.top; - - m_hBMBuffer = CreateCompatibleBitmap(m_hDCBuffer, cx, cy); - m_hBMBufferOld = (HBITMAP) SelectObject(m_hDCBuffer, m_hBMBuffer); - SetViewportOrgEx(m_hDCBuffer, m_rcBuffer.left, m_rcBuffer.top, NULL); - - // TODO When OLEDC_PAINTBKGND we must draw every site behind this one - } - else - { - // TODO When OLEDC_PAINTBKGND we must draw every site behind this one - - // Get the window DC - m_hDCBuffer = GetWindowDC(m_hWndParent); - if (m_hDCBuffer == NULL) - { - // Error - return E_OUTOFMEMORY; - } - - // Clip the control so it can't trash anywhere it isn't allowed to draw - if (!(m_dwBufferFlags & OLEDC_NODRAW)) - { - m_hRgnBuffer = CreateRectRgnIndirect(&m_rcBuffer); - - // TODO Clip out opaque areas of sites behind this one - - SelectClipRgn(m_hDCBuffer, m_hRgnBuffer); - } - } - - *phDC = m_hDCBuffer; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ReleaseDC(/* [in] */ HDC hDC) -{ - // Release the DC - NG_ASSERT(hDC); - if (hDC == NULL || hDC != m_hDCBuffer) - { - return E_INVALIDARG; - } - - // Test if the DC was offscreen or onscreen - if (m_dwBufferFlags & OLEDC_OFFSCREEN) - { - // BitBlt the buffer into the control's object - SetViewportOrgEx(m_hDCBuffer, 0, 0, NULL); - HDC hdc = GetWindowDC(m_hWndParent); - - long cx = m_rcBuffer.right - m_rcBuffer.left; - long cy = m_rcBuffer.bottom - m_rcBuffer.top; - - BitBlt(hdc, m_rcBuffer.left, m_rcBuffer.top, cx, cy, m_hDCBuffer, 0, 0, SRCCOPY); - - ::ReleaseDC(m_hWndParent, hdc); - } - else - { - // TODO If OLEDC_PAINTBKGND is set draw the DVASPECT_CONTENT of every object above this one - } - - // Clean up settings ready for next drawing - - if (m_hRgnBuffer) - { - SelectClipRgn(m_hDCBuffer, NULL); - DeleteObject(m_hRgnBuffer); - m_hRgnBuffer = NULL; - } - - SelectObject(m_hDCBuffer, m_hBMBufferOld); - if (m_hBMBuffer) - { - DeleteObject(m_hBMBuffer); - m_hBMBuffer = NULL; - } - - ::ReleaseDC(m_hWndParent, m_hDCBuffer); - m_hDCBuffer = NULL; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::InvalidateRect(/* [in] */ LPCRECT pRect, /* [in] */ BOOL fErase) -{ - // Clip the rectangle against the object's size and invalidate it - RECT rcI = { 0, 0, 0, 0 }; - if (pRect == NULL) - { - rcI = m_rcObjectPos; - } - else - { - IntersectRect(&rcI, &m_rcObjectPos, pRect); - } - ::InvalidateRect(m_hWndParent, &rcI, fErase); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::InvalidateRgn(/* [in] */ HRGN hRGN, /* [in] */ BOOL fErase) -{ - if (hRGN == NULL) - { - ::InvalidateRect(m_hWndParent, &m_rcObjectPos, fErase); - } - else - { - // Clip the region with the object's bounding area - HRGN hrgnClip = CreateRectRgnIndirect(&m_rcObjectPos); - if (CombineRgn(hrgnClip, hrgnClip, hRGN, RGN_AND) != ERROR) - { - ::InvalidateRgn(m_hWndParent, hrgnClip, fErase); - } - DeleteObject(hrgnClip); - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::ScrollRect(/* [in] */ INT dx, /* [in] */ INT dy, /* [in] */ LPCRECT pRectScroll, /* [in] */ LPCRECT pRectClip) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::AdjustRect(/* [out][in] */ LPRECT prc) -{ - if (prc == NULL) - { - return E_INVALIDARG; - } - - // Clip the rectangle against the object position - RECT rcI = { 0, 0, 0, 0 }; - IntersectRect(&rcI, &m_rcObjectPos, prc); - *prc = rcI; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnDefWindowMessage(/* [in] */ UINT msg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam, /* [out] */ LRESULT __RPC_FAR *plResult) -{ - if (plResult == NULL) - { - return E_INVALIDARG; - } - - // Pass the message to the windowless control - if (m_bWindowless && m_spIOleInPlaceObjectWindowless) - { - return m_spIOleInPlaceObjectWindowless->OnWindowMessage(msg, wParam, lParam, plResult); - } - - return S_FALSE; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleControlSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::OnControlInfoChanged(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::LockInPlaceActive(/* [in] */ BOOL fLock) -{ - m_bInPlaceLocked = fLock; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetExtendedControl(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::TransformCoords(/* [out][in] */ POINTL __RPC_FAR *pPtlHimetric, /* [out][in] */ POINTF __RPC_FAR *pPtfContainer, /* [in] */ DWORD dwFlags) -{ - HRESULT hr = S_OK; - - if (pPtlHimetric == NULL) - { - return E_INVALIDARG; - } - if (pPtfContainer == NULL) - { - return E_INVALIDARG; - } - - HDC hdc = ::GetDC(m_hWndParent); - ::SetMapMode(hdc, MM_HIMETRIC); - POINT rgptConvert[2]; - rgptConvert[0].x = 0; - rgptConvert[0].y = 0; - - if (dwFlags & XFORMCOORDS_HIMETRICTOCONTAINER) - { - rgptConvert[1].x = pPtlHimetric->x; - rgptConvert[1].y = pPtlHimetric->y; - ::LPtoDP(hdc, rgptConvert, 2); - if (dwFlags & XFORMCOORDS_SIZE) - { - pPtfContainer->x = (float)(rgptConvert[1].x - rgptConvert[0].x); - pPtfContainer->y = (float)(rgptConvert[0].y - rgptConvert[1].y); - } - else if (dwFlags & XFORMCOORDS_POSITION) - { - pPtfContainer->x = (float)rgptConvert[1].x; - pPtfContainer->y = (float)rgptConvert[1].y; - } - else - { - hr = E_INVALIDARG; - } - } - else if (dwFlags & XFORMCOORDS_CONTAINERTOHIMETRIC) - { - rgptConvert[1].x = (int)(pPtfContainer->x); - rgptConvert[1].y = (int)(pPtfContainer->y); - ::DPtoLP(hdc, rgptConvert, 2); - if (dwFlags & XFORMCOORDS_SIZE) - { - pPtlHimetric->x = rgptConvert[1].x - rgptConvert[0].x; - pPtlHimetric->y = rgptConvert[0].y - rgptConvert[1].y; - } - else if (dwFlags & XFORMCOORDS_POSITION) - { - pPtlHimetric->x = rgptConvert[1].x; - pPtlHimetric->y = rgptConvert[1].y; - } - else - { - hr = E_INVALIDARG; - } - } - else - { - hr = E_INVALIDARG; - } - - ::ReleaseDC(m_hWndParent, hdc); - - return hr; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::TranslateAccelerator(/* [in] */ MSG __RPC_FAR *pMsg, /* [in] */ DWORD grfModifiers) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnFocus(/* [in] */ BOOL fGotFocus) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ShowPropertyFrame(void) -{ - return E_NOTIMPL; -} - diff --git a/mozilla/webshell/embed/ActiveX/ControlSite.h b/mozilla/webshell/embed/ActiveX/ControlSite.h deleted file mode 100644 index a5ed0725562..00000000000 --- a/mozilla/webshell/embed/ActiveX/ControlSite.h +++ /dev/null @@ -1,301 +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.org 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 CONTROLSITE_H -#define CONTROLSITE_H - -#include "IOleCommandTargetImpl.h" - -// If you created a class derived from CControlSite, use the following macro -// in the interface map of the derived class to include all the necessary -// interfaces. -#define CCONTROLSITE_INTERFACES() \ - COM_INTERFACE_ENTRY(IOleWindow) \ - COM_INTERFACE_ENTRY(IOleClientSite) \ - COM_INTERFACE_ENTRY(IOleInPlaceSite) \ - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSite, IOleInPlaceSiteWindowless) \ - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSiteEx, IOleInPlaceSiteWindowless) \ - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSiteWindowless, IOleInPlaceSiteWindowless) \ - COM_INTERFACE_ENTRY(IOleControlSite) \ - COM_INTERFACE_ENTRY(IDispatch) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSink, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSink2, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSinkEx, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY(IOleCommandTarget) - - -// -// Class for hosting an ActiveX control -// -// This class supports both windowed and windowless classes. The normal -// steps to hosting a control are this: -// -// CControlSiteInstance *pSite = NULL; -// CControlSiteInstance::CreateInstance(&pSite); -// pSite->AddRef(); -// pSite->Create(clsidControlToCreate); -// pSite->Attach(hwndParentWindow, rcPosition); -// -// Where propertyList is a named list of values to initialise the new object -// with, hwndParentWindow is the window in which the control is being created, -// and rcPosition is the position in window coordinates where the control will -// be rendered. -// -// Destruction is this: -// -// pSite->Detach(); -// pSite->Release(); -// pSite = NULL; - -class CControlSite : public CComObjectRootEx, - public IOleClientSite, - public IOleInPlaceSiteWindowless, - public IOleControlSite, - public IAdviseSinkEx, - public IDispatch, - public IOleCommandTargetImpl -{ -protected: -// Site management values - // Handle to parent window - HWND m_hWndParent; - // Position of the site and the contained object - RECT m_rcObjectPos; - // Flag indicating if client site should be set early or late - unsigned m_bSetClientSiteFirst:1; - // Flag indicating whether control is visible or not - unsigned m_bVisibleAtRuntime:1; - // Flag indicating if control is in-place active - unsigned m_bInPlaceActive:1; - // Flag indicating if control is UI active - unsigned m_bUIActive:1; - // Flag indicating if control is in-place locked and cannot be deactivated - unsigned m_bInPlaceLocked:1; - // Flag indicating if the site allows windowless controls - unsigned m_bSupportWindowlessActivation:1; - // Flag indicating if control is windowless - unsigned m_bWindowless:1; - // Flag indicating if only safely scriptable controls are allowed - unsigned m_bSafeForScriptingObjectsOnly:1; - -// Pointers to object interfaces - // Raw pointer to the object - CComPtr m_spObject; - // Pointer to objects IViewObject interface - CComQIPtr m_spIViewObject; - // Pointer to object's IOleObject interface - CComQIPtr m_spIOleObject; - // Pointer to object's IOleInPlaceObject interface - CComQIPtr m_spIOleInPlaceObject; - // Pointer to object's IOleInPlaceObjectWindowless interface - CComQIPtr m_spIOleInPlaceObjectWindowless; - // Name of this control - tstring m_szName; - // CLSID of the control - CLSID m_clsid; - // Parameter list - PropertyList m_ParameterList; - -// Double buffer drawing variables used for windowless controls - // Area of buffer - RECT m_rcBuffer; - // Bitmap to buffer - HBITMAP m_hBMBuffer; - // Bitmap to buffer - HBITMAP m_hBMBufferOld; - // Device context - HDC m_hDCBuffer; - // Clipping area of site - HRGN m_hRgnBuffer; - // Flags indicating how the buffer was painted - DWORD m_dwBufferFlags; - -// Ambient properties - // Locale ID - LCID m_nAmbientLocale; - // Foreground colour - COLORREF m_clrAmbientForeColor; - // Background colour - COLORREF m_clrAmbientBackColor; - // Flag indicating if control should hatch itself - bool m_bAmbientShowHatching; - // Flag indicating if control should have grab handles - bool m_bAmbientShowGrabHandles; - // Flag indicating if control is in edit/user mode - bool m_bAmbientUserMode; - -protected: - // Notifies the attached control of a change to an ambient property - virtual void FireAmbientPropertyChange(DISPID id); - -public: -// Construction and destruction - // Constructor - CControlSite(); - // Destructor - virtual ~CControlSite(); - -BEGIN_COM_MAP(CControlSite) - CCONTROLSITE_INTERFACES() -END_COM_MAP() - -BEGIN_OLECOMMAND_TABLE() -END_OLECOMMAND_TABLE() - - // List of controls - static std::list m_cControlList; - - // Helper method - static HRESULT ClassImplementsCategory(const CLSID &clsid, const CATID &catid); - - // Returns the window used when processing ole commands - HWND GetCommandTargetWindow() - { - return NULL; // TODO - } - -// Object creation and management functions - // Creates and initialises an object - virtual HRESULT Create(REFCLSID clsid, PropertyList &pl = PropertyList(), const tstring szName = _T("")); - // Attaches the object to the site - virtual HRESULT Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInitStream = NULL); - // Detaches the object from the site - virtual HRESULT Detach(); - // Returns the IUnknown pointer for the object - virtual HRESULT GetControlUnknown(IUnknown **ppObject); - // Sets the bounding rectangle for the object - virtual HRESULT SetPosition(const RECT &rcPos); - // Draws the object using the provided DC - virtual HRESULT Draw(HDC hdc); - // Performs the specified action on the object - virtual HRESULT DoVerb(LONG nVerb, LPMSG lpMsg = NULL); - // Sets an advise sink up for changes to the object - virtual HRESULT Advise(IUnknown *pIUnkSink, const IID &iid, DWORD *pdwCookie); - // Removes an advise sink - virtual HRESULT Unadvise(const IID &iid, DWORD dwCookie); - -// Methods to set ambient properties - virtual void SetAmbientUserMode(BOOL bUser); - -// Inline helper methods - // Returns the object's CLSID - virtual const CLSID &GetObjectCLSID() const - { - return m_clsid; - } - // Returns the name of the object - virtual const tstring &GetObjectName() const - { - return m_szName; - } - // Tests if the object is valid or not - virtual BOOL IsObjectValid() const - { - return (m_spObject) ? TRUE : FALSE; - } - // Returns the parent window to this one - virtual HWND GetParentWindow() const - { - return m_hWndParent; - } - // Returns the inplace active state of the object - virtual BOOL IsInPlaceActive() const - { - return m_bInPlaceActive; - } - -// IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo); - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr); - -// IAdviseSink implementation - virtual /* [local] */ void STDMETHODCALLTYPE OnDataChange(/* [unique][in] */ FORMATETC __RPC_FAR *pFormatetc, /* [unique][in] */ STGMEDIUM __RPC_FAR *pStgmed); - virtual /* [local] */ void STDMETHODCALLTYPE OnViewChange(/* [in] */ DWORD dwAspect, /* [in] */ LONG lindex); - virtual /* [local] */ void STDMETHODCALLTYPE OnRename(/* [in] */ IMoniker __RPC_FAR *pmk); - virtual /* [local] */ void STDMETHODCALLTYPE OnSave(void); - virtual /* [local] */ void STDMETHODCALLTYPE OnClose(void); - -// IAdviseSink2 - virtual /* [local] */ void STDMETHODCALLTYPE OnLinkSrcChange(/* [unique][in] */ IMoniker __RPC_FAR *pmk); - -// IAdviseSinkEx implementation - virtual /* [local] */ void STDMETHODCALLTYPE OnViewStatusChange(/* [in] */ DWORD dwViewStatus); - -// IOleWindow implementation - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode); - -// IOleClientSite implementation - virtual HRESULT STDMETHODCALLTYPE SaveObject(void); - virtual HRESULT STDMETHODCALLTYPE GetMoniker(/* [in] */ DWORD dwAssign, /* [in] */ DWORD dwWhichMoniker, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmk); - virtual HRESULT STDMETHODCALLTYPE GetContainer(/* [out] */ IOleContainer __RPC_FAR *__RPC_FAR *ppContainer); - virtual HRESULT STDMETHODCALLTYPE ShowObject(void); - virtual HRESULT STDMETHODCALLTYPE OnShowWindow(/* [in] */ BOOL fShow); - virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout(void); - -// IOleInPlaceSite implementation - virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate(void); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate(void); - virtual HRESULT STDMETHODCALLTYPE OnUIActivate(void); - virtual HRESULT STDMETHODCALLTYPE GetWindowContext(/* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, /* [out] */ LPRECT lprcPosRect, /* [out] */ LPRECT lprcClipRect, /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo); - virtual HRESULT STDMETHODCALLTYPE Scroll(/* [in] */ SIZE scrollExtant); - virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(/* [in] */ BOOL fUndoable); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate(void); - virtual HRESULT STDMETHODCALLTYPE DiscardUndoState(void); - virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo(void); - virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(/* [in] */ LPCRECT lprcPosRect); - -// IOleInPlaceSiteEx implementation - virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivateEx(/* [out] */ BOOL __RPC_FAR *pfNoRedraw, /* [in] */ DWORD dwFlags); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivateEx(/* [in] */ BOOL fNoRedraw); - virtual HRESULT STDMETHODCALLTYPE RequestUIActivate(void); - -// IOleInPlaceSiteWindowless implementation - virtual HRESULT STDMETHODCALLTYPE CanWindowlessActivate(void); - virtual HRESULT STDMETHODCALLTYPE GetCapture(void); - virtual HRESULT STDMETHODCALLTYPE SetCapture(/* [in] */ BOOL fCapture); - virtual HRESULT STDMETHODCALLTYPE GetFocus(void); - virtual HRESULT STDMETHODCALLTYPE SetFocus(/* [in] */ BOOL fFocus); - virtual HRESULT STDMETHODCALLTYPE GetDC(/* [in] */ LPCRECT pRect, /* [in] */ DWORD grfFlags, /* [out] */ HDC __RPC_FAR *phDC); - virtual HRESULT STDMETHODCALLTYPE ReleaseDC(/* [in] */ HDC hDC); - virtual HRESULT STDMETHODCALLTYPE InvalidateRect(/* [in] */ LPCRECT pRect, /* [in] */ BOOL fErase); - virtual HRESULT STDMETHODCALLTYPE InvalidateRgn(/* [in] */ HRGN hRGN, /* [in] */ BOOL fErase); - virtual HRESULT STDMETHODCALLTYPE ScrollRect(/* [in] */ INT dx, /* [in] */ INT dy, /* [in] */ LPCRECT pRectScroll, /* [in] */ LPCRECT pRectClip); - virtual HRESULT STDMETHODCALLTYPE AdjustRect(/* [out][in] */ LPRECT prc); - virtual HRESULT STDMETHODCALLTYPE OnDefWindowMessage(/* [in] */ UINT msg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam, /* [out] */ LRESULT __RPC_FAR *plResult); - -// IOleControlSite implementation - virtual HRESULT STDMETHODCALLTYPE OnControlInfoChanged(void); - virtual HRESULT STDMETHODCALLTYPE LockInPlaceActive(/* [in] */ BOOL fLock); - virtual HRESULT STDMETHODCALLTYPE GetExtendedControl(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE TransformCoords(/* [out][in] */ POINTL __RPC_FAR *pPtlHimetric, /* [out][in] */ POINTF __RPC_FAR *pPtfContainer, /* [in] */ DWORD dwFlags); - virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(/* [in] */ MSG __RPC_FAR *pMsg, /* [in] */ DWORD grfModifiers); - virtual HRESULT STDMETHODCALLTYPE OnFocus(/* [in] */ BOOL fGotFocus); - virtual HRESULT STDMETHODCALLTYPE ShowPropertyFrame( void); -}; - -typedef CComObject CControlSiteInstance; - - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.cpp b/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.cpp deleted file mode 100644 index 3fb2f1fa335..00000000000 --- a/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.cpp +++ /dev/null @@ -1,119 +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.org 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): - */ -#include "stdafx.h" - - -CControlSiteIPFrame::CControlSiteIPFrame() -{ - m_hwndFrame = NULL; -} - - -CControlSiteIPFrame::~CControlSiteIPFrame() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// IOleWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::GetWindow(/* [out] */ HWND __RPC_FAR *phwnd) -{ - if (phwnd == NULL) - { - return E_INVALIDARG; - } - *phwnd = m_hwndFrame; - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::ContextSensitiveHelp(/* [in] */ BOOL fEnterMode) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceUIWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::GetBorder(/* [out] */ LPRECT lprectBorder) -{ - return INPLACE_E_NOTOOLSPACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::RequestBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths) -{ - return INPLACE_E_NOTOOLSPACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetActiveObject(/* [unique][in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceFrame implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::InsertMenus(/* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetMenu(/* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::RemoveMenus(/* [in] */ HMENU hmenuShared) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetStatusText(/* [in] */ LPCOLESTR pszStatusText) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::EnableModeless(/* [in] */ BOOL fEnable) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::TranslateAccelerator(/* [in] */ LPMSG lpmsg, /* [in] */ WORD wID) -{ - return E_NOTIMPL; -} - diff --git a/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.h b/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.h deleted file mode 100644 index 13231f16d03..00000000000 --- a/mozilla/webshell/embed/ActiveX/ControlSiteIPFrame.h +++ /dev/null @@ -1,61 +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.org 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 CONTROLSITEIPFRAME_H -#define CONTROLSITEIPFRAME_H - -class CControlSiteIPFrame : public CComObjectRootEx, - public IOleInPlaceFrame -{ -public: - CControlSiteIPFrame(); - virtual ~CControlSiteIPFrame(); - - HWND m_hwndFrame; - -BEGIN_COM_MAP(CControlSiteIPFrame) - COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleInPlaceFrame) - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceUIWindow, IOleInPlaceFrame) - COM_INTERFACE_ENTRY(IOleInPlaceFrame) -END_COM_MAP() - - // IOleWindow - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode); - - // IOleInPlaceUIWindow implementation - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetBorder(/* [out] */ LPRECT lprectBorder); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE RequestBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths); - virtual HRESULT STDMETHODCALLTYPE SetActiveObject(/* [unique][in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName); - - // IOleInPlaceFrame implementation - virtual HRESULT STDMETHODCALLTYPE InsertMenus(/* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetMenu(/* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject); - virtual HRESULT STDMETHODCALLTYPE RemoveMenus(/* [in] */ HMENU hmenuShared); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetStatusText(/* [in] */ LPCOLESTR pszStatusText); - virtual HRESULT STDMETHODCALLTYPE EnableModeless(/* [in] */ BOOL fEnable); - virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(/* [in] */ LPMSG lpmsg, /* [in] */ WORD wID); -}; - -typedef CComObject CControlSiteIPFrameInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/DHTMLCmdIds.h b/mozilla/webshell/embed/ActiveX/DHTMLCmdIds.h deleted file mode 100644 index 6f686a1b664..00000000000 --- a/mozilla/webshell/embed/ActiveX/DHTMLCmdIds.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef DHTMLCMDIDS_H -#define DHTMLCMDIDS_H - -#ifndef __mshtmcid_h__ -#define IDM_UNKNOWN 0 -#define IDM_ALIGNBOTTOM 1 -#define IDM_ALIGNHORIZONTALCENTERS 2 -#define IDM_ALIGNLEFT 3 -#define IDM_ALIGNRIGHT 4 -#define IDM_ALIGNTOGRID 5 -#define IDM_ALIGNTOP 6 -#define IDM_ALIGNVERTICALCENTERS 7 -#define IDM_ARRANGEBOTTOM 8 -#define IDM_ARRANGERIGHT 9 -#define IDM_BRINGFORWARD 10 -#define IDM_BRINGTOFRONT 11 -#define IDM_CENTERHORIZONTALLY 12 -#define IDM_CENTERVERTICALLY 13 -#define IDM_CODE 14 -#define IDM_DELETE 17 -#define IDM_FONTNAME 18 -#define IDM_FONTSIZE 19 -#define IDM_GROUP 20 -#define IDM_HORIZSPACECONCATENATE 21 -#define IDM_HORIZSPACEDECREASE 22 -#define IDM_HORIZSPACEINCREASE 23 -#define IDM_HORIZSPACEMAKEEQUAL 24 -#define IDM_INSERTOBJECT 25 -#define IDM_MULTILEVELREDO 30 -#define IDM_SENDBACKWARD 32 -#define IDM_SENDTOBACK 33 -#define IDM_SHOWTABLE 34 -#define IDM_SIZETOCONTROL 35 -#define IDM_SIZETOCONTROLHEIGHT 36 -#define IDM_SIZETOCONTROLWIDTH 37 -#define IDM_SIZETOFIT 38 -#define IDM_SIZETOGRID 39 -#define IDM_SNAPTOGRID 40 -#define IDM_TABORDER 41 -#define IDM_TOOLBOX 42 -#define IDM_MULTILEVELUNDO 44 -#define IDM_UNGROUP 45 -#define IDM_VERTSPACECONCATENATE 46 -#define IDM_VERTSPACEDECREASE 47 -#define IDM_VERTSPACEINCREASE 48 -#define IDM_VERTSPACEMAKEEQUAL 49 -#define IDM_JUSTIFYFULL 50 -#define IDM_BACKCOLOR 51 -#define IDM_BOLD 52 -#define IDM_BORDERCOLOR 53 -#define IDM_FLAT 54 -#define IDM_FORECOLOR 55 -#define IDM_ITALIC 56 -#define IDM_JUSTIFYCENTER 57 -#define IDM_JUSTIFYGENERAL 58 -#define IDM_JUSTIFYLEFT 59 -#define IDM_JUSTIFYRIGHT 60 -#define IDM_RAISED 61 -#define IDM_SUNKEN 62 -#define IDM_UNDERLINE 63 -#define IDM_CHISELED 64 -#define IDM_ETCHED 65 -#define IDM_SHADOWED 66 -#define IDM_FIND 67 -#define IDM_SHOWGRID 69 -#define IDM_OBJECTVERBLIST0 72 -#define IDM_OBJECTVERBLIST1 73 -#define IDM_OBJECTVERBLIST2 74 -#define IDM_OBJECTVERBLIST3 75 -#define IDM_OBJECTVERBLIST4 76 -#define IDM_OBJECTVERBLIST5 77 -#define IDM_OBJECTVERBLIST6 78 -#define IDM_OBJECTVERBLIST7 79 -#define IDM_OBJECTVERBLIST8 80 -#define IDM_OBJECTVERBLIST9 81 -#define IDM_OBJECTVERBLISTLAST IDM_OBJECTVERBLIST9 -#define IDM_CONVERTOBJECT 82 -#define IDM_CUSTOMCONTROL 83 -#define IDM_CUSTOMIZEITEM 84 -#define IDM_RENAME 85 -#define IDM_IMPORT 86 -#define IDM_NEWPAGE 87 -#define IDM_MOVE 88 -#define IDM_CANCEL 89 -#define IDM_FONT 90 -#define IDM_STRIKETHROUGH 91 -#define IDM_DELETEWORD 92 -#define IDM_EXECPRINT 93 -#define IDM_JUSTIFYNONE 94 - -#define IDM_BROWSEMODE 2126 -#define IDM_EDITMODE 2127 - -#endif - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/DropTarget.cpp b/mozilla/webshell/embed/ActiveX/DropTarget.cpp deleted file mode 100644 index ef0c920d8bf..00000000000 --- a/mozilla/webshell/embed/ActiveX/DropTarget.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ - -#include "stdafx.h" - -#include -#include - -#include "DropTarget.h" - -#ifndef CFSTR_SHELLURL -#define CFSTR_SHELLURL _T("UniformResourceLocator") -#endif - -#ifndef CFSTR_FILENAME -#define CFSTR_FILENAME _T("FileName") -#endif - -#ifndef CFSTR_FILENAMEW -#define CFSTR_FILENAMEW _T("FileNameW") -#endif - -static const UINT g_cfURL = RegisterClipboardFormat(CFSTR_SHELLURL); -static const UINT g_cfFileName = RegisterClipboardFormat(CFSTR_FILENAME); -static const UINT g_cfFileNameW = RegisterClipboardFormat(CFSTR_FILENAMEW); - -CDropTarget::CDropTarget() -{ - m_pOwner = NULL; -} - - -CDropTarget::~CDropTarget() -{ -} - - -void CDropTarget::SetOwner(CMozillaBrowser *pOwner) -{ - m_pOwner = pOwner; -} - - -HRESULT CDropTarget::GetURLFromFile(const TCHAR *pszFile, tstring &szURL) -{ - USES_CONVERSION; - CIPtr(IUniformResourceLocator) spUrl; - - // Let's see if the file is an Internet Shortcut... - HRESULT hr = CoCreateInstance (CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (void **) &spUrl); - if (spUrl == NULL) - { - return E_FAIL; - } - - // Get the IPersistFile interface - CIPtr(IPersistFile) spFile = spUrl; - if (spFile == NULL) - { - return E_FAIL; - } - - // Initialise the URL object from the filename - LPSTR lpTemp = NULL; - if (FAILED(spFile->Load(T2OLE(pszFile), STGM_READ)) || - FAILED(spUrl->GetURL(&lpTemp))) - { - return E_FAIL; - } - - // Free the memory - CIPtr(IMalloc) spMalloc; - if (FAILED(SHGetMalloc(&spMalloc))) - { - return E_FAIL; - } - - // Copy the URL & cleanup - szURL = A2T(lpTemp); - spMalloc->Free(lpTemp); - - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// IDropTarget implementation - -HRESULT STDMETHODCALLTYPE CDropTarget::DragEnter(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL || pDataObj == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - if (m_spDataObject != NULL) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - // TODO process Internet Shortcuts (*.URL) files - FORMATETC formatetc; - memset(&formatetc, 0, sizeof(formatetc)); - formatetc.dwAspect = DVASPECT_CONTENT; - formatetc.lindex = -1; - formatetc.tymed = TYMED_HGLOBAL; - - // Test if the data object contains a text URL format - formatetc.cfFormat = g_cfURL; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // Test if the data object contains a file name - formatetc.cfFormat = g_cfFileName; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // Test if the data object contains a wide character file name - formatetc.cfFormat = g_cfFileName; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // If we got here, then the format is not supported - *pdwEffect = DROPEFFECT_NONE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::DragOver(/* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - *pdwEffect = m_spDataObject ? DROPEFFECT_LINK : DROPEFFECT_NONE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::DragLeave(void) -{ - if (m_spDataObject) - { - m_spDataObject.Release(); - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::Drop(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - if (m_spDataObject == NULL) - { - *pdwEffect = DROPEFFECT_NONE; - return S_OK; - } - - *pdwEffect = DROPEFFECT_LINK; - - // Get the URL from the data object - BSTR bstrURL = NULL; - FORMATETC formatetc; - STGMEDIUM stgmedium; - memset(&formatetc, 0, sizeof(formatetc)); - memset(&stgmedium, 0, sizeof(formatetc)); - - formatetc.dwAspect = DVASPECT_CONTENT; - formatetc.lindex = -1; - formatetc.tymed = TYMED_HGLOBAL; - - // Does the data object contain a URL? - formatetc.cfFormat = g_cfURL; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - char *pszURL = (char *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("URL \"%s\" dragged over control\n", pszURL); - // Browse to the URL - if (m_pOwner) - { - USES_CONVERSION; - bstrURL = SysAllocString(A2OLE(pszURL)); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - - // Does the data object point to a file? - formatetc.cfFormat = g_cfFileName; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - USES_CONVERSION; - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - tstring szURL; - char *pszURLFile = (char *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("File \"%s\" dragged over control\n", pszURLFile); - if (SUCCEEDED(GetURLFromFile(A2T(pszURLFile), szURL))) - { - bstrURL = SysAllocString(T2OLE(szURL.c_str())); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - - // Does the data object point to a wide character file? - formatetc.cfFormat = g_cfFileName; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - USES_CONVERSION; - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - tstring szURL; - WCHAR *pszURLFile = (WCHAR *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("File \"%s\" dragged over control\n", W2A(pszURLFile)); - if (SUCCEEDED(GetURLFromFile(W2T(pszURLFile), szURL))) - { - USES_CONVERSION; - bstrURL = SysAllocString(T2OLE(szURL.c_str())); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - -finish: - // If we got a URL, browse there! - if (bstrURL) - { - m_pOwner->Navigate(bstrURL, NULL, NULL, NULL, NULL); - SysFreeString(bstrURL); - } - - ReleaseStgMedium(&stgmedium); - m_spDataObject.Release(); - - return S_OK; -} - diff --git a/mozilla/webshell/embed/ActiveX/DropTarget.h b/mozilla/webshell/embed/ActiveX/DropTarget.h deleted file mode 100644 index aec6423187a..00000000000 --- a/mozilla/webshell/embed/ActiveX/DropTarget.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 DROPTARGET_H -#define DROPTARGET_H - -#include "MozillaBrowser.h" - -// Simple drop target implementation - -class CDropTarget : public CComObjectRootEx, - public IDropTarget -{ -public: - CDropTarget(); - virtual ~CDropTarget(); - -BEGIN_COM_MAP(CDropTarget) - COM_INTERFACE_ENTRY(IDropTarget) -END_COM_MAP() - - // Data object currently being dragged - CIPtr(IDataObject) m_spDataObject; - - // Owner of this object - CMozillaBrowser *m_pOwner; - - // Sets the owner of this object - void SetOwner(CMozillaBrowser *pOwner); - // Helper method to extract a URL from an internet shortcut file - HRESULT CDropTarget::GetURLFromFile(const TCHAR *pszFile, tstring &szURL); - -// IDropTarget - virtual HRESULT STDMETHODCALLTYPE DragEnter(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); - virtual HRESULT STDMETHODCALLTYPE DragOver(/* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); - virtual HRESULT STDMETHODCALLTYPE DragLeave(void); - virtual HRESULT STDMETHODCALLTYPE Drop(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); -}; - -typedef CComObject CDropTargetInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlDocument.cpp b/mozilla/webshell/embed/ActiveX/IEHtmlDocument.cpp deleted file mode 100644 index 2b7231ccf64..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlDocument.cpp +++ /dev/null @@ -1,810 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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): - */ -#include "stdafx.h" -#include "IEHtmlDocument.h" -#include "IEHtmlElementCollection.h" -#include "MozillaBrowser.h" - -#include - -CIEHtmlDocument::CIEHtmlDocument() -{ - m_pParent = NULL; -} - - -CIEHtmlDocument::~CIEHtmlDocument() -{ -} - - -void CIEHtmlDocument::SetParent(CMozillaBrowser *parent) -{ - m_pParent = parent; -} - - -HRESULT CIEHtmlDocument::GetIDispatch(IDispatch **pDispatch) -{ - if (pDispatch == NULL) - { - return E_INVALIDARG; - } - - IDispatch *pDisp = (IDispatch *) this; - NG_ASSERT(pDisp); - pDisp->AddRef(); - *pDispatch = pDisp; - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLDocument methods - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_Script(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLDocument2 methods - -struct HtmlPos -{ - CIPtr(IHTMLElementCollection) m_cpCollection; - long m_nPos; - - HtmlPos(IHTMLElementCollection *pCol, long nPos) : - m_cpCollection(pCol), - m_nPos(nPos) - { - } -}; - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_all(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - std::vector< CIPtr(IDispatch) > cNodeList; - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, (CIEHtmlElementCollection **) &pCollection, TRUE); - if (pCollection) - { - pCollection->AddRef(); - } - - *p = pCollection; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_body(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_activeElement(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_images(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_applets(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_links(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_forms(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_anchors(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_title(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_title(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_scripts(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_designMode(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_designMode(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_selection(IHTMLSelectionObject __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_readyState(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_frames(IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_embeds(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_plugins(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_alinkColor(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_alinkColor(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_bgColor(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_bgColor(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_fgColor(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fgColor(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_linkColor(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_linkColor(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_vlinkColor(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_vlinkColor(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_referrer(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_location(IHTMLLocation __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_lastModified(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_URL(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_URL(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_domain(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_domain(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_cookie(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_cookie(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_expando(VARIANT_BOOL v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_expando(VARIANT_BOOL __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_charset(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_charset(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_defaultCharset(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_defaultCharset(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_mimeType(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileSize(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileCreatedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileModifiedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileUpdatedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_security(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_protocol(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_nameProp(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::write(SAFEARRAY __RPC_FAR * psarray) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::writeln(SAFEARRAY __RPC_FAR * psarray) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::open(BSTR url, VARIANT name, VARIANT features, VARIANT replace, IDispatch __RPC_FAR *__RPC_FAR *pomWindowResult) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::close(void) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::clear(void) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::createElement(BSTR eTag, IHTMLElement __RPC_FAR *__RPC_FAR *newElem) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onhelp(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onhelp(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onclick(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_ondblclick(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_ondblclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeyup(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeyup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; - -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeydown(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeydown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeypress(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeypress(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseup(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmousedown(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmousedown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmousemove(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmousemove(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseout(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseout(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseover(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseover(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onreadystatechange(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onreadystatechange(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onafterupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onafterupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onrowexit(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onrowexit(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onrowenter(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onrowenter(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_ondragstart(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_ondragstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onselectstart(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onselectstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::elementFromPoint(long x, long y, IHTMLElement __RPC_FAR *__RPC_FAR *elementHit) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_parentWindow(IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_styleSheets(IHTMLStyleSheetsCollection __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onbeforeupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onbeforeupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onerrorupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onerrorupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::toString(BSTR __RPC_FAR *String) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::createStyleSheet(BSTR bstrHref, long lIndex, IHTMLStyleSheet __RPC_FAR *__RPC_FAR *ppnewStyleSheet) -{ - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleCommandTarget implementation - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText) -{ - HRESULT hr = E_NOTIMPL; - if(m_pParent) - { - hr = m_pParent->QueryStatus(pguidCmdGroup,cCmds,prgCmds,pCmdText); - } - return hr; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) -{ - HRESULT hr = E_NOTIMPL; - if(m_pParent) - { - hr = m_pParent->Exec(pguidCmdGroup,nCmdID,nCmdexecopt,pvaIn,pvaOut); - } - return hr; -} - diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlDocument.h b/mozilla/webshell/embed/ActiveX/IEHtmlDocument.h deleted file mode 100644 index 62e7df33db8..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlDocument.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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 IEHTMLDOCUMENT_H -#define IEHTMLDOCUMENT_H - -#include "IEHtmlNode.h" - -class CMozillaBrowser; - -class CIEHtmlDocument : public CIEHtmlNode, - public IDispatchImpl, - public IOleCommandTarget -{ -public: - CIEHtmlDocument(); -protected: - virtual ~CIEHtmlDocument(); - - // Pointer to browser that owns the document - CMozillaBrowser *m_pParent; -public: - virtual void SetParent(CMozillaBrowser *parent); - -BEGIN_COM_MAP(CIEHtmlDocument) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLDocument2) - COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument, IHTMLDocument2) - COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument2, IHTMLDocument2) - COM_INTERFACE_ENTRY(IOleCommandTarget) -END_COM_MAP() - - virtual HRESULT GetIDispatch(IDispatch **pDispatch); - - // IOleCommandTarget methods - virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText); - virtual HRESULT STDMETHODCALLTYPE Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut); - - // IHTMLDocument methods - virtual HRESULT STDMETHODCALLTYPE get_Script(IDispatch __RPC_FAR *__RPC_FAR *p); - - // IHTMLDocument2 methods - virtual HRESULT STDMETHODCALLTYPE get_all(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_body(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_activeElement(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_images(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_applets(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_links(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_forms(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_anchors(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_title(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_scripts(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_designMode(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_designMode(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_selection(IHTMLSelectionObject __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_readyState(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_frames(IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_embeds(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_plugins(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_alinkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_alinkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_bgColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_bgColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_fgColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_fgColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_linkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_linkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_vlinkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_vlinkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_referrer(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_location(IHTMLLocation __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_lastModified(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_URL(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_URL(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_domain(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_domain(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_cookie(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_cookie(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_expando(VARIANT_BOOL v); - virtual HRESULT STDMETHODCALLTYPE get_expando(VARIANT_BOOL __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_charset(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_charset(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_defaultCharset(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_defaultCharset(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_mimeType(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileSize(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileCreatedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileModifiedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileUpdatedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_security(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_protocol(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_nameProp(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE write(SAFEARRAY __RPC_FAR * psarray); - virtual HRESULT STDMETHODCALLTYPE writeln(SAFEARRAY __RPC_FAR * psarray); - virtual HRESULT STDMETHODCALLTYPE open(BSTR url, VARIANT name, VARIANT features, VARIANT replace, IDispatch __RPC_FAR *__RPC_FAR *pomWindowResult); - virtual HRESULT STDMETHODCALLTYPE close(void); - virtual HRESULT STDMETHODCALLTYPE clear(void); - virtual HRESULT STDMETHODCALLTYPE queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText); - virtual HRESULT STDMETHODCALLTYPE queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue); - virtual HRESULT STDMETHODCALLTYPE execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE createElement(BSTR eTag, IHTMLElement __RPC_FAR *__RPC_FAR *newElem); - virtual HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onreadystatechange(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onreadystatechange(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE elementFromPoint(long x, long y, IHTMLElement __RPC_FAR *__RPC_FAR *elementHit); - virtual HRESULT STDMETHODCALLTYPE get_parentWindow(IHTMLWindow2 __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_styleSheets(IHTMLStyleSheetsCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE createStyleSheet(BSTR bstrHref, long lIndex, IHTMLStyleSheet __RPC_FAR *__RPC_FAR *ppnewStyleSheet); -}; - -typedef CComObject CIEHtmlDocumentInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlElement.cpp b/mozilla/webshell/embed/ActiveX/IEHtmlElement.cpp deleted file mode 100644 index 8cec4cf5db5..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlElement.cpp +++ /dev/null @@ -1,688 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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): - */ - -#include "stdafx.h" - -#include "IEHtmlElement.h" -#include "IEHtmlElementCollection.h" - -CIEHtmlElement::CIEHtmlElement() -{ -} - - -CIEHtmlElement::~CIEHtmlElement() -{ -} - - -HRESULT CIEHtmlElement::GetIDispatch(IDispatch **pDispatch) -{ - if (pDispatch == NULL) - { - return E_INVALIDARG; - } - return QueryInterface(IID_IDispatch, (void **) pDispatch); -} - - -HRESULT CIEHtmlElement::GetChildren(CIEHtmlElementCollectionInstance **ppCollection) -{ - // Validate parameters - if (ppCollection == NULL) - { - return E_INVALIDARG; - } - - *ppCollection = NULL; - - // Create a collection representing the children of this node - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->AddRef(); - *ppCollection = pCollection; - } - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLElement implementation - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::setAttribute(BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - - // Get the name from the BSTR - USES_CONVERSION; - nsString szName = OLE2W(strAttributeName); - - // Get the value from the variant - CComVariant vValue; - if (FAILED(vValue.ChangeType(VT_BSTR, &AttributeValue))) - { - return E_INVALIDARG; - } - nsString szValue = OLE2W(vValue.bstrVal); - - nsIDOMElement *pIDOMElement = nsnull; - if (FAILED(GetDOMElement(&pIDOMElement))) - { - return E_UNEXPECTED; - } - - // Set the attribute - pIDOMElement->SetAttribute(szName, szValue); - pIDOMElement->Release(); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::getAttribute(BSTR strAttributeName, LONG lFlags, VARIANT __RPC_FAR *AttributeValue) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - if (AttributeValue == NULL) - { - return E_INVALIDARG; - } - VariantInit(AttributeValue); - - // Get the name from the BSTR - USES_CONVERSION; - nsString szName = OLE2W(strAttributeName); - - nsIDOMElement *pIDOMElement = nsnull; - if (FAILED(GetDOMElement(&pIDOMElement))) - { - return E_UNEXPECTED; - } - - BOOL bCaseSensitive = (lFlags == VARIANT_TRUE) ? TRUE : FALSE; - - nsString szValue; - - // Get the attribute - nsresult nr = pIDOMElement->GetAttribute(szName, szValue); - pIDOMElement->Release(); - - if (nr == NS_OK) - { - USES_CONVERSION; - AttributeValue->vt = VT_BSTR; - AttributeValue->bstrVal = SysAllocString(W2COLE(szValue.GetUnicode())); - return S_OK; - } - else - { - return S_FALSE; - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::removeAttribute(BSTR strAttributeName, LONG lFlags, VARIANT_BOOL __RPC_FAR *pfSuccess) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - - nsIDOMElement *pIDOMElement = nsnull; - if (FAILED(GetDOMElement(&pIDOMElement))) - { - return E_UNEXPECTED; - } - - BOOL bCaseSensitive = (lFlags == VARIANT_TRUE) ? TRUE : FALSE; - - // Get the name from the BSTR - USES_CONVERSION; - nsString szName = OLE2W(strAttributeName); - - // Remove the attribute - nsresult nr = pIDOMElement->RemoveAttribute(szName); - BOOL bRemoved = (nr == NS_OK) ? TRUE : FALSE; - pIDOMElement->Release(); - - if (pfSuccess) - { - *pfSuccess = (bRemoved) ? VARIANT_TRUE : VARIANT_FALSE; - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_className(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_className(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - VARIANT vValue; - VariantInit(&vValue); - BSTR bstrName = SysAllocString(OLESTR("class")); - getAttribute(bstrName, FALSE, &vValue); - SysFreeString(bstrName); - - *p = vValue.bstrVal; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_id(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_id(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - VARIANT vValue; - VariantInit(&vValue); - BSTR bstrName = SysAllocString(OLESTR("id")); - getAttribute(bstrName, FALSE, &vValue); - SysFreeString(bstrName); - - *p = vValue.bstrVal; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_tagName(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - nsIDOMElement *pIDOMElement = nsnull; - if (FAILED(GetDOMElement(&pIDOMElement))) - { - return E_UNEXPECTED; - } - - nsString szTagName; - pIDOMElement->GetTagName(szTagName); - pIDOMElement->Release(); - - USES_CONVERSION; - *p = SysAllocString(W2COLE(szTagName.GetUnicode())); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - if (m_pIDispParent) - { - m_pIDispParent->QueryInterface(IID_IHTMLElement, (void **) p); - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_style(IHTMLStyle __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onhelp(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onhelp(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onclick(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondblclick(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondblclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeydown(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeydown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeyup(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeyup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeypress(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeypress(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseout(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseout(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseover(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseover(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmousemove(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmousemove(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmousedown(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmousedown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseup(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_document(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_title(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_title(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_language(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_language(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onselectstart(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onselectstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::scrollIntoView(VARIANT varargStart) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::contains(IHTMLElement __RPC_FAR *pChild, VARIANT_BOOL __RPC_FAR *pfResult) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_sourceIndex(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_recordNumber(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_lang(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_lang(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetLeft(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetTop(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetWidth(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetHeight(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetParent(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_innerHTML(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerHTML(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_innerText(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerText(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_outerHTML(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_outerHTML(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_outerText(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_outerText(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::insertAdjacentHTML(BSTR where, BSTR html) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::insertAdjacentText(BSTR where, BSTR text) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_parentTextEdit(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_isTextEdit(VARIANT_BOOL __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::click(void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_filters(IHTMLFiltersCollection __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondragstart(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondragstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::toString(BSTR __RPC_FAR *String) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onbeforeupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onbeforeupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onafterupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onafterupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onerrorupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onerrorupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onrowexit(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onrowexit(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onrowenter(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onrowenter(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondatasetchanged(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondatasetchanged(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondataavailable(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondataavailable(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondatasetcomplete(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondatasetcomplete(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onfilterchange(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onfilterchange(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_children(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Create a collection representing the children of this node - CIEHtmlElementCollectionInstance *pCollection = NULL; - HRESULT hr = GetChildren(&pCollection); - if (SUCCEEDED(hr)) - { - *p = pCollection; - } - - return hr; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_all(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // TODO get ALL contained elements, not just the immediate children - - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->AddRef(); - *p = pCollection; - } - - return S_OK; -} - diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlElement.h b/mozilla/webshell/embed/ActiveX/IEHtmlElement.h deleted file mode 100644 index 5839067981c..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlElement.h +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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 IEHTMLELEMENT_H -#define IEHTMLELEMENT_H - -#include "IEHtmlNode.h" -#include "IEHtmlElementCollection.h" - -class CIEHtmlElement : public CIEHtmlNode, - public IDispatchImpl -{ -public: - CIEHtmlElement(); -protected: - virtual ~CIEHtmlElement(); - -public: - -BEGIN_COM_MAP(CIEHtmlElement) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLElement) - COM_INTERFACE_ENTRY_IID(IID_IHTMLElement, IHTMLElement) -END_COM_MAP() - - virtual HRESULT GetIDispatch(IDispatch **pDispatch); - virtual HRESULT GetChildren(CIEHtmlElementCollectionInstance **ppCollection); - - // Implementation of IHTMLElement - virtual HRESULT STDMETHODCALLTYPE setAttribute(BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags); - virtual HRESULT STDMETHODCALLTYPE getAttribute(BSTR strAttributeName, LONG lFlags, VARIANT __RPC_FAR *AttributeValue); - virtual HRESULT STDMETHODCALLTYPE removeAttribute(BSTR strAttributeName, LONG lFlags, VARIANT_BOOL __RPC_FAR *pfSuccess); - virtual HRESULT STDMETHODCALLTYPE put_className(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_className(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_id(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_id(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_tagName(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_style(IHTMLStyle __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_document(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_title(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_language(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_language(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE scrollIntoView(VARIANT varargStart); - virtual HRESULT STDMETHODCALLTYPE contains(IHTMLElement __RPC_FAR *pChild, VARIANT_BOOL __RPC_FAR *pfResult); - virtual HRESULT STDMETHODCALLTYPE get_sourceIndex(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_recordNumber(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_lang(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_lang(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetLeft(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetTop(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetWidth(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetHeight(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetParent(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_innerHTML(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_innerHTML(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_innerText(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_innerText(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_outerHTML(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_outerHTML(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_outerText(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_outerText(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE insertAdjacentHTML(BSTR where, BSTR html); - virtual HRESULT STDMETHODCALLTYPE insertAdjacentText(BSTR where, BSTR text); - virtual HRESULT STDMETHODCALLTYPE get_parentTextEdit(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_isTextEdit(VARIANT_BOOL __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE click(void); - virtual HRESULT STDMETHODCALLTYPE get_filters(IHTMLFiltersCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondatasetchanged(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondatasetchanged(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondataavailable(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondataavailable(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondatasetcomplete(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondatasetcomplete(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onfilterchange(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onfilterchange(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_children(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_all(IDispatch __RPC_FAR *__RPC_FAR *p); -}; - -#define CIEHTMLELEMENT_INTERFACES \ - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLElement) \ - COM_INTERFACE_ENTRY_IID(IID_IHTMLElement, IHTMLElement) - -typedef CComObject CIEHtmlElementInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.cpp b/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.cpp deleted file mode 100644 index ab6926bebb8..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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): - */ -#include "stdafx.h" - -#include - -#include "IEHtmlElement.h" -#include "IEHtmlElementCollection.h" - -CIEHtmlElementCollection::CIEHtmlElementCollection() -{ - m_pIDispParent = NULL; -} - -CIEHtmlElementCollection::~CIEHtmlElementCollection() -{ -} - -HRESULT CIEHtmlElementCollection::SetParentNode(IDispatch *pIDispParent) -{ - m_pIDispParent = pIDispParent; - return S_OK; -} - - -struct NodeListPos -{ - nsIDOMNodeList *m_pIDOMNodeList; - PRUint32 m_nListPos; - - NodeListPos(nsIDOMNodeList *pIDOMNodeList, PRUint32 nListPos) : - m_pIDOMNodeList(pIDOMNodeList), - m_nListPos(nListPos) - { - } - - NodeListPos() - { - }; -}; - - -HRESULT CIEHtmlElementCollection::PopulateFromDOMNode(nsIDOMNode *pIDOMNode, BOOL bRecurseChildren) -{ - if (pIDOMNode == nsnull) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - // Get elements from the DOM node - nsIDOMNodeList *pNodeList = nsnull; - pIDOMNode->GetChildNodes(&pNodeList); - if (pNodeList == nsnull) - { - return S_OK; - } - - // Recurse through the children of the node (and the children of that) - // to populate the collection - - std::stack< NodeListPos > cNodeStack; - cNodeStack.push(NodeListPos(pNodeList, 0)); - while (!cNodeStack.empty()) - { - // Pop an item from the stack - NodeListPos pos = cNodeStack.top(); - cNodeStack.pop(); - - // Iterate through items in list - PRUint32 aLength = 0; - pNodeList = pos.m_pIDOMNodeList; - pNodeList->GetLength(&aLength); - for (PRUint32 i = pos.m_nListPos; i < aLength; i++) - { - // Get the next item from the list - nsIDOMNode *pChildNode = nsnull; - pNodeList->Item(i, &pChildNode); - if (pChildNode == nsnull) - { - // Empty node (unexpected, but try and carry on anyway) - NG_ASSERT(0); - continue; - } - - // Create an equivalent IE element - CIEHtmlElementInstance *pElement = NULL; - CIEHtmlElementInstance::CreateInstance(&pElement); - if (pElement) - { - pElement->SetDOMNode(pChildNode); - pElement->SetParentNode(m_pIDispParent); - AddNode(pElement); - } - - if (bRecurseChildren) - { - // Test if the node has children and pop them onto the stack too - nsIDOMNodeList *pChildNodeList = nsnull; - pChildNode->GetChildNodes(&pChildNodeList); - if (pChildNodeList) - { - // Push the child collection onto the stack - cNodeStack.push(NodeListPos(pChildNodeList, 0)); - // Push the current position onto the stack ( if necessary ) - if (i + 1 < aLength) - { - pNodeList->AddRef(); - cNodeStack.push(NodeListPos(pNodeList, i + 1)); - } - break; - } - } - - // Cleanup for next iteration - pChildNode->Release(); - } - - // Cleanup for next iteration - pNodeList->Release(); - } - - return S_OK; -} - - -HRESULT CIEHtmlElementCollection::CreateFromParentNode(CIEHtmlNode *pParentNode, CIEHtmlElementCollection **pInstance, BOOL bRecurseChildren) -{ - if (pInstance == NULL || pParentNode == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - // Get the DOM node from the parent node - nsIDOMNode *pIDOMNode = nsnull; - pParentNode->GetDOMNode(&pIDOMNode); - if (pIDOMNode == nsnull) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - *pInstance = NULL; - - // Create a collection object - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - NG_ASSERT(0); - return E_OUTOFMEMORY; - } - - // Initialise and populate the collection - CIPtr(IDispatch) cpDispNode; - pParentNode->GetIDispatch(&cpDispNode); - pCollection->SetParentNode(cpDispNode); - pCollection->PopulateFromDOMNode(pIDOMNode, bRecurseChildren); - - pIDOMNode->Release(); - - *pInstance = pCollection; - - return S_OK; -} - - -HRESULT CIEHtmlElementCollection::AddNode(IDispatch *pNode) -{ - if (pNode == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - m_cNodeList.push_back(pNode); - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLElementCollection methods - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::toString(BSTR __RPC_FAR *String) -{ - if (String == NULL) - { - return E_INVALIDARG; - } - *String = SysAllocString(OLESTR("ElementCollection")); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::put_length(long v) -{ - // What is the point of this method? - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::get_length(long __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - // Return the size of the collection - *p = m_cNodeList.size(); - return S_OK; -} - -typedef CComObject > > CComEnumVARIANT; - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::get__newEnum(IUnknown __RPC_FAR *__RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Create a new IEnumVARIANT object - CComEnumVARIANT *pEnumVARIANT = NULL; - CComEnumVARIANT::CreateInstance(&pEnumVARIANT); - if (pEnumVARIANT == NULL) - { - NG_ASSERT(0); - return E_OUTOFMEMORY; - } - - int nObject; - int nObjects = m_cNodeList.size(); - - // Create an array of VARIANTs - VARIANT *avObjects = new VARIANT[nObjects]; - if (avObjects == NULL) - { - NG_ASSERT(0); - return E_OUTOFMEMORY; - } - - // Copy the contents of the collection to the array - for (nObject = 0; nObject < nObjects; nObject++) - { - VARIANT *pVariant = &avObjects[nObject]; - IUnknown *pUnkObject = m_cNodeList[nObject]; - VariantInit(pVariant); - pVariant->vt = VT_UNKNOWN; - pVariant->punkVal = pUnkObject; - pUnkObject->AddRef(); - } - - // Copy the variants to the enumeration object - pEnumVARIANT->Init(&avObjects[0], &avObjects[nObjects], NULL, AtlFlagCopy); - - // Cleanup the array - for (nObject = 0; nObject < nObjects; nObject++) - { - VARIANT *pVariant = &avObjects[nObject]; - VariantClear(pVariant); - } - delete []avObjects; - - return pEnumVARIANT->QueryInterface(IID_IUnknown, (void**) p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::item(VARIANT name, VARIANT index, IDispatch __RPC_FAR *__RPC_FAR *pdisp) -{ - if (pdisp == NULL) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - - // Note: parameter "name" contains the index unless its a string - // in which case index does. Sensible huh? - - CComVariant vIndex; - if (SUCCEEDED(vIndex.ChangeType(VT_I4, &name)) || - SUCCEEDED(vIndex.ChangeType(VT_I4, &index))) - { - // Test for stupid values - int nIndex = vIndex.lVal; - if (nIndex < 0 || nIndex >= m_cNodeList.size()) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - IDispatch *pNode = m_cNodeList[nIndex]; - if (pNode == NULL) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - pNode->QueryInterface(IID_IDispatch, (void **) pdisp); - return S_OK; - } - else if (SUCCEEDED(vIndex.ChangeType(VT_BSTR, &index))) - { - // If this parameter contains a string, the method returns - // a collection of objects, where the value of the name or - // id property for each object is equal to the string. - - // TODO all of the above! - return E_NOTIMPL; - } - else - { - return E_INVALIDARG; - } -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::tags(VARIANT tagName, IDispatch __RPC_FAR *__RPC_FAR *pdisp) -{ - if (pdisp == NULL) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - - // TODO - // iterate through collection looking for elements with matching tags - - return E_NOTIMPL; -} - diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.h b/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.h deleted file mode 100644 index f6de7a4f23d..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlElementCollection.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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 IEHTMLNODECOLLECTION_H -#define IEHTMLNODECOLLECTION_H - -#include "IEHtmlNode.h" - -class CIEHtmlElement; - - - -class CIEHtmlElementCollection : public CComObjectRootEx, - public IDispatchImpl -{ -public: - typedef std::vector< CIPtr(IDispatch) > ElementList; - -private: - ElementList m_cNodeList; - -public: - CIEHtmlElementCollection(); - -protected: - virtual ~CIEHtmlElementCollection(); - - // Pointer to parent node/document - IDispatch *m_pIDispParent; - -public: - // Adds a node to the collection - virtual HRESULT AddNode(IDispatch *pNode); - - // Sets the parent node of this collection - virtual HRESULT SetParentNode(IDispatch *pIDispParent); - - // Populates the collection with items from the DOM node - virtual HRESULT PopulateFromDOMNode(nsIDOMNode *pIDOMNode, BOOL bRecurseChildren); - - // Helper method creates a collection from a parent node - static HRESULT CreateFromParentNode(CIEHtmlNode *pParentNode, CIEHtmlElementCollection **pInstance, BOOL bRecurseChildren = FALSE); - - - ElementList &GetElements() - { - return m_cNodeList; - } - -BEGIN_COM_MAP(CIEHtmlElementCollection) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLElementCollection) - COM_INTERFACE_ENTRY_IID(IID_IHTMLElementCollection, IHTMLElementCollection) -END_COM_MAP() - - // IHTMLElementCollection methods - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE put_length(long v); - virtual HRESULT STDMETHODCALLTYPE get_length(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get__newEnum(IUnknown __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE item(VARIANT name, VARIANT index, IDispatch __RPC_FAR *__RPC_FAR *pdisp); - virtual HRESULT STDMETHODCALLTYPE tags(VARIANT tagName, IDispatch __RPC_FAR *__RPC_FAR *pdisp); -}; - -typedef CComObject CIEHtmlElementCollectionInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlNode.cpp b/mozilla/webshell/embed/ActiveX/IEHtmlNode.cpp deleted file mode 100644 index ace3d0aef8d..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlNode.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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): - */ -#include "stdafx.h" -#include "IEHtmlNode.h" - -CIEHtmlNode::CIEHtmlNode() -{ - m_pIDOMNode = nsnull; - m_pIDispParent = NULL; -} - -CIEHtmlNode::~CIEHtmlNode() -{ - SetDOMNode(nsnull); -} - -HRESULT CIEHtmlNode::SetParentNode(IDispatch *pIDispParent) -{ - m_pIDispParent = pIDispParent; - return S_OK; -} - -HRESULT CIEHtmlNode::SetDOMNode(nsIDOMNode *pIDOMNode) -{ - if (m_pIDOMNode) - { - m_pIDOMNode->Release(); - m_pIDOMNode = nsnull; - } - - if (pIDOMNode) - { - m_pIDOMNode = pIDOMNode; - m_pIDOMNode->AddRef(); - } - - return S_OK; -} - -HRESULT CIEHtmlNode::GetDOMNode(nsIDOMNode **pIDOMNode) -{ - if (pIDOMNode == NULL) - { - return E_INVALIDARG; - } - - *pIDOMNode = nsnull; - if (m_pIDOMNode) - { - m_pIDOMNode->AddRef(); - *pIDOMNode = m_pIDOMNode; - } - - return S_OK; -} - -HRESULT CIEHtmlNode::GetDOMElement(nsIDOMElement **pIDOMElement) -{ - if (pIDOMElement == NULL) - { - return E_INVALIDARG; - } - - if (m_pIDOMNode == nsnull) - { - return E_NOINTERFACE; - } - - *pIDOMElement = nsnull; - m_pIDOMNode->QueryInterface(kIDOMElementIID, (void **) pIDOMElement); - return (*pIDOMElement) ? S_OK : E_NOINTERFACE; -} - -HRESULT CIEHtmlNode::GetIDispatch(IDispatch **pDispatch) -{ - if (pDispatch == NULL) - { - return E_INVALIDARG; - } - - *pDispatch = NULL; - return E_NOINTERFACE; -} diff --git a/mozilla/webshell/embed/ActiveX/IEHtmlNode.h b/mozilla/webshell/embed/ActiveX/IEHtmlNode.h deleted file mode 100644 index f94c2e2abd4..00000000000 --- a/mozilla/webshell/embed/ActiveX/IEHtmlNode.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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.org 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 IEHTMLNODE_H -#define IEHTMLNODE_H - -class CIEHtmlNode : public CComObjectRootEx -{ -protected: - nsIDOMNode *m_pIDOMNode; - IDispatch *m_pIDispParent; - -public: - CIEHtmlNode(); -protected: - virtual ~CIEHtmlNode(); - -public: - virtual HRESULT SetDOMNode(nsIDOMNode *pIDOMNode); - virtual HRESULT GetDOMNode(nsIDOMNode **pIDOMNode); - virtual HRESULT GetDOMElement(nsIDOMElement **pIDOMElement); - virtual HRESULT SetParentNode(IDispatch *pIDispParent); - virtual HRESULT GetIDispatch(IDispatch **pDispatch); -}; - -typedef CComObject CIEHtmlNodeInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/IOleCommandTargetImpl.h b/mozilla/webshell/embed/ActiveX/IOleCommandTargetImpl.h deleted file mode 100644 index f927478125d..00000000000 --- a/mozilla/webshell/embed/ActiveX/IOleCommandTargetImpl.h +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 IOLECOMMANDIMPL_H -#define IOLECOMMANDIMPL_H - -// Implementation of the IOleCommandTarget interface. The template is -// reasonably generic and reusable which is a good thing given how needlessly -// complicated this interface is. Blame Microsoft for that and not me. -// -// To use this class, derive your class from it like this: -// -// class CComMyClass : public IOleCommandTargetImpl -// { -// ... Ensure IOleCommandTarget is listed in the interface map ... -// BEGIN_COM_MAP(CComMyClass) -// COM_INTERFACE_ENTRY(IOleCommandTarget) -// // etc. -// END_COM_MAP() -// ... And then later on define the command target table ... -// BEGIN_OLECOMMAND_TABLE() -// OLECOMMAND_MESSAGE(OLECMDID_PRINT, NULL, ID_PRINT, L"Print", L"Print the page") -// OLECOMMAND_MESSAGE(OLECMDID_SAVEAS, NULL, 0, L"SaveAs", L"Save the page") -// OLECOMMAND_HANDLER(IDM_EDITMODE, &CGID_MSHTML, EditModeHandler, L"EditMode", L"Switch to edit mode") -// END_OLECOMMAND_TABLE() -// ... Now the window that OLECOMMAND_MESSAGE sends WM_COMMANDs to ... -// HWND GetCommandTargetWindow() const -// { -// return m_hWnd; -// } -// ... Now procedures that OLECOMMAND_HANDLER calls ... -// static HRESULT _stdcall EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); -// } -// -// The command table defines which commands the object supports. Commands are -// defined by a command id and a command group plus a WM_COMMAND id or procedure, -// and a verb and short description. -// -// Notice that there are two macros for handling Ole Commands. The first, -// OLECOMMAND_MESSAGE sends a WM_COMMAND message to the window returned from -// GetCommandTargetWindow() (that the derived class must implement if it uses -// this macro). -// -// The second, OLECOMMAND_HANDLER calls a static handler procedure that -// conforms to the OleCommandProc typedef. The first parameter, pThis means -// the static handler has access to the methods and variables in the class -// instance. -// -// The OLECOMMAND_HANDLER macro is generally more useful when a command -// takes parameters or needs to return a result to the caller. -// -template< class T > -class IOleCommandTargetImpl : public IOleCommandTarget -{ - struct OleExecData - { - const GUID *pguidCmdGroup; - DWORD nCmdID; - DWORD nCmdexecopt; - VARIANT *pvaIn; - VARIANT *pvaOut; - }; - -public: - typedef HRESULT (_stdcall *OleCommandProc)(T *pT, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - - struct OleCommandInfo - { - ULONG nCmdID; - const GUID *pCmdGUID; - ULONG nWindowsCmdID; - OleCommandProc pfnCommandProc; - wchar_t *szVerbText; - wchar_t *szStatusText; - }; - - // Query the status of the specified commands (test if is it supported etc.) - virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText) - { - T* pT = static_cast(this); - - if (prgCmds == NULL) - { - return E_INVALIDARG; - } - - OleCommandInfo *pCommands = pT->GetCommandTable(); - NG_ASSERT(pCommands); - - BOOL bCmdGroupFound = FALSE; - BOOL bTextSet = FALSE; - - // Iterate through list of commands and flag them as supported/unsupported - for (ULONG nCmd = 0; nCmd < cCmds; nCmd++) - { - // Unsupported by default - prgCmds[nCmd].cmdf = 0; - - // Search the support command list - for (int nSupported = 0; pCommands[nSupported].pCmdGUID != &GUID_NULL; nSupported++) - { - OleCommandInfo *pCI = &pCommands[nSupported]; - - if (pguidCmdGroup && pCI->pCmdGUID && memcmp(pguidCmdGroup, pCI->pCmdGUID, sizeof(GUID)) == 0) - { - continue; - } - bCmdGroupFound = TRUE; - - if (pCI->nCmdID != prgCmds[nCmd].cmdID) - { - continue; - } - - // Command is supported so flag it and possibly enable it - prgCmds[nCmd].cmdf = OLECMDF_SUPPORTED; - if (pCI->nWindowsCmdID != 0) - { - prgCmds[nCmd].cmdf |= OLECMDF_ENABLED; - } - - // Copy the status/verb text for the first supported command only - if (!bTextSet && pCmdText) - { - // See what text the caller wants - wchar_t *pszTextToCopy = NULL; - if (pCmdText->cmdtextf & OLECMDTEXTF_NAME) - { - pszTextToCopy = pCI->szVerbText; - } - else if (pCmdText->cmdtextf & OLECMDTEXTF_STATUS) - { - pszTextToCopy = pCI->szStatusText; - } - - // Copy the text - pCmdText->cwActual = 0; - memset(pCmdText->rgwz, 0, pCmdText->cwBuf * sizeof(wchar_t)); - if (pszTextToCopy) - { - // Don't exceed the provided buffer size - int nTextLen = wcslen(pszTextToCopy); - if (nTextLen > pCmdText->cwBuf) - { - nTextLen = pCmdText->cwBuf; - } - - wcsncpy(pCmdText->rgwz, pszTextToCopy, nTextLen); - pCmdText->cwActual = nTextLen; - } - - bTextSet = TRUE; - } - break; - } - } - - // Was the command group found? - if (!bCmdGroupFound) - { - OLECMDERR_E_UNKNOWNGROUP; - } - - return S_OK; - } - - - // Execute the specified command - virtual HRESULT STDMETHODCALLTYPE Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) - { - T* pT = static_cast(this); - BOOL bCmdGroupFound = FALSE; - - OleCommandInfo *pCommands = pT->GetCommandTable(); - NG_ASSERT(pCommands); - - // Search the support command list - for (int nSupported = 0; pCommands[nSupported].pCmdGUID != &GUID_NULL; nSupported++) - { - OleCommandInfo *pCI = &pCommands[nSupported]; - - if (pguidCmdGroup && pCI->pCmdGUID && memcmp(pguidCmdGroup, pCI->pCmdGUID, sizeof(GUID)) == 0) - { - continue; - } - bCmdGroupFound = TRUE; - - if (pCI->nCmdID != nCmdID) - { - continue; - } - - // Send ourselves a WM_COMMAND windows message with the associated - // identifier and exec data - OleExecData cData; - cData.pguidCmdGroup = pguidCmdGroup; - cData.nCmdID = nCmdID; - cData.nCmdexecopt = nCmdexecopt; - cData.pvaIn = pvaIn; - cData.pvaOut = pvaOut; - - if (pCI->pfnCommandProc) - { - pCI->pfnCommandProc(pT, pCI->pCmdGUID, pCI->nCmdID, nCmdexecopt, pvaIn, pvaOut); - } - else if (pCI->nWindowsCmdID != 0) - { - HWND hwndTarget = pT->GetCommandTargetWindow(); - if (hwndTarget) - { - ::SendMessage(hwndTarget, WM_COMMAND, LOWORD(pCI->nWindowsCmdID), (LPARAM) &cData); - } - } - else - { - // Command supported but not implemented - continue; - } - - return S_OK; - } - - // Was the command group found? - if (!bCmdGroupFound) - { - OLECMDERR_E_UNKNOWNGROUP; - } - - return OLECMDERR_E_NOTSUPPORTED; - } -}; - -// Macros to be placed in any class derived from the IOleCommandTargetImpl -// class. These define what commands are exposed from the object. - -#define BEGIN_OLECOMMAND_TABLE() \ - OleCommandInfo *GetCommandTable() \ - { \ - static OleCommandInfo s_aSupportedCommands[] = \ - { - -#define OLECOMMAND_MESSAGE(id, group, cmd, verb, desc) \ - { id, group, cmd, NULL, verb, desc }, - -#define OLECOMMAND_HANDLER(id, group, handler, verb, desc) \ - { id, group, 0, handler, verb, desc }, - -#define END_OLECOMMAND_TABLE() \ - { 0, &GUID_NULL, 0, NULL, NULL, NULL } \ - }; \ - return s_aSupportedCommands; \ - }; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/ItemContainer.cpp b/mozilla/webshell/embed/ActiveX/ItemContainer.cpp deleted file mode 100644 index 30db10f20ec..00000000000 --- a/mozilla/webshell/embed/ActiveX/ItemContainer.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ - -#include "stdafx.h" - -CItemContainer::CItemContainer() -{ -} - -CItemContainer::~CItemContainer() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// IParseDisplayName implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::ParseDisplayName(/* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ LPOLESTR pszDisplayName, /* [out] */ ULONG __RPC_FAR *pchEaten, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkOut) -{ - // TODO - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleContainer implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::EnumObjects(/* [in] */ DWORD grfFlags, /* [out] */ IEnumUnknown __RPC_FAR *__RPC_FAR *ppenum) -{ - HRESULT hr = E_NOTIMPL; -/* - if (ppenum == NULL) - { - return E_POINTER; - } - - *ppenum = NULL; - typedef CComObject, CNamedObjectList > > enumunk; - enumunk* p = NULL; - p = new enumunk; - if(p == NULL) - { - return E_OUTOFMEMORY; - } - - hr = p->Init(); - if (SUCCEEDED(hr)) - { - hr = p->QueryInterface(IID_IEnumUnknown, (void**) ppenum); - } - if (FAILED(hRes)) - { - delete p; - } -*/ - return hr; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::LockContainer(/* [in] */ BOOL fLock) -{ - // TODO - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleItemContainer implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::GetObject(/* [in] */ LPOLESTR pszItem, /* [in] */ DWORD dwSpeedNeeded, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) -{ - if (pszItem == NULL) - { - return E_INVALIDARG; - } - if (ppvObject == NULL) - { - return E_INVALIDARG; - } - - *ppvObject = NULL; - - return MK_E_NOOBJECT; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::GetObjectStorage(/* [in] */ LPOLESTR pszItem, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvStorage) -{ - // TODO - return MK_E_NOOBJECT; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::IsRunning(/* [in] */ LPOLESTR pszItem) -{ - // TODO - return MK_E_NOOBJECT; -} diff --git a/mozilla/webshell/embed/ActiveX/ItemContainer.h b/mozilla/webshell/embed/ActiveX/ItemContainer.h deleted file mode 100644 index 01d7dd6b1f7..00000000000 --- a/mozilla/webshell/embed/ActiveX/ItemContainer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 ITEMCONTAINER_H -#define ITEMCONTAINER_H - -// Class for managing a list of named objects. - -class CItemContainer : public CComObjectRootEx, - public IOleItemContainer -{ - // List of all named objects managed by the container - CNamedObjectList m_cObjectList; -public: - - CItemContainer(); - virtual ~CItemContainer(); - -BEGIN_COM_MAP(CItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IParseDisplayName, IOleItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IOleContainer, IOleItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IOleItemContainer, IOleItemContainer) -END_COM_MAP() - - // IParseDisplayName implementation - virtual HRESULT STDMETHODCALLTYPE ParseDisplayName(/* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ LPOLESTR pszDisplayName, /* [out] */ ULONG __RPC_FAR *pchEaten, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkOut); - - // IOleContainer implementation - virtual HRESULT STDMETHODCALLTYPE EnumObjects(/* [in] */ DWORD grfFlags, /* [out] */ IEnumUnknown __RPC_FAR *__RPC_FAR *ppenum); - virtual HRESULT STDMETHODCALLTYPE LockContainer(/* [in] */ BOOL fLock); - - // IOleItemContainer implementation - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetObject(/* [in] */ LPOLESTR pszItem, /* [in] */ DWORD dwSpeedNeeded, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetObjectStorage(/* [in] */ LPOLESTR pszItem, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvStorage); - virtual HRESULT STDMETHODCALLTYPE IsRunning(/* [in] */ LPOLESTR pszItem); -}; - -typedef CComObject CItemContainerInstance; - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/LegacyPlugin.cpp b/mozilla/webshell/embed/ActiveX/LegacyPlugin.cpp deleted file mode 100644 index 5bdef357287..00000000000 --- a/mozilla/webshell/embed/ActiveX/LegacyPlugin.cpp +++ /dev/null @@ -1,567 +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.org 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): - */ -#include "stdafx.h" - -// Plugin types supported -enum PluginInstanceType -{ - itScript, - itControl -}; - -// Data associated with a plugin instance -struct PluginInstanceData { - PluginInstanceType nType; - union - { - CActiveScriptSiteInstance *pScriptSite; - CControlSiteInstance *pControlSite; - }; -}; - - -// NPP_Initialize -// -// Initialize the plugin library. Your DLL global initialization -// should be here -// -NPError NPP_Initialize(void) -{ - NG_TRACE_METHOD(NPP_Initialize); - _Module.Lock(); - return NPERR_NO_ERROR; -} - - -// NPP_Shutdown -// -// shutdown the plugin library. Revert initializition -// -void NPP_Shutdown(void) -{ - NG_TRACE_METHOD(NPP_Shutdown); - _Module.Unlock(); -} - - -// npp_GetJavaClass -// -// Return the Java class representing this plugin -// -jref NPP_GetJavaClass(void) -{ - NG_TRACE_METHOD(NPP_GetJavaClass); - - //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. - // get the Java environment. You need this information pretty much for - // any jri (Java Runtime Interface) call. -// JRIEnv* env = NPN_GetJavaEnv(); - //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. - // init any classes that define native methods, or whose methods we - // are going to use. - // The following functions are generated by javah running on the java - // class(es) representing this plugin. javah generates the files - // .h and .c (same for any additional - // class you may want to use) - // Return the main java class representing this plugin (derives from - // Plugin class on the java side) -// use_netscape_plugin_Plugin(env); -// use_AviObserver(env); -// return (jref)use_AviPlayer(env); - // if no java is used - return NULL; -} - - -#define MIME_OLEOBJECT1 "application/x-oleobject" -#define MIME_OLEOBJECT2 "application/oleobject" -#define MIME_ACTIVESCRIPT "text/x-activescript" - - -NPError NewScript(const char *pluginType, - PluginInstanceData *pData, - uint16 mode, - int16 argc, - char *argn[], - char *argv[]) -{ - CActiveScriptSiteInstance *pScriptSite = NULL; - CActiveScriptSiteInstance::CreateInstance(&pScriptSite); - - // TODO support ActiveScript - MessageBox(NULL, _T("ActiveScript not supported yet!"), NULL, MB_OK); - return NPERR_GENERIC_ERROR; -} - -NPError NewControl(const char *pluginType, - PluginInstanceData *pData, - uint16 mode, - int16 argc, - char *argn[], - char *argv[]) -{ - // Read the parameters - CLSID clsid = CLSID_NULL; - tstring szName; - tstring szCodebase; - PropertyList pl; - - for (int16 i = 0; i < argc; i++) - { - if (stricmp(argn[i], "CLSID") == 0 || - stricmp(argn[i], "CLASSID") == 0) - { - // Accept CLSIDs specified in various ways - // e.g: - // "CLSID:C16DF970-D1BA-11d2-A252-000000000000" - // "C16DF970-D1BA-11d2-A252-000000000000" - // "{C16DF970-D1BA-11d2-A252-000000000000}" - // - // The first example is the proper way - - char szCLSID[256]; - if (strnicmp(argv[i], "CLSID:", 6) == 0) - { - char szTmp[256]; - sscanf(argv[i], "CLSID:%s", szTmp); - sprintf(szCLSID, "{%s}", szTmp); - } - else if(argv[i][0] != '{') - { - sprintf(szCLSID, "{%s}", argv[i]); - } - else - { - strncpy(szCLSID, argv[i], sizeof(szCLSID)); - } - - USES_CONVERSION; - CLSIDFromString(A2OLE(szCLSID), &clsid); - } - else if (stricmp(argn[i], "NAME") == 0) - { - USES_CONVERSION; - szName = tstring(A2T(argv[i])); - } - else if (stricmp(argn[i], "CODEBASE") == 0) - { - szCodebase = tstring(A2T(argv[i])); - } - else if (strnicmp(argn[i], "PARAM_", 6) == 0) - { - USES_CONVERSION; - - std::wstring szName(A2W(argn[i] + 6)); - std::wstring szParam(A2W(argv[i])); - - // Empty parameters are ignored - if (szName.empty()) - { - continue; - } - - // Check for existing params with the same name - BOOL bFound = FALSE; - for (PropertyList::const_iterator i = pl.begin(); i != pl.end(); i++) - { - if (wcscmp((BSTR) (*i).szName, szName.c_str()) == 0) - { - bFound = TRUE; - break; - } - } - // If the parameter already exists, don't add it to the - // list again. - if (bFound) - { - continue; - } - - CComVariant vsValue(szParam.c_str()); - CComVariant vIValue; // Value converted to int - CComVariant vRValue; // Value converted to real - CComVariant &vValue = vsValue; - - // See if the variant can be converted to an integer - if (VariantChangeType(&vIValue, &vsValue, 0, VT_I4) == S_OK) - { - vValue = vIValue; - } - else if (VariantChangeType(&vRValue, &vsValue, 0, VT_R8) == S_OK) - { - vValue = vRValue; - } - - // Add named parameter to list - Property p; - p.szName = szName.c_str(); - p.vValue = vValue; - pl.push_back(p); - } - } - - - // Create the control site - CControlSiteInstance *pSite = NULL; - CControlSiteInstance::CreateInstance(&pSite); - if (pSite == NULL) - { - return NPERR_GENERIC_ERROR; - } - pSite->AddRef(); - - // TODO check the object is installed and at least as recent as - // that specified in szCodebase - - // Create the object - if (FAILED(pSite->Create(clsid, pl, szName))) - { - USES_CONVERSION; - LPOLESTR szClsid; - StringFromCLSID(clsid, &szClsid); - TCHAR szBuffer[256]; - _stprintf(szBuffer, _T("Could not create the control %s. Check that it has been installed on your computer and that this page correctly references it."), OLE2T(szClsid)); - MessageBox(NULL, szBuffer, _T("ActiveX Error"), MB_OK | MB_ICONWARNING); - CoTaskMemFree(szClsid); - - pSite->Release(); - return NPERR_GENERIC_ERROR; - } - - pData->nType = itControl; - pData->pControlSite = pSite; - - return NPERR_NO_ERROR; -} - - -// NPP_New -// -// create a new plugin instance -// handle any instance specific code initialization here -// -NPError NP_LOADDS NPP_New(NPMIMEType pluginType, - NPP instance, - uint16 mode, - int16 argc, - char* argn[], - char* argv[], - NPSavedData* saved) -{ - NG_TRACE_METHOD(NPP_New); - - // trap duff args - if (instance == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - PluginInstanceData *pData = new PluginInstanceData; - if (pData == NULL) - { - return NPERR_GENERIC_ERROR; - } - - // Create a plugin according to the mime type - - NPError rv = NPERR_GENERIC_ERROR; - if (strcmp(pluginType, MIME_ACTIVESCRIPT) == 0) - { - rv = NewScript(pluginType, pData, mode, argc, argn, argv); - } - else if (strcmp(pluginType, MIME_OLEOBJECT1) == 0 || - strcmp(pluginType, MIME_OLEOBJECT2) == 0) - { - rv = NewControl(pluginType, pData, mode, argc, argn, argv); - } - else - { - // Unknown MIME type - } - - // Test if plugin creation has succeeded and cleanup if it hasn't - if (rv != NPERR_NO_ERROR) - { - delete pData; - return rv; - } - - instance->pdata = pData; - - return NPERR_NO_ERROR; -} - - -// NPP_Destroy -// -// Deletes a plug-in instance and releases all of its resources. -// -NPError NP_LOADDS -NPP_Destroy(NPP instance, NPSavedData** save) -{ - NG_TRACE_METHOD(NPP_Destroy); - - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (pData == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - if (pData->nType == itControl) - { - // Destroy the site - CControlSiteInstance *pSite = pData->pControlSite; - if (pSite) - { - pSite->Detach(); - pSite->Release(); - } - } - else if (pData->nType == itScript) - { - // TODO - } - - delete pData; - - instance->pdata = 0; - - return NPERR_NO_ERROR; - -} - - -// NPP_SetWindow -// -// Associates a platform specific window handle with a plug-in instance. -// Called multiple times while, e.g., scrolling. Can be called for three -// reasons: -// -// 1. A new window has been created -// 2. A window has been moved or resized -// 3. A window has been destroyed -// -// There is also the degenerate case; that it was called spuriously, and -// the window handle and or coords may have or have not changed, or -// the window handle and or coords may be ZERO. State information -// must be maintained by the plug-in to correctly handle the degenerate -// case. -// -NPError NP_LOADDS -NPP_SetWindow(NPP instance, NPWindow* window) -{ - NG_TRACE_METHOD(NPP_SetWindow); - - // Reject silly parameters - if (!window) - { - return NPERR_GENERIC_ERROR; - } - - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (pData == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - if (pData->nType == itControl) - { - CControlSiteInstance *pSite = pData->pControlSite; - if (pSite == NULL) - { - return NPERR_GENERIC_ERROR; - } - - HWND hwndParent = (HWND) window->window; - if (hwndParent) - { - RECT rcPos; - GetClientRect(hwndParent, &rcPos); - - if (pSite->GetParentWindow() == NULL) - { - pSite->Attach(hwndParent, rcPos, NULL); - } - else - { - pSite->SetPosition(rcPos); - } - } -} - - return NPERR_NO_ERROR; -} - - -// NPP_NewStream -// -// Notifies the plugin of a new data stream. -// The data type of the stream (a MIME name) is provided. -// The stream object indicates whether it is seekable. -// The plugin specifies how it wants to handle the stream. -// -// In this case, I set the streamtype to be NPAsFile. This tells the Navigator -// that the plugin doesn't handle streaming and can only deal with the object as -// a complete disk file. It will still call the write functions but it will also -// pass the filename of the cached file in a later NPE_StreamAsFile call when it -// is done transfering the file. -// -// If a plugin handles the data in a streaming manner, it should set streamtype to -// NPNormal (e.g. *streamtype = NPNormal)...the NPE_StreamAsFile function will -// never be called in this case -// -NPError NP_LOADDS -NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream *stream, - NPBool seekable, - uint16 *stype) -{ - NG_TRACE_METHOD(NPP_NewStream); - - if(!instance) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - // save the plugin instance object in the stream instance - stream->pdata = instance->pdata; - *stype = NP_ASFILE; - return NPERR_NO_ERROR; -} - - -// NPP_StreamAsFile -// -// The stream is done transferring and here is a pointer to the file in the cache -// This function is only called if the streamtype was set to NPAsFile. -// -void NP_LOADDS -NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) -{ - NG_TRACE_METHOD(NPP_StreamAsFile); - - if(fname == NULL || fname[0] == NULL) - { - return; - } -} - - -// -// These next 2 functions are really only directly relevant -// in a plug-in which handles the data in a streaming manner. -// For a NPAsFile stream, they are still called but can safely -// be ignored. -// -// In a streaming plugin, all data handling would take place here... -// -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. - -int32 STREAMBUFSIZE = 0X0FFFFFFF; // we are reading from a file in NPAsFile mode - // so we can take any size stream in our write - // call (since we ignore it) - - -// NPP_WriteReady -// -// The number of bytes that a plug-in is willing to accept in a subsequent -// NPO_Write call. -// -int32 NP_LOADDS -NPP_WriteReady(NPP instance, NPStream *stream) -{ - return STREAMBUFSIZE; -} - - -// NPP_Write -// -// Provides len bytes of data. -// -int32 NP_LOADDS -NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) -{ - return len; -} - - -// NPP_DestroyStream -// -// Closes a stream object. -// reason indicates why the stream was closed. Possible reasons are -// that it was complete, because there was some error, or because -// the user aborted it. -// -NPError NP_LOADDS -NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) -{ - // because I am handling the stream as a file, I don't do anything here... - // If I was streaming, I would know that I was done and do anything appropriate - // to the end of the stream... - return NPERR_NO_ERROR; -} - - -// NPP_Print -// -// Printing the plugin (to be continued...) -// -void NP_LOADDS -NPP_Print(NPP instance, NPPrint* printInfo) -{ - if(printInfo == NULL) // trap invalid parm - { - return; - } - -// if (instance != NULL) { -// CPluginWindow* pluginData = (CPluginWindow*) instance->pdata; -// pluginData->Print(printInfo); -// } -} - -/******************************************************************************* -// NPP_URLNotify: -// Notifies the instance of the completion of a URL request. -// -// NPP_URLNotify is called when Netscape completes a NPN_GetURLNotify or -// NPN_PostURLNotify request, to inform the plug-in that the request, -// identified by url, has completed for the reason specified by reason. The most -// common reason code is NPRES_DONE, indicating simply that the request -// completed normally. Other possible reason codes are NPRES_USER_BREAK, -// indicating that the request was halted due to a user action (for example, -// clicking the "Stop" button), and NPRES_NETWORK_ERR, indicating that the -// request could not be completed (for example, because the URL could not be -// found). The complete list of reason codes is found in npapi.h. -// -// The parameter notifyData is the same plug-in-private value passed as an -// argument to the corresponding NPN_GetURLNotify or NPN_PostURLNotify -// call, and can be used by your plug-in to uniquely identify the request. - ******************************************************************************/ - -void -NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) -{ -} - diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp b/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp deleted file mode 100644 index fe03da8df81..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp +++ /dev/null @@ -1,2800 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - * Pierre Phaneuf - */ - -#include "stdafx.h" -#include -#include -#include -//#include - -#include "MozillaControl.h" -#include "MozillaBrowser.h" -#include "IEHtmlDocument.h" - -#include "nsFileSpec.h" -#include "nsILocalFile.h" -#include "nsIContentViewerFile.h" -#include "nsIWebNavigation.h" - -static const TCHAR *c_szInvalidArg = _T("Invalid parameter"); -static const TCHAR *c_szUninitialized = _T("Method called while control is uninitialized"); - -#define RETURN_ERROR(message, hr) \ - SetErrorInfo(message, hr); \ - return hr; - -#define RETURN_E_INVALIDARG() \ - RETURN_ERROR(c_szInvalidArg, E_INVALIDARG); - -#define RETURN_E_UNEXPECTED() \ - RETURN_ERROR(c_szUninitialized, E_UNEXPECTED); - - -extern "C" void NS_SetupRegistry(); - -static const std::string c_szPrefsHomePage = "browser.startup.homepage"; -static const std::string c_szDefaultPage = "resource:/res/MozillaControl.html"; - -static const tstring c_szHelpKey = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects"); - -#define MOZ_CONTROL_REG_KEY _T("Software\\Mozilla\\") -#define MOZ_CONTROL_REG_VALUE_DIR _T("Dir") -#define MOZ_CONTROL_REG_VALUE_BIN_DIRECTORY_PATH _T("BinDirectoryPath") - -BOOL CMozillaBrowser::m_bRegistryInitialized = FALSE; - -// Some recent SDKs define these IOleCommandTarget groups, so they're -// postfixed with _Moz to prevent linker errors. - -GUID CGID_IWebBrowser_Moz = - { 0xED016940L, 0xBD5B, 0x11cf, {0xBA, 0x4E, 0x00, 0xC0, 0x4F, 0xD7, 0x08, 0x16} }; - -GUID CGID_MSHTML_Moz = - { 0xED016940L, 0xBD5B, 0x11cf, {0xBA, 0x4E, 0x00, 0xC0, 0x4F, 0xD7, 0x08, 0x16} }; - -///////////////////////////////////////////////////////////////////////////// -// CMozillaBrowser - -CMozillaBrowser::CMozillaBrowser() -{ - NG_TRACE_METHOD(CMozillaBrowser::CMozillaBrowser); - - // ATL flags ensures the control opens with a window - m_bWindowOnly = TRUE; - m_bWndLess = FALSE; - - // Initialize layout interfaces - m_pIWebShell = nsnull; - m_pIWebShellWin = nsnull; - m_pIPref = nsnull; - m_pIServiceManager = nsnull; - - // Ready state of control - m_nBrowserReadyState = READYSTATE_UNINITIALIZED; - - // Create the container that handles some things for us - m_pWebShellContainer = NULL; - m_pEditor = NULL; - - // Controls starts off unbusy - m_bBusy = FALSE; - - // Control starts off in non-edit mode - m_bEditorMode = FALSE; - - // Control starts off without being a drop target - m_bDropTarget = FALSE; - - // the IHTMLDocument, lazy allocation. - m_pDocument = NULL; - - // Open registry keys - m_SystemKey.Create(HKEY_LOCAL_MACHINE, MOZ_CONTROL_REG_KEY); - m_UserKey.Create(HKEY_CURRENT_USER, MOZ_CONTROL_REG_KEY); - - // Initialise the web shell - InitWebShell(); -} - - -CMozillaBrowser::~CMozillaBrowser() -{ - NG_TRACE_METHOD(CMozillaBrowser::~CMozillaBrowser); - // Close the web shell - TermWebShell(); - - // Close registry keys - m_SystemKey.Close(); - m_UserKey.Close(); -} - - -STDMETHODIMP CMozillaBrowser::InterfaceSupportsErrorInfo(REFIID riid) -{ - static const IID* arr[] = - { - &IID_IWebBrowser, - &IID_IWebBrowser2, - &IID_IWebBrowserApp - }; - for (int i=0;i<(sizeof(arr)/sizeof(arr[0]));i++) - { - if (InlineIsEqualGUID(*arr[i],riid)) - return S_OK; - } - return S_FALSE; -} - - -int CMozillaBrowser::MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, UINT nType) -{ - // Let the doc host display it's own message box if it can - CIPtr(IDocHostShowUI) spIDocHostShowUI = m_spClientSite; - if (spIDocHostShowUI) - { - USES_CONVERSION; - LRESULT lResult = 0; - HRESULT hr = spIDocHostShowUI->ShowMessage(m_hWnd, - T2OLE(lpszText), T2OLE(lpszCaption), nType, NULL, 0, &lResult); - if (hr == S_OK) - { - return lResult; - } - } - - // Do the default message box - return CWindow::MessageBox(lpszText, lpszCaption, nType); -} - - -HRESULT CMozillaBrowser::SetErrorInfo(LPCTSTR lpszDesc, HRESULT hr) -{ - USES_CONVERSION; - return AtlSetErrorInfo(GetObjectCLSID(), T2OLE(lpszDesc), 0, NULL, GUID_NULL, hr, NULL); -} - - -/////////////////////////////////////////////////////////////////////////////// -// Message handlers - - -// Handle WM_CREATE windows message -LRESULT CMozillaBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCreate); - - // Clip the child windows out of paint operations - SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_CLIPCHILDREN); - - // Create the NGLayout WebShell - CreateWebShell(); - - // TODO create and register a drop target - - // Control is ready - m_nBrowserReadyState = READYSTATE_LOADED; - - // Load browser helpers - LoadBrowserHelpers(); - - // Browse to a default page - if in design mode - BOOL bUserMode = FALSE; - if (SUCCEEDED(GetAmbientUserMode(bUserMode))) - { - if (!bUserMode) - { - USES_CONVERSION; - Navigate(A2OLE(c_szDefaultPage.c_str()), NULL, NULL, NULL, NULL); - } - } - - return 0; -} - - -// Handle WM_DESTROY window message -LRESULT CMozillaBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnDestroy); - - // Unload browser helpers - UnloadBrowserHelpers(); - - // TODO unregister drop target - - // Destroy the htmldoc - if (m_pDocument != NULL) - { - m_pDocument->Release(); - m_pDocument = NULL; - } - - // Destroy layout... - if (m_pIWebShellWin != nsnull) - { - m_pIWebShellWin->Destroy(); - NS_RELEASE(m_pIWebShellWin); - } - - if (m_pIWebShell != nsnull) - { - NS_RELEASE(m_pIWebShell); - } - - if (m_pWebShellContainer) - { - m_pWebShellContainer->Release(); - m_pWebShellContainer = NULL; - } - - if (m_pIPref) - { - NS_RELEASE(m_pIPref); - } - - return 0; -} - - -// Handle WM_SIZE windows message -LRESULT CMozillaBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSize); - - // Pass resize information down to the WebShell... - if (m_pIWebShellWin) - { - m_pIWebShellWin->SetPosition(0, 0); - m_pIWebShellWin->SetSize(LOWORD(lParam), HIWORD(lParam), PR_TRUE); - } - return 0; -} - - -// Handle WM_PAINT windows message (and IViewObject::Draw) -HRESULT CMozillaBrowser::OnDraw(ATL_DRAWINFO& di) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnDraw); - - if (m_pIWebShell == nsnull) - { - RECT& rc = *(RECT*)di.prcBounds; - Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); - DrawText(di.hdcDraw, m_sErrorMessage.c_str(), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE); - } - - return S_OK; -} - -// Handle ID_PAGESETUP command -LRESULT CMozillaBrowser::OnPageSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPageSetup); - MessageBox(_T("No page setup yet!"), _T("Control Message"), MB_OK); - - // TODO show the page setup dialog - - return 0; -} - -// Handle ID_PRINT command -LRESULT CMozillaBrowser::OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPrint); - - nsresult res; - - // Print the contents - if (m_pIWebShell) - { - nsIContentViewer *pContentViewer = nsnull; - res = m_pIWebShell->GetContentViewer(&pContentViewer); - if (NS_SUCCEEDED(res)) - { - nsCOMPtr spContentViewerFile = do_QueryInterface(pContentViewer); - spContentViewerFile->Print(PR_TRUE, nsnull); - NS_RELEASE(pContentViewer); - } - } - - return res; -} - -LRESULT CMozillaBrowser::OnSaveAs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSaveAs); - - OPENFILENAME SaveFileName; - - char szFile[256]; - char szFileTitle[256]; - BSTR pageName = NULL; - - SaveFileName.lStructSize = sizeof(SaveFileName); - SaveFileName.hwndOwner = m_hWnd; - SaveFileName.hInstance = NULL; - SaveFileName.lpstrFilter = "Web Page, HTML Only (*.htm;*.html)\0*.htm;*.html\0Text File (*.txt)\0*.txt\0"; - //TODO: The IE control allows you to also save as "Web Page, complete" where all of the page's images are saved - // in a directory along with the web page. This doesn't appear to be directly supported by Mozilla, but - // could be implemented here if deemed necessary. (Web Page, complete (*.htm;*.html)\0*.htm;*.html\0) - SaveFileName.lpstrCustomFilter = NULL; - SaveFileName.nMaxCustFilter = NULL; - SaveFileName.nFilterIndex = 1; - SaveFileName.lpstrFile = szFile; - SaveFileName.nMaxFile = sizeof(szFile); - SaveFileName.lpstrFileTitle = szFileTitle; - SaveFileName.nMaxFileTitle = sizeof(szFileTitle); - SaveFileName.lpstrInitialDir = NULL; - SaveFileName.lpstrTitle = NULL; - SaveFileName.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; - SaveFileName.nFileOffset = NULL; - SaveFileName.nFileExtension = NULL; - SaveFileName.lpstrDefExt = "htm"; - SaveFileName.lCustData = NULL; - SaveFileName.lpfnHook = NULL; - SaveFileName.lpTemplateName = NULL; - - - //Get the title of the current web page to set as the default filename. - USES_CONVERSION; - char szTmp[256]; - get_LocationName(&pageName); - strcpy(szTmp, OLE2A(pageName)); - - int j = 0; //The SaveAs dialog will fail if szFile contains any "bad" characters. - for (int i=0; szTmp[i]!='\0'; i++) { //This hunk of code attempts to mimick the IE way of replacing "bad" - switch(szTmp[i]) { //characters with "good" characters. - case '\\': - case '*': - case '|': - case ':': - case '"': - case '>': - case '<': - case '?': - break; - case '.': - if (szTmp[i+1] != '\0') { - szFile[j] = '_'; - j++; - } - break; - case '/': - szFile[j] = '-'; - j++; - break; - default: - szFile[j] = szTmp[i]; - j++; - } - } - szFile[j] = '\0'; - - HRESULT res = S_OK; - if ( GetSaveFileName(&SaveFileName) ) { - //Get the current DOM document - nsIDOMDocument* pDocument = nsnull; - res = GetDOMDocument(&pDocument); - if ( FAILED(res) ) - return res; - - //Get an nsIDiskDocument interface to the DOM document - nsCOMPtr diskDoc = do_QueryInterface(pDocument); - if (!diskDoc) - return E_NOINTERFACE; - - //Set the file type specified by the user - //Add the correct file extension if none is specified - nsIDiskDocument::ESaveFileType saveFileType; - if ( SaveFileName.nFilterIndex == 2 ) //SaveAs text file - saveFileType = nsIDiskDocument::eSaveFileText; - else //SaveAs html file - saveFileType = nsIDiskDocument::eSaveFileHTML; - - //Create an nsFilelSpec from the selected file path. - nsFileSpec fileSpec(szFile, PR_FALSE); - - //Save the file. - res = diskDoc->SaveFile(&fileSpec, PR_TRUE, PR_TRUE, saveFileType, ""); - } - return res; -} - -LRESULT CMozillaBrowser::OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnProperties); - - MessageBox(_T("No Properties Yet!"), _T("Control Message"), MB_OK); - // TODO show the properties dialog - return 0; -} - -LRESULT CMozillaBrowser::OnCut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCut); - - nsresult res; - - nsIPresShell* pIPresShell = nsnull; - res = GetPresShell(&pIPresShell); //Get the presentation shell for the document - if (NS_FAILED(res) || pIPresShell == nsnull) - { - return NS_ERROR_NOT_INITIALIZED; - } - - nsCOMPtr selection; //Get a pointer to the DOM selection - res = pIPresShell->GetSelection(SELECTION_NORMAL, getter_AddRefs(selection)); - if ( NS_FAILED(res) ) return res; - - res = pIPresShell->DoCopy(); //Copy the selection to the clipboard - if ( NS_SUCCEEDED(res) ) - { - res = selection->DeleteFromDocument(); //Delete the selection from the document - } - NS_RELEASE(pIPresShell); - - return res; -} - -LRESULT CMozillaBrowser::OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCopy); - - nsresult res; - - nsIPresShell* pIPresShell = nsnull; - res = GetPresShell(&pIPresShell); //Get the presentation shell for the document - if (NS_FAILED(res) || pIPresShell == nsnull) - { - return NS_ERROR_NOT_INITIALIZED; - } - - res = pIPresShell->DoCopy(); - NS_RELEASE(pIPresShell); - - return res; -} - -LRESULT CMozillaBrowser::OnPaste(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPaste); - - MessageBox(_T("No Paste Yet!"), _T("Control Message"), MB_OK); - // TODO enable pasting - return 0; -} - -LRESULT CMozillaBrowser::OnSelectAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSelectAll); - - MessageBox(_T("No Select All Yet!"), _T("Control Message"), MB_OK); - // TODO enable Select All - return 0; -} - -// Handle ID_VIEWSOURCE command -LRESULT CMozillaBrowser::OnViewSource(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnViewSource); - - // Get the url from the web shell - const PRUnichar *pszUrl = nsnull; - PRInt32 aHistoryIndex; - m_pIWebShell->GetHistoryIndex(aHistoryIndex); - m_pIWebShell->GetURL(aHistoryIndex, &pszUrl); - - nsString strUrl(pszUrl); - nsString strTemp(nsString("view-source:") + strUrl); - strUrl = strTemp; - - CIPtr(IDispatch) spDispNew; - VARIANT_BOOL bCancel = VARIANT_FALSE; - Fire_NewWindow2(&spDispNew, &bCancel); - - if ((bCancel == VARIANT_FALSE) && spDispNew) - { - CIPtr(IWebBrowser2) spOther = spDispNew;; - if (spOther) - { - // tack in the viewsource command - BSTR bstrURL = SysAllocString(strUrl.GetUnicode()); - CComVariant vURL(bstrURL); - VARIANT vNull; - vNull.vt = VT_NULL; - - spOther->Navigate2(&vURL, &vNull, &vNull, &vNull, &vNull); - - // when and if we can get the container we should - // be able to tell the other windows container not to show toolbars, menus, etc. - // we would also be able to show the window. one fix would be to - // change the navigate method to set a flag if it's viewing source, and to - // have it's document complete method tell it's container to hide toolbars and menu. - /* - IDispatch *pOtherContainer = NULL; - pOther->get_Container(&pOtherContainer); - if(pOtherContainer != NULL) - { - DWebBrowserEvents2 *pOtherEventSink; - if(SUCCEEDED(pOtherContainer->QueryInterface(IID_IDWebBrowserEvents2,(void**)&pOtherEventSink))) - { - __asm int 3 - - pOtherEventSink->Release(); - } - - pOtherContainer->Release(); - } - */ - - SysFreeString(bstrURL); - } - } - - bHandled = TRUE; - return 0; -} - - -// Test if the browser is in a valid state -BOOL CMozillaBrowser::IsValid() -{ - NG_TRACE_METHOD(CMozillaBrowser::IsValid); - - return (m_pIWebShell == nsnull) ? FALSE : TRUE; -} - -///////////////////////////////////////////////////////////////////////////// - -static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID); -static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID); -static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID); -static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); - -// Initialises the web shell engine -HRESULT CMozillaBrowser::InitWebShell() -{ - // Initialise XPCOM - TCHAR szBinDirPath[MAX_PATH]; - DWORD dwBinDirPath = sizeof(szBinDirPath) / sizeof(szBinDirPath[0]); - - memset(szBinDirPath, 0, sizeof(szBinDirPath)); - if (m_SystemKey.QueryValue(szBinDirPath, MOZ_CONTROL_REG_VALUE_BIN_DIRECTORY_PATH, &dwBinDirPath) == ERROR_SUCCESS) - { - USES_CONVERSION; - nsILocalFile *pBinDirPath = nsnull; - nsresult res = NS_NewLocalFile(T2A(szBinDirPath), &pBinDirPath); - NS_InitXPCOM(&m_pIServiceManager, pBinDirPath); - NS_RELEASE(pBinDirPath); - } - else - { - NS_InitXPCOM(&m_pIServiceManager, nsnull); - } - - // Register components - if (!m_bRegistryInitialized) - { - NS_SetupRegistry(); - m_bRegistryInitialized = TRUE; - } - - // Create the Event Queue for the UI thread... - // - // If an event queue already exists for the thread, then - // CreateThreadEventQueue(...) will fail... - nsresult rv; - nsIEventQueueService* eventQService = NULL; - - rv = nsServiceManager::GetService(kEventQueueServiceCID, - kIEventQueueServiceIID, - (nsISupports **)&eventQService); - if (NS_SUCCEEDED(rv)) { - rv = eventQService->CreateThreadEventQueue(); - nsServiceManager::ReleaseService(kEventQueueServiceCID, eventQService); - } - - return S_OK; -} - -// Terminates the web shell engine -HRESULT CMozillaBrowser::TermWebShell() -{ - // XXX: Do not call DestroyThreadEventQueue(...) for now... - - // Terminate XPCOM & cleanup - NS_ShutdownXPCOM(m_pIServiceManager); - m_pIServiceManager = nsnull; - - return S_OK; -} - -// Create and initialise the web shell -HRESULT CMozillaBrowser::CreateWebShell() -{ - NG_TRACE_METHOD(CMozillaBrowser::CreateWebShell); - - if (m_pIWebShell != nsnull) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - RECT rcLocation; - GetClientRect(&rcLocation); - if (IsRectEmpty(&rcLocation)) - { - rcLocation.bottom++; - rcLocation.top++; - } - - nsresult rv; - - // Load preferences service - rv = nsServiceManager::GetService(kPrefCID, - NS_GET_IID(nsIPref), - (nsISupports **)&m_pIPref); - if (NS_FAILED(rv)) - { - NG_ASSERT(0); - NG_TRACE(_T("Could not create preference object rv=%08x\n"), (int) rv); - m_sErrorMessage = _T("Error - could not create preference object"); - return E_FAIL; - } - - rv = m_pIPref->StartUp(); //Initialize the preference service - rv = m_pIPref->ReadUserPrefs(); //Reads from default_prefs.js - - // Create the web shell object - rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, - kIWebShellIID, - (void**)&m_pIWebShell); - if (NS_FAILED(rv)) - { - NG_ASSERT(0); - NG_TRACE(_T("Could not create web shell rv=%08x\n"), (int) rv); - m_sErrorMessage = _T("Error - could not create web shell, check PATH settings"); - return E_FAIL; - } - - m_pIWebShell->QueryInterface(kIBaseWindowIID, (void **) &m_pIWebShellWin); - - // Register the cookie service - NS_WITH_SERVICE(nsICookieService, cookieService, kCookieServiceCID, &rv); - if (NS_FAILED(rv) || (cookieService == nsnull)) { - NG_TRACE(_T("Could not register the cookie manager. rv=%08x\n"), (int) rv); - } - // TODO make the cookie service persistent. Currently does not save or load cookies to/from disk. - - // Initialise the web shell, making it fit the control dimensions - - nsRect r; - r.x = 0; - r.y = 0; - r.width = rcLocation.right - rcLocation.left; - r.height = rcLocation.bottom - rcLocation.top; - - PRBool aAllowPlugins = PR_TRUE; - PRBool aIsSunkenBorder = PR_FALSE; - - rv = m_pIWebShell->Init(m_hWnd, - r.x, r.y, - r.width, r.height, - aAllowPlugins, - aIsSunkenBorder); - - NG_ASSERT(NS_SUCCEEDED(rv)); - - // Create the container object - m_pWebShellContainer = new CWebShellContainer(this); - m_pWebShellContainer->AddRef(); - -// m_pIWebShell->SetPrefs(m_pIPref); - m_pIWebShell->SetContainer((nsIWebShellContainer*) m_pWebShellContainer); -/// m_pIWebShell->SetObserver((nsIStreamObserver*) m_pWebShellContainer); - m_pIWebShell->SetDocLoaderObserver((nsIDocumentLoaderObserver*) m_pWebShellContainer); -// m_pIWebShell->SetWebShellType(nsWebShellContent); - - m_pIWebShellWin->SetVisibility(PR_TRUE); - - return S_OK; -} - - -// Turns the editor mode on or off -HRESULT CMozillaBrowser::SetEditorMode(BOOL bEnabled) -{ - NG_TRACE_METHOD(CMozillaBrowser::SetEditorMode); - - m_bEditorMode = FALSE; - if (bEnabled && m_pEditor == nsnull) - { - if (m_pIWebShell == nsnull) - { - return E_UNEXPECTED; - } - - nsresult result = nsComponentManager::CreateInstance(kHTMLEditorCID, - nsnull, - NS_GET_IID(nsIEditor), - (void **) &m_pEditor); - if (NS_FAILED(result)) - { - return result; - } - if (!m_pEditor) - { - return E_OUTOFMEMORY; - } - - nsIDOMDocument *pIDOMDocument = nsnull; - if (FAILED(GetDOMDocument(&pIDOMDocument)) || pIDOMDocument == nsnull) - { - return E_UNEXPECTED; - } - - nsIPresShell* pIPresShell = nsnull; - if (FAILED(GetPresShell(&pIPresShell)) || pIPresShell == nsnull) - { - return E_UNEXPECTED; - } - - result = m_pEditor->Init(pIDOMDocument, pIPresShell, 0); - if (NS_SUCCEEDED(result)) - { - m_bEditorMode = TRUE; - } - - NS_RELEASE(pIPresShell); - NS_RELEASE(pIDOMDocument); - } - else - { - if (m_pEditor) - { - m_pEditor->Release(); - m_pEditor = nsnull; - } - } - - return S_OK; -} - - -HRESULT CMozillaBrowser::OnEditorCommand(DWORD nCmdID) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnEditorCommand); - - static nsIAtom * propB = NS_NewAtom("b"); - static nsIAtom * propI = NS_NewAtom("i"); - static nsIAtom * propU = NS_NewAtom("u"); - - if (!m_bEditorMode) - { - return E_UNEXPECTED; - } - if (!m_pEditor) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - nsCOMPtr pHtmlEditor = do_QueryInterface(m_pEditor); - - bool bToggleInlineProperty = false; - nsIAtom *pInlineProperty = nsnull; - - switch (nCmdID) - { - case IDM_BOLD: - pInlineProperty = propB; - bToggleInlineProperty = true; - break; - case IDM_ITALIC: - pInlineProperty = propI; - bToggleInlineProperty = true; - break; - case IDM_UNDERLINE: - pInlineProperty = propU; - bToggleInlineProperty = true; - break; - - // TODO add the rest! - - default: - // DO NOTHING - break; - } - - // Does the instruction involve toggling something? e.g. B, U, I - if (bToggleInlineProperty) - { - PRBool bFirst = PR_TRUE; - PRBool bAny = PR_TRUE; - PRBool bAll = PR_TRUE; - - // Set or remove - pHtmlEditor->GetInlineProperty(pInlineProperty, nsnull, nsnull, bFirst, bAny, bAll); - if (bAny) - { - pHtmlEditor->RemoveInlineProperty(pInlineProperty, nsnull); - } - else - { - pHtmlEditor->SetInlineProperty(pInlineProperty, nsnull, nsnull); - } - } - - return S_OK; -} - - -// Returns the presentation shell -HRESULT CMozillaBrowser::GetPresShell(nsIPresShell **pPresShell) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetPresShell); - - nsresult res; - - // Test for stupid args - if (pPresShell == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - *pPresShell = nsnull; - - if (m_pIWebShell == nsnull) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - nsIContentViewer* pIContentViewer = nsnull; - res = m_pIWebShell->GetContentViewer(&pIContentViewer); - if (NS_SUCCEEDED(res) && pIContentViewer) - { - nsIDocumentViewer* pIDocViewer = nsnull; - res = pIContentViewer->QueryInterface(kIDocumentViewerIID, (void**) &pIDocViewer); - if (NS_SUCCEEDED(res) && pIDocViewer) - { - nsIPresContext * pIPresContent = nsnull; - res = pIDocViewer->GetPresContext(pIPresContent); - if (NS_SUCCEEDED(res) && pIPresContent) - { - res = pIPresContent->GetShell(pPresShell); - NS_RELEASE(pIPresContent); - } - NS_RELEASE(pIDocViewer); - } - NS_RELEASE(pIContentViewer); - } - - return res; -} - - -// Return the root DOM document -HRESULT CMozillaBrowser::GetDOMDocument(nsIDOMDocument **pDocument) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetDOMDocument); - - nsresult res; - - // Test for stupid args - if (pDocument == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - *pDocument = nsnull; - - if (m_pIWebShell == nsnull) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - nsIContentViewer * pCViewer = nsnull; - res = m_pIWebShell->GetContentViewer(&pCViewer); - if (NS_SUCCEEDED(res) && pCViewer) - { - nsIDocumentViewer * pDViewer = nsnull; - res = pCViewer->QueryInterface(kIDocumentViewerIID, (void**) &pDViewer); - if (NS_SUCCEEDED(res) && pDViewer) - { - nsIDocument * pDoc = nsnull; - res = pDViewer->GetDocument(pDoc); - if (NS_SUCCEEDED(res) && pDoc) - { - res = pDoc->QueryInterface(kIDOMDocumentIID, (void**) pDocument); - NS_RELEASE(pDoc); - } - NS_RELEASE(pDViewer); - } - NS_RELEASE(pCViewer); - } - - return res; -} - - -// Load any browser helpers -HRESULT CMozillaBrowser::LoadBrowserHelpers() -{ - NG_TRACE_METHOD(CMozillaBrowser::LoadBrowserHelpers); - - // IE loads browser helper objects from a branch of the registry - // Search the branch looking for objects to load with the control. - - CRegKey cKey; - if (cKey.Open(HKEY_LOCAL_MACHINE, c_szHelpKey.c_str(), KEY_ENUMERATE_SUB_KEYS) != ERROR_SUCCESS) - { - NG_TRACE(_T("No browser helper key found\n")); - return S_FALSE; - } - - std::vector cClassList; - - DWORD nKey = 0; - LONG nResult = ERROR_SUCCESS; - while (nResult == ERROR_SUCCESS) - { - TCHAR szCLSID[50]; - DWORD dwCLSID = sizeof(szCLSID) / sizeof(TCHAR); - FILETIME cLastWrite; - - // Read next subkey - nResult = RegEnumKeyEx(cKey, nKey++, szCLSID, &dwCLSID, NULL, NULL, NULL, &cLastWrite); - if (nResult != ERROR_SUCCESS) - { - break; - } - - NG_TRACE(_T("Reading helper object \"%s\"\n"), szCLSID); - - // Turn the key into a CLSID - USES_CONVERSION; - CLSID clsid; - if (CLSIDFromString(T2OLE(szCLSID), &clsid) != NOERROR) - { - continue; - } - - cClassList.push_back(clsid); - } - - // Empty list? - if (cClassList.empty()) - { - NG_TRACE(_T("No browser helper objects found\n")); - return S_FALSE; - } - - // Create each object in turn - for (std::vector::const_iterator i = cClassList.begin(); i != cClassList.end(); i++) - { - CLSID clsid = *i; - HRESULT hr; - CComQIPtr cpObjectWithSite; - - hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IObjectWithSite, (LPVOID *) &cpObjectWithSite); - if (FAILED(hr)) - { - NG_TRACE(_T("Registered browser helper object cannot be created\n"));; - } - - // Set the object to point at the browser - cpObjectWithSite->SetSite((IWebBrowser2 *) this); - - // Store in the list - CComUnkPtr cpUnk = cpObjectWithSite; - m_cBrowserHelperList.push_back(cpUnk); - } - - return S_OK; -} - -// Release browser helpers -HRESULT CMozillaBrowser::UnloadBrowserHelpers() -{ - NG_TRACE_METHOD(CMozillaBrowser::UnloadBrowserHelpers); - - for (ObjectList::const_iterator i = m_cBrowserHelperList.begin(); i != m_cBrowserHelperList.end(); i++) - { - CComUnkPtr cpUnk = *i; - CComQIPtr cpObjectWithSite = cpUnk; - if (cpObjectWithSite) - { - cpObjectWithSite->SetSite(NULL); - } - } - m_cBrowserHelperList.clear(); - - return S_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// IOleObject overrides - -// This is an almost verbatim copy of the standard ATL implementation of -// IOleObject::InPlaceActivate but with a few lines commented out. - -HRESULT CMozillaBrowser::InPlaceActivate(LONG iVerb, const RECT* prcPosRect) -{ - NG_TRACE_METHOD(CMozillaBrowser::InPlaceActivate); - - HRESULT hr; - - if (m_spClientSite == NULL) - return S_OK; - - CComPtr pIPO; - ControlQueryInterface(IID_IOleInPlaceObject, (void**)&pIPO); - _ASSERTE(pIPO != NULL); - if (prcPosRect != NULL) - pIPO->SetObjectRects(prcPosRect, prcPosRect); - - if (!m_bNegotiatedWnd) - { - if (!m_bWindowOnly) - // Try for windowless site - hr = m_spClientSite->QueryInterface(IID_IOleInPlaceSiteWindowless, (void **)&m_spInPlaceSite); - - if (m_spInPlaceSite) - { - m_bInPlaceSiteEx = TRUE; - m_bWndLess = SUCCEEDED(m_spInPlaceSite->CanWindowlessActivate()); - m_bWasOnceWindowless = TRUE; - } - else - { - m_spClientSite->QueryInterface(IID_IOleInPlaceSiteEx, (void **)&m_spInPlaceSite); - if (m_spInPlaceSite) - m_bInPlaceSiteEx = TRUE; - else - hr = m_spClientSite->QueryInterface(IID_IOleInPlaceSite, (void **)&m_spInPlaceSite); - } - } - - _ASSERTE(m_spInPlaceSite); - if (!m_spInPlaceSite) - return E_FAIL; - - m_bNegotiatedWnd = TRUE; - - if (!m_bInPlaceActive) - { - - BOOL bNoRedraw = FALSE; - if (m_bWndLess) - m_spInPlaceSite->OnInPlaceActivateEx(&bNoRedraw, ACTIVATE_WINDOWLESS); - else - { - if (m_bInPlaceSiteEx) - m_spInPlaceSite->OnInPlaceActivateEx(&bNoRedraw, 0); - else - { - HRESULT hr = m_spInPlaceSite->CanInPlaceActivate(); - if (FAILED(hr)) - return hr; - m_spInPlaceSite->OnInPlaceActivate(); - } - } - } - - m_bInPlaceActive = TRUE; - - // get location in the parent window, - // as well as some information about the parent - // - OLEINPLACEFRAMEINFO frameInfo; - RECT rcPos, rcClip; - CComPtr spInPlaceFrame; - CComPtr spInPlaceUIWindow; - frameInfo.cb = sizeof(OLEINPLACEFRAMEINFO); - HWND hwndParent; - if (m_spInPlaceSite->GetWindow(&hwndParent) == S_OK) - { - m_spInPlaceSite->GetWindowContext(&spInPlaceFrame, - &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo); - - if (!m_bWndLess) - { - if (m_hWndCD) - { - ::ShowWindow(m_hWndCD, SW_SHOW); - ::SetFocus(m_hWndCD); - } - else - { - HWND h = CreateControlWindow(hwndParent, rcPos); - _ASSERTE(h == m_hWndCD); - } - } - - pIPO->SetObjectRects(&rcPos, &rcClip); - } - - CComPtr spActiveObject; - ControlQueryInterface(IID_IOleInPlaceActiveObject, (void**)&spActiveObject); - - // Gone active by now, take care of UIACTIVATE - if (DoesVerbUIActivate(iVerb)) - { - if (!m_bUIActive) - { - m_bUIActive = TRUE; - hr = m_spInPlaceSite->OnUIActivate(); - if (FAILED(hr)) - return hr; - - SetControlFocus(TRUE); - // set ourselves up in the host. - // - if (spActiveObject) - { - if (spInPlaceFrame) - spInPlaceFrame->SetActiveObject(spActiveObject, NULL); - if (spInPlaceUIWindow) - spInPlaceUIWindow->SetActiveObject(spActiveObject, NULL); - } - -// These lines are deliberately commented out to demonstrate what breaks certain -// control containers. - -// if (spInPlaceFrame) -// spInPlaceFrame->SetBorderSpace(NULL); -// if (spInPlaceUIWindow) -// spInPlaceUIWindow->SetBorderSpace(NULL); - } - } - - m_spClientSite->ShowObject(); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetClientSite(IOleClientSite **ppClientSite) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetClientSite); - - NG_ASSERT(ppClientSite); - - // This fixes a problem in the base class which asserts if the client - // site has not been set when this method is called. - - HRESULT hRes = E_POINTER; - if (ppClientSite != NULL) - { - *ppClientSite = NULL; - if (m_spClientSite == NULL) - { - return S_OK; - } - } - - return IOleObjectImpl::GetClientSite(ppClientSite); -} - - -///////////////////////////////////////////////////////////////////////////// -// IWebBrowser - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoBack(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::GoBack); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (m_pIWebShell->CanBack() == NS_OK) - { - m_pIWebShell->Back(); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoForward(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::GoForward); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (m_pIWebShell->CanForward() == NS_OK) - { - m_pIWebShell->Forward(); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoHome(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::GoHome); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - USES_CONVERSION; - - TCHAR * sUrl = _T("http://home.netscape.com"); - - // Find the home page stored in prefs - if (m_pIPref) - { - char *szBuffer; - nsresult rv; - rv = m_pIPref->CopyCharPref(c_szPrefsHomePage.c_str(), &szBuffer); - if (rv == NS_OK) - { - sUrl = A2T(szBuffer); - } - } - // Navigate to the home page - Navigate(T2OLE(sUrl), NULL, NULL, NULL, NULL); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoSearch(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::GoSearch); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - USES_CONVERSION; - - TCHAR * sUrl = _T("http://search.netscape.com"); - // Find the home page stored in prefs - if (m_pIPref) - { - // TODO find and navigate to the search page stored in prefs - // and not this hard coded address - } - Navigate(T2OLE(sUrl), NULL, NULL, NULL, NULL); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers) -{ - NG_TRACE_METHOD(CMozillaBrowser::Navigate); - - //Make sure m_pIWebShell is valid - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - // Extract the URL parameter - nsString sCommand("view"); - nsString sUrl; - if (URL == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - else - { - USES_CONVERSION; - sUrl = OLE2A(URL); - } - - // Check for a view-source op - this is a bit kludgy - // TODO - if (sUrl.Compare(L"view-source:", PR_TRUE, 12) == 0) - { - sUrl.Left(sCommand, 11); - sUrl.Cut(0,12); - } - - // Extract the launch flags parameter - LONG lFlags = 0; - if (Flags && - Flags->vt != VT_ERROR && - Flags->vt != VT_EMPTY && - Flags->vt != VT_NULL) - { - CComVariant vFlags; - if ( vFlags.ChangeType(VT_I4, Flags) != S_OK ) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - lFlags = vFlags.lVal; - } - - - // Extract the target frame parameter - nsString sTargetFrame; - if (TargetFrameName && - TargetFrameName->vt == VT_BSTR) - { - USES_CONVERSION; - sTargetFrame = nsString(OLE2A(TargetFrameName->bstrVal)); - } - - // Extract the post data parameter - m_vLastPostData.Clear(); - if (PostData) - { - m_vLastPostData.Copy(PostData); - } - - nsIPostData *pIPostData = nsnull; - if (PostData && PostData->vt == VT_BSTR) - { - USES_CONVERSION; - char *szPostData = OLE2A(PostData->bstrVal); -#if 0 - // Create post data from string - NS_NewPostData(PR_FALSE, szPostData, &pIPostData); -#endif - } - - // TODO Extract the headers parameter - PRBool bModifyHistory = PR_TRUE; - - // Check the navigation flags - if (lFlags & navOpenInNewWindow) - { - CIPtr(IDispatch) spDispNew; - VARIANT_BOOL bCancel = VARIANT_FALSE; - - // Test if the event sink can give us a new window to navigate into - Fire_NewWindow2(&spDispNew, &bCancel); - - lFlags &= ~(navOpenInNewWindow); - if ((bCancel == VARIANT_FALSE) && spDispNew) - { - CIPtr(IWebBrowser2) spOther = spDispNew; - if (spOther) - { - CComVariant vURL(URL); - CComVariant vFlags(lFlags); - return spOther->Navigate2(&vURL, &vFlags, TargetFrameName, PostData, Headers); - } - } - - // Can't open a new window without client suppot - return E_NOTIMPL; - } - if (lFlags & navNoHistory) - { - // Disable history - bModifyHistory = PR_FALSE; - } - if (lFlags & navNoReadFromCache) - { - // TODO disable read from cache - } - if (lFlags & navNoWriteToCache) - { - // TODO disable write to cache - } - - // TODO find the correct target frame - - // Load the URL - char *tmpCommand = sCommand.ToNewCString(); - nsresult res = m_pIWebShell->LoadURL(sUrl.GetUnicode()); - -/* , tmpCommand, pIPostData, bModifyHistory); - NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, - nsIInputStream* aPostDataStream=nsnull, - PRBool aModifyHistory=PR_TRUE, - nsLoadFlags aType = nsIChannel::LOAD_NORMAL, - const PRUint32 aLocalIP=0) = 0; -*/ - return res; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Refresh(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::Refresh); - -//Uneccessary since this gets called again in Refresh2 -#if 0 - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } -#endif - - // Reload the page - CComVariant vRefreshType(REFRESH_NORMAL); - return Refresh2(&vRefreshType); -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Refresh2(VARIANT __RPC_FAR *Level) -{ - NG_TRACE_METHOD(CMozillaBrowser::Refresh2); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_NULL_OR_POINTER(Level, VARIANT); - - // Check the requested refresh type - OLECMDID_REFRESHFLAG iRefreshLevel = OLECMDIDF_REFRESH_NORMAL; - if (Level) - { - CComVariant vLevelAsInt; - if ( vLevelAsInt.ChangeType(VT_I4, Level) != S_OK ) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - iRefreshLevel = (OLECMDID_REFRESHFLAG) vLevelAsInt.iVal; - } - - // Turn the IE refresh type into the nearest NG equivalent - nsLoadFlags type = nsIChannel::LOAD_NORMAL; - switch (iRefreshLevel & OLECMDIDF_REFRESH_LEVELMASK) - { - case OLECMDIDF_REFRESH_NORMAL: - case OLECMDIDF_REFRESH_IFEXPIRED: - case OLECMDIDF_REFRESH_CONTINUE: - case OLECMDIDF_REFRESH_NO_CACHE: - case OLECMDIDF_REFRESH_RELOAD: - type = nsIChannel::LOAD_NORMAL; - break; - case OLECMDIDF_REFRESH_COMPLETELY: - type = nsIHTTPChannel::BYPASS_CACHE | nsIHTTPChannel::BYPASS_PROXY; - break; - default: - // No idea what refresh type this is supposed to be - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - nsCOMPtr spIWebNavigation = do_QueryInterface(m_pIWebShell); - if (spIWebNavigation) - { - spIWebNavigation->Reload(type); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Stop() -{ - NG_TRACE_METHOD(CMozillaBrowser::Stop); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - nsCOMPtr spIWebNavigation = do_QueryInterface(m_pIWebShell); - if (spIWebNavigation) - { - spIWebNavigation->Stop(); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Application); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - // Return a pointer to this controls dispatch interface - *ppDisp = (IDispatch *) this; - (*ppDisp)->AddRef(); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Parent); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - // Attempt to get the parent object of this control - HRESULT hr = E_FAIL; - if (m_spClientSite) - { - hr = m_spClientSite->QueryInterface(IID_IDispatch, (void **) ppDisp); - } - - return (SUCCEEDED(hr)) ? S_OK : E_NOINTERFACE; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Container); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Container: Retrieve a pointer to the IDispatch interface of the container. - *ppDisp = NULL; - RETURN_E_UNEXPECTED(); -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Document); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - *ppDisp = NULL; - - // Get hold of the DOM document - nsIDOMDocument *pIDOMDocument = nsnull; - if (FAILED(GetDOMDocument(&pIDOMDocument)) || pIDOMDocument == nsnull) - { - RETURN_E_UNEXPECTED(); - } - - if (m_pDocument == NULL) - { - CIEHtmlDocumentInstance::CreateInstance(&m_pDocument); - if (m_pDocument == NULL) - { - RETURN_ERROR(_T("Refresh2: called while browser is invalid"), E_OUTOFMEMORY); - } - - // addref it so it doesn't go away on us. - m_pDocument->AddRef(); - - // give it a pointer to us. note that we shouldn't be addref'd by this call, or it would be - // a circular reference. - m_pDocument->SetParent(this); - } - - m_pDocument->QueryInterface(IID_IDispatch, (void **) ppDisp); - m_pDocument->SetDOMNode(pIDOMDocument); - pIDOMDocument->Release(); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_TopLevelContainer); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(pBool, sizeof(VARIANT_BOOL))) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_TopLevelContainer - *pBool = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Type(BSTR __RPC_FAR *Type) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Type); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //NOTE: This code should work in theory, but can't be verified because GetDoctype - // has not been implemented yet. -#if 0 - nsIDOMDocument *pIDOMDocument = nsnull; - if ( SUCCEEDED(GetDOMDocument(&pIDOMDocument)) ) - { - nsIDOMDocumentType *pIDOMDocumentType = nsnull; - if ( SUCCEEDED(pIDOMDocument->GetDoctype(&pIDOMDocumentType)) ) - { - nsString docName; - pIDOMDocumentType->GetName(docName); - //NG_TRACE("pIDOMDocumentType returns: %s", docName); - //Still need to manipulate docName so that it goes into *Type param of this function. - } - } -#endif - - //TODO: Implement get_Type - RETURN_ERROR(_T("get_Type: failed"), E_FAIL); -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Left(long __RPC_FAR *pl) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Left); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pl == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Left - Should return the left position of this control. - *pl = 0; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Left(long Left) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Left); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_Left - Should set the left position of this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Top(long __RPC_FAR *pl) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Top); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pl == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Top - Should return the top position of this control. - *pl = 0; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Top(long Top) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Top); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement set_Top - Should set the top position of this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Width(long __RPC_FAR *pl) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Width); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pl == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Width- Should return the width of this control. - *pl = 0; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Width(long Width) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Width); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_Width - Should set the width of this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Height(long __RPC_FAR *pl) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Height); - - if (!IsValid()) - { - RETURN_E_UNEXPECTED(); - } - - if (pl == NULL) - { - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Height - Should return the hieght of this control. - *pl = 0; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Height(long Height) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Height); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_Height - Should set the height of this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationName(BSTR __RPC_FAR *LocationName) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_LocationName); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (LocationName == NULL) - { - RETURN_E_INVALIDARG(); - } - - // Get the url from the web shell - nsXPIDLString szLocationName; - m_pIWebShellWin->GetTitle(getter_Copies(szLocationName)); - if (nsnull == (const PRUnichar *) szLocationName) - { - RETURN_E_UNEXPECTED(); - } - - // Convert the string to a BSTR - USES_CONVERSION; - LPCOLESTR pszConvertedLocationName = W2COLE((const PRUnichar *) szLocationName); - *LocationName = SysAllocString(pszConvertedLocationName); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationURL(BSTR __RPC_FAR *LocationURL) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_LocationURL); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (LocationURL == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - // Get the url from the web shell - const PRUnichar *pszUrl = nsnull; - PRInt32 aHistoryIndex; - m_pIWebShell->GetHistoryIndex(aHistoryIndex); - m_pIWebShell->GetURL(aHistoryIndex, &pszUrl); - if (pszUrl == nsnull) - { - return E_FAIL; - } - - // Convert the string to a BSTR - USES_CONVERSION; - LPOLESTR pszConvertedUrl = W2OLE(const_cast(pszUrl)); - *LocationURL = SysAllocString(pszConvertedUrl); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Busy(VARIANT_BOOL __RPC_FAR *pBool) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Busy); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (!NgIsValidAddress(pBool, sizeof(*pBool))) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - *pBool = (m_bBusy) ? VARIANT_TRUE : VARIANT_FALSE; - - return S_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// IWebBrowserApp - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Quit(void) -{ - NG_TRACE_METHOD(CMozillaBrowser::Quit); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //This generates an exception in the IE control. - // TODO fire quit event - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy) -{ - NG_TRACE_METHOD(CMozillaBrowser::ClientToWindow); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //This generates an exception in the IE control. - // TODO convert points to be relative to browser - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::PutProperty(BSTR szProperty, VARIANT vtValue) -{ - NG_TRACE_METHOD(CMozillaBrowser::PutProperty); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (szProperty == NULL) - { - RETURN_E_INVALIDARG(); - } - PropertyList::iterator i; - for (i = m_PropertyList.begin(); i != m_PropertyList.end(); i++) - { - // Is the property already in the list? - if (wcscmp((*i).szName, szProperty) == 0) - { - // Copy the new value - (*i).vValue = CComVariant(vtValue); - return S_OK; - } - } - - Property p; - p.szName = CComBSTR(szProperty); - p.vValue = vtValue; - - m_PropertyList.push_back(p); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetProperty); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT(Property); - NG_ASSERT_POINTER(pvtValue, VARIANT); - - if (Property == NULL || pvtValue == NULL) - { - RETURN_E_INVALIDARG(); - } - - VariantInit(pvtValue); - PropertyList::iterator i; - for (i = m_PropertyList.begin(); i != m_PropertyList.end(); i++) - { - // Is the property already in the list? - if (wcscmp((*i).szName, Property) == 0) - { - // Copy the new value - VariantCopy(pvtValue, &(*i).vValue); - return S_OK; - } - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Name(BSTR __RPC_FAR *Name) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Name); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(Name, BSTR); - if (Name == NULL) - { - RETURN_E_INVALIDARG(); - } - - // TODO: Implement get_Name (get Mozilla's executable name) - *Name = SysAllocString(L"Mozilla Web Browser Control"); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_HWND(long __RPC_FAR *pHWND) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_HWND); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(pHWND, HWND); - if (pHWND == NULL) - { - RETURN_E_INVALIDARG(); - } - - //This is supposed to return a handle to the IE main window. Since that doesn't exist - //in the control's case, this shouldn't do anything. - *pHWND = NULL; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullName(BSTR __RPC_FAR *FullName) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_FullName); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(FullName, BSTR); - if (FullName == NULL) - { - RETURN_E_INVALIDARG(); - } - - // TODO: Implement get_FullName (Return the full path of the executable containing this control) - *FullName = SysAllocString(L""); // TODO get Mozilla's executable name - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Path(BSTR __RPC_FAR *Path) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Path); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(Path, BSTR); - if (Path == NULL) - { - RETURN_E_INVALIDARG(); - } - - // TODO: Implement get_Path (get Mozilla's path) - *Path = SysAllocString(L""); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Visible(VARIANT_BOOL __RPC_FAR *pBool) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Visible); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(pBool, int); - if (pBool == NULL) - { - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Visible - *pBool = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Visible(VARIANT_BOOL Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Visible); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_Visible - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_StatusBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(pBool, int); - if (pBool == NULL) - { - RETURN_E_INVALIDARG(); - } - - //There is no StatusBar in this control. - *pBool = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusBar(VARIANT_BOOL Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_StatusBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //There is no StatusBar in this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusText(BSTR __RPC_FAR *StatusText) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_StatusText); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(StatusText, BSTR); - if (StatusText == NULL) - { - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_StatusText - //NOTE: This function is related to the MS status bar which doesn't exist in this control. Needs more - // investigation, but probably doesn't apply. - *StatusText = SysAllocString(L""); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusText(BSTR StatusText) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_StatusText); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_StatusText - //NOTE: This function is related to the MS status bar which doesn't exist in this control. Needs more - // investigation, but probably doesn't apply. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ToolBar(int __RPC_FAR *Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_ToolBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(Value, int); - if (Value == NULL) - { - RETURN_E_INVALIDARG(); - } - - //There is no ToolBar in this control. - *Value = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_ToolBar(int Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_ToolBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //There is no ToolBar in this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_MenuBar(VARIANT_BOOL __RPC_FAR *Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_MenuBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(Value, int); - if (Value == NULL) - { - RETURN_E_INVALIDARG(); - } - - //There is no MenuBar in this control. - *Value = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_MenuBar(VARIANT_BOOL Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_MenuBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //There is no MenuBar in this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_FullScreen); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - NG_ASSERT_POINTER(pbFullScreen, VARIANT_BOOL); - if (pbFullScreen == NULL) - { - RETURN_E_INVALIDARG(); - } - - //FullScreen mode doesn't really apply to this control. - *pbFullScreen = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_FullScreen(VARIANT_BOOL bFullScreen) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_FullScreen); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //FullScreen mode doesn't really apply to this control. - return S_OK; -} - - - -///////////////////////////////////////////////////////////////////////////// -// IWebBrowser2 - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers) -{ - NG_TRACE_METHOD(CMozillaBrowser::Navigate2); - -//Redundant code... taken care of in CMozillaBrowser::Navigate -#if 0 - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (URL == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - -#endif - - CComVariant vURLAsString; - if ( vURLAsString.ChangeType(VT_BSTR, URL) != S_OK ) - { - RETURN_E_INVALIDARG(); - } - - return Navigate(vURLAsString.bstrVal, Flags, TargetFrameName, PostData, Headers); -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf) -{ - NG_TRACE_METHOD(CMozillaBrowser::QueryStatusWB); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pcmdf == NULL) - { - RETURN_E_INVALIDARG(); - } - - // Call through to IOleCommandTarget::QueryStatus - OLECMD cmd; - HRESULT hr; - - cmd.cmdID = cmdID; - cmd.cmdf = 0; - hr = QueryStatus(NULL, 1, &cmd, NULL); - if (SUCCEEDED(hr)) - { - *pcmdf = (OLECMDF) cmd.cmdf; - } - - return hr; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) -{ - NG_TRACE_METHOD(CMozillaBrowser::ExecWB); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - // Call through to IOleCommandTarget::Exec - HRESULT hr; - hr = Exec(NULL, cmdID, cmdexecopt, pvaIn, pvaOut); - return hr; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize) -{ - NG_TRACE_METHOD(CMozillaBrowser::ShowBrowserBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ReadyState(READYSTATE __RPC_FAR *plReadyState) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_ReadyState); - - if (plReadyState == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - *plReadyState = m_nBrowserReadyState; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Offline); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pbOffline == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_Offline - *pbOffline = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Offline(VARIANT_BOOL bOffline) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Offline); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement get_Offline - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Silent); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pbSilent == NULL) - { - RETURN_E_INVALIDARG(); - } - - //Only really applies to the IE app, not a control - *pbSilent = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Silent(VARIANT_BOOL bSilent) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Silent); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //Only really applies to the IE app, not a control - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_RegisterAsBrowser); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pbRegister == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Implement get_RegisterAsBrowser - *pbRegister = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsBrowser(VARIANT_BOOL bRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_RegisterAsBrowser); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Implement put_RegisterAsBrowser - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_RegisterAsDropTarget); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pbRegister == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - *pbRegister = m_bDropTarget ? VARIANT_TRUE : VARIANT_FALSE; - return S_OK; -} - - - -static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) -{ - ::RevokeDragDrop(hwnd); - return TRUE; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsDropTarget(VARIANT_BOOL bRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_RegisterAsDropTarget); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - // Register the window as a drop target - if (bRegister == VARIANT_TRUE) - { - if (!m_bDropTarget) - { - CDropTargetInstance *pDropTarget = NULL; - CDropTargetInstance::CreateInstance(&pDropTarget); - if (pDropTarget) - { - pDropTarget->AddRef(); - pDropTarget->SetOwner(this); - - - // Ask the site if it wants to replace this drop target for another one - CIPtr(IDropTarget) spDropTarget; - CIPtr(IDocHostUIHandler) spDocHostUIHandler = m_spClientSite; - if (spDocHostUIHandler) - { - //if (spDocHostUIHandler->GetDropTarget(pDropTarget, &spDropTarget) != S_OK) - if (spDocHostUIHandler->GetDropTarget(pDropTarget, &spDropTarget) == S_OK) - { - m_bDropTarget = TRUE; - ::RegisterDragDrop(m_hWnd, spDropTarget); - //spDropTarget = pDropTarget; - } - } - else - //if (spDropTarget) - { - m_bDropTarget = TRUE; - ::RegisterDragDrop(m_hWnd, pDropTarget); - //::RegisterDragDrop(m_hWnd, spDropTarget); - } - pDropTarget->Release(); - } - // Now revoke any child window drop targets and pray they aren't - // reset by the layout engine. - ::EnumChildWindows(m_hWnd, EnumChildProc, (LPARAM) this); - } - } - else - { - if (m_bDropTarget) - { - m_bDropTarget = FALSE; - ::RevokeDragDrop(m_hWnd); - } - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_TheaterMode); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (pbRegister == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TheaterMode doesn't apply to this control. - *pbRegister = VARIANT_FALSE; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_TheaterMode(VARIANT_BOOL bRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_TheaterMode); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TheaterMode doesn't apply to this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_AddressBar(VARIANT_BOOL __RPC_FAR *Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_AddressBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (Value == NULL) - { - RETURN_E_INVALIDARG(); - } - - //There is no AddressBar in this control. - *Value = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_AddressBar(VARIANT_BOOL Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_AddressBar); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //There is no AddressBar in this control. - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Resizable(VARIANT_BOOL __RPC_FAR *Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Resizable); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - if (Value == NULL) - { - NG_ASSERT(0); - RETURN_E_INVALIDARG(); - } - - //TODO: Not sure if this should actually be implemented or not. - *Value = VARIANT_FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Resizable(VARIANT_BOOL Value) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_Resizable); - - if (!IsValid()) - { - NG_ASSERT(0); - RETURN_E_UNEXPECTED(); - } - - //TODO: Not sure if this should actually be implemented or not. - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// Ole Command Handlers - - -HRESULT _stdcall CMozillaBrowser::EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) -{ - BOOL bEditorMode = (nCmdID == IDM_EDITMODE) ? TRUE : FALSE; - pThis->SetEditorMode(bEditorMode); - return S_OK; -} - - -HRESULT _stdcall CMozillaBrowser::EditCommandHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) -{ - pThis->OnEditorCommand(nCmdID); - return S_OK; -} diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.h b/mozilla/webshell/embed/ActiveX/MozillaBrowser.h deleted file mode 100644 index 9016478e688..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.h +++ /dev/null @@ -1,429 +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.org 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): - */ -// MozillaBrowser.h : Declaration of the CMozillaBrowser - -#ifndef __MOZILLABROWSER_H_ -#define __MOZILLABROWSER_H_ - -// This file is autogenerated by the ATL proxy wizard -// so don't edit it! -#include "CPMozillaControl.h" - -// Commands sent via WM_COMMAND -#define ID_PRINT 1 -#define ID_PAGESETUP 2 -#define ID_VIEWSOURCE 3 -#define ID_SAVEAS 4 -#define ID_PROPERTIES 5 -#define ID_CUT 6 -#define ID_COPY 7 -#define ID_PASTE 8 -#define ID_SELECTALL 9 - -// Command group and IDs exposed through IOleCommandTarget -extern GUID CGID_IWebBrowser_Moz; -extern GUID CGID_MSHTML_Moz; - -#define HTMLID_FIND 1 -#define HTMLID_VIEWSOURCE 2 -#define HTMLID_OPTIONS 3 - -// Some definitions which are used to make firing events easier -#define CDWebBrowserEvents1 CProxyDWebBrowserEvents -#define CDWebBrowserEvents2 CProxyDWebBrowserEvents2 - -// A list of objects -typedef CComPtr CComUnkPtr; -typedef std::vector ObjectList; - -class CWebShellContainer; - -///////////////////////////////////////////////////////////////////////////// -// CMozillaBrowser -class ATL_NO_VTABLE CMozillaBrowser : - public CComObjectRootEx, - public CComCoClass, - public CComControl, - public CDWebBrowserEvents1, - public CDWebBrowserEvents2, - public CStockPropImpl, - public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents2, &LIBID_MOZILLACONTROLLib>, - public IPersistStreamInitImpl, - public IPersistStorageImpl, - public IQuickActivateImpl, - public IOleControlImpl, - public IOleObjectImpl, - public IOleInPlaceActiveObjectImpl, - public IViewObjectExImpl, - public IOleInPlaceObjectWindowlessImpl, - public IDataObjectImpl, - public ISupportErrorInfo, - public IOleCommandTargetImpl, - public IConnectionPointContainerImpl, - public ISpecifyPropertyPagesImpl -{ - friend CWebShellContainer; -public: - CMozillaBrowser(); - virtual ~CMozillaBrowser(); - -DECLARE_REGISTRY_RESOURCEID(IDR_MOZILLABROWSER) - -BEGIN_COM_MAP(CMozillaBrowser) - // IE web browser interface - COM_INTERFACE_ENTRY(IWebBrowser2) //CMozillaBrowser Derives from IWebBrowser2 - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IWebBrowser2) //Requests to IWebBrowser will actually get the vtable of IWebBrowser2 - COM_INTERFACE_ENTRY_IID(IID_IWebBrowser, IWebBrowser2) //ditto - COM_INTERFACE_ENTRY_IID(IID_IWebBrowserApp, IWebBrowser2) //ditto - COM_INTERFACE_ENTRY_IMPL(IViewObjectEx) //CMozillaBrowser derives from IViewObjectEx - COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx) //Request to IViewObject2 will actually get the vtable of IViewObjectEx - COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx) - COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject) - COM_INTERFACE_ENTRY_IMPL(IOleControl) - COM_INTERFACE_ENTRY_IMPL(IOleObject) -// COM_INTERFACE_ENTRY_IMPL(IQuickActivate) // This causes size assertion in ATL - COM_INTERFACE_ENTRY_IMPL(IPersistStorage) - COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit) - COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages) - COM_INTERFACE_ENTRY_IMPL(IDataObject) - COM_INTERFACE_ENTRY(IOleCommandTarget) - COM_INTERFACE_ENTRY(IProvideClassInfo) - COM_INTERFACE_ENTRY(IProvideClassInfo2) - COM_INTERFACE_ENTRY(ISupportErrorInfo) - COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer) - COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents, CDWebBrowserEvents1) //Requests to DWebBrowserEvents will get the vtable of CDWebBrowserEvents1 - COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, CDWebBrowserEvents2) //Requests to DWebBrowserEvents2 will get the vtable of CDWebBrowserEvents2 -END_COM_MAP() - -BEGIN_PROPERTY_MAP(CMozillaBrowser) - // Example entries - // PROP_ENTRY("Property Description", dispid, clsid) - PROP_PAGE(CLSID_StockColorPage) -END_PROPERTY_MAP() - - -BEGIN_CONNECTION_POINT_MAP(CMozillaBrowser) - // Fires IE events - CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents2) //Connection points for the client's event sinks - CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents) -END_CONNECTION_POINT_MAP() - - -BEGIN_MSG_MAP(CMozillaBrowser) - MESSAGE_HANDLER(WM_CREATE, OnCreate) - MESSAGE_HANDLER(WM_DESTROY, OnDestroy) - MESSAGE_HANDLER(WM_SIZE, OnSize) - MESSAGE_HANDLER(WM_PAINT, OnPaint) - MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus) - MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus) - COMMAND_ID_HANDLER(ID_PRINT, OnPrint) - COMMAND_ID_HANDLER(ID_PAGESETUP, OnPageSetup) - COMMAND_ID_HANDLER(ID_SAVEAS, OnSaveAs) - COMMAND_ID_HANDLER(ID_PROPERTIES, OnProperties) - COMMAND_ID_HANDLER(ID_CUT, OnCut) - COMMAND_ID_HANDLER(ID_COPY, OnCopy) - COMMAND_ID_HANDLER(ID_PASTE, OnPaste) - COMMAND_ID_HANDLER(ID_SELECTALL, OnSelectAll)\ -END_MSG_MAP() - - static HRESULT _stdcall EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - static HRESULT _stdcall EditCommandHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - -BEGIN_OLECOMMAND_TABLE() - // Standard "common" commands - OLECOMMAND_MESSAGE(OLECMDID_PRINT, NULL, ID_PRINT, L"Print", L"Print the page") - OLECOMMAND_MESSAGE(OLECMDID_PAGESETUP, NULL, ID_PAGESETUP, L"Page Setup", L"Page Setup") - OLECOMMAND_MESSAGE(OLECMDID_UNDO, NULL, 0, L"Undo", L"Undo") - OLECOMMAND_MESSAGE(OLECMDID_REDO, NULL, 0, L"Redo", L"Redo") - OLECOMMAND_MESSAGE(OLECMDID_REFRESH, NULL, 0, L"Refresh", L"Refresh") - OLECOMMAND_MESSAGE(OLECMDID_STOP, NULL, 0, L"Stop", L"Stop") - OLECOMMAND_MESSAGE(OLECMDID_ONUNLOAD, NULL, 0, L"OnUnload", L"OnUnload") - OLECOMMAND_MESSAGE(OLECMDID_SAVEAS, NULL, ID_SAVEAS, L"SaveAs", L"Save the page") - OLECOMMAND_MESSAGE(OLECMDID_CUT, NULL, ID_CUT, L"Cut", L"Cut selection") - OLECOMMAND_MESSAGE(OLECMDID_COPY, NULL, ID_COPY, L"Copy", L"Copy selection") - OLECOMMAND_MESSAGE(OLECMDID_PASTE, NULL, ID_PASTE, L"Paste", L"Paste as selection") - OLECOMMAND_MESSAGE(OLECMDID_SELECTALL, NULL, ID_SELECTALL, L"SelectAll", L"Select all") - OLECOMMAND_MESSAGE(OLECMDID_PROPERTIES, NULL, ID_PROPERTIES, L"Properties", L"Show page properties") - // Unsupported IE 4.x command group - OLECOMMAND_MESSAGE(HTMLID_FIND, &CGID_IWebBrowser_Moz, 0, L"Find", L"Find") - OLECOMMAND_MESSAGE(HTMLID_VIEWSOURCE, &CGID_IWebBrowser_Moz, 0, L"ViewSource", L"View Source") - OLECOMMAND_MESSAGE(HTMLID_OPTIONS, &CGID_IWebBrowser_Moz, 0, L"Options", L"Options") - // DHTML editor command group - OLECOMMAND_HANDLER(IDM_EDITMODE, &CGID_MSHTML_Moz, EditModeHandler, L"EditMode", L"Switch to edit mode") - OLECOMMAND_HANDLER(IDM_BROWSEMODE, &CGID_MSHTML_Moz, EditModeHandler, L"UserMode", L"Switch to user mode") - OLECOMMAND_HANDLER(IDM_BOLD, &CGID_MSHTML_Moz, EditCommandHandler, L"Bold", L"Toggle Bold") - OLECOMMAND_HANDLER(IDM_ITALIC, &CGID_MSHTML_Moz, EditCommandHandler, L"Italic", L"Toggle Italic") - OLECOMMAND_HANDLER(IDM_UNDERLINE, &CGID_MSHTML_Moz, EditCommandHandler, L"Underline", L"Toggle Underline") - OLECOMMAND_HANDLER(IDM_UNKNOWN, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNBOTTOM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNHORIZONTALCENTERS, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNLEFT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNRIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNTOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNTOP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNVERTICALCENTERS, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ARRANGEBOTTOM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ARRANGERIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BRINGFORWARD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BRINGTOFRONT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CENTERHORIZONTALLY, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CENTERVERTICALLY, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CODE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_DELETE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONTNAME, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONTSIZE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_GROUP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACECONCATENATE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEDECREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEINCREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEMAKEEQUAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_INSERTOBJECT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MULTILEVELREDO, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SENDBACKWARD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SENDTOBACK, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHOWTABLE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROLHEIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROLWIDTH, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOFIT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SNAPTOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_TABORDER, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_TOOLBOX, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MULTILEVELUNDO, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_UNGROUP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACECONCATENATE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEDECREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEINCREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEMAKEEQUAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYFULL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BACKCOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BORDERCOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FLAT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FORECOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYCENTER, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYGENERAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYLEFT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYRIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_RAISED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SUNKEN, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CHISELED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ETCHED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHADOWED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FIND, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHOWGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST0, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST1, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST2, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST3, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST4, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST5, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST6, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST7, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST8, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST9, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLISTLAST, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CONVERTOBJECT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CUSTOMCONTROL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CUSTOMIZEITEM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_RENAME, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_IMPORT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_NEWPAGE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MOVE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CANCEL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_STRIKETHROUGH, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_DELETEWORD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_EXECPRINT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYNONE, &CGID_MSHTML_Moz, NULL, L"", L"") -END_OLECOMMAND_TABLE() - - HWND GetCommandTargetWindow() const - { - return m_hWnd; - } - -// Windows message handlers - LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnPageSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnViewSource(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - - LRESULT OnSaveAs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnCut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnPaste(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnSelectAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - -// ISupportsErrorInfo - STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); - -// IViewObjectEx - STDMETHOD(GetViewStatus)(DWORD* pdwStatus) - { - ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n")); - *pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE; - return S_OK; - } - -// Protected members -protected: - // Flag to prevent multiple object registrations - static BOOL m_bRegistryInitialized; - - // Pointer to web shell manager - CWebShellContainer * m_pWebShellContainer; - // CComObject to IHTMLDocument implementer - CIEHtmlDocumentInstance * m_pDocument; - - // Mozilla interfaces - nsIWebShell * m_pIWebShell; - nsIBaseWindow * m_pIWebShellWin; - nsIPref * m_pIPref; - nsIEditor * m_pEditor; - nsIServiceManager * m_pIServiceManager; - - // System registry key for various control settings - CRegKey m_SystemKey; - // User registry key for various control settings - CRegKey m_UserKey; - // Indicates the browser is busy doing something - BOOL m_bBusy; - // Flag to indicate if browser is in edit mode or not - BOOL m_bEditorMode; - // Flag to indicate if the browser has a drop target - BOOL m_bDropTarget; - // Contains an error message if startup went wrong - tstring m_sErrorMessage; - // Property list - PropertyList m_PropertyList; - // Ready status of control - READYSTATE m_nBrowserReadyState; - // List of registered browser helper objects - ObjectList m_cBrowserHelperList; - // Post data from last navigate operation - CComVariant m_vLastPostData; - - virtual HRESULT CreateWebShell(); - virtual HRESULT InitWebShell(); - virtual HRESULT TermWebShell(); - virtual HRESULT SetErrorInfo(LPCTSTR lpszDesc, HRESULT hr); - virtual HRESULT GetPresShell(nsIPresShell **pPresShell); - virtual HRESULT GetDOMDocument(nsIDOMDocument **pDocument); - virtual HRESULT SetEditorMode(BOOL bEnabled); - virtual HRESULT OnEditorCommand(DWORD nCmdID); - virtual BOOL IsValid(); - virtual int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = _T(""), UINT nType = MB_OK); - - virtual HRESULT LoadBrowserHelpers(); - virtual HRESULT UnloadBrowserHelpers(); - -public: -// IOleObjectImpl overrides - HRESULT InPlaceActivate(LONG iVerb, const RECT* prcPosRect); - -// IOleObject overrides - virtual HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetClientSite(IOleClientSite **ppClientSite); - - -// IWebBrowser implementation - virtual HRESULT STDMETHODCALLTYPE GoBack(void); - virtual HRESULT STDMETHODCALLTYPE GoForward(void); - virtual HRESULT STDMETHODCALLTYPE GoHome(void); - virtual HRESULT STDMETHODCALLTYPE GoSearch(void); - virtual HRESULT STDMETHODCALLTYPE Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers); - virtual HRESULT STDMETHODCALLTYPE Refresh(void); - virtual HRESULT STDMETHODCALLTYPE Refresh2(VARIANT __RPC_FAR *Level); - virtual HRESULT STDMETHODCALLTYPE Stop( void); - virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool); - virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR __RPC_FAR *Type); - virtual HRESULT STDMETHODCALLTYPE get_Left(long __RPC_FAR *pl); - virtual HRESULT STDMETHODCALLTYPE put_Left(long Left); - virtual HRESULT STDMETHODCALLTYPE get_Top(long __RPC_FAR *pl); - virtual HRESULT STDMETHODCALLTYPE put_Top(long Top); - virtual HRESULT STDMETHODCALLTYPE get_Width(long __RPC_FAR *pl); - virtual HRESULT STDMETHODCALLTYPE put_Width(long Width); - virtual HRESULT STDMETHODCALLTYPE get_Height(long __RPC_FAR *pl); - virtual HRESULT STDMETHODCALLTYPE put_Height(long Height); - virtual HRESULT STDMETHODCALLTYPE get_LocationName(BSTR __RPC_FAR *LocationName); - virtual HRESULT STDMETHODCALLTYPE get_LocationURL(BSTR __RPC_FAR *LocationURL); - virtual HRESULT STDMETHODCALLTYPE get_Busy(VARIANT_BOOL __RPC_FAR *pBool); - -// IWebBrowserApp implementation - virtual HRESULT STDMETHODCALLTYPE Quit(void); - virtual HRESULT STDMETHODCALLTYPE ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy); - virtual HRESULT STDMETHODCALLTYPE PutProperty(BSTR Property, VARIANT vtValue); - virtual HRESULT STDMETHODCALLTYPE GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue); - virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR __RPC_FAR *Name); - virtual HRESULT STDMETHODCALLTYPE get_HWND(long __RPC_FAR *pHWND); - virtual HRESULT STDMETHODCALLTYPE get_FullName(BSTR __RPC_FAR *FullName); - virtual HRESULT STDMETHODCALLTYPE get_Path(BSTR __RPC_FAR *Path); - virtual HRESULT STDMETHODCALLTYPE get_Visible(VARIANT_BOOL __RPC_FAR *pBool); - virtual HRESULT STDMETHODCALLTYPE put_Visible(VARIANT_BOOL Value); - virtual HRESULT STDMETHODCALLTYPE get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool); - virtual HRESULT STDMETHODCALLTYPE put_StatusBar(VARIANT_BOOL Value); - virtual HRESULT STDMETHODCALLTYPE get_StatusText(BSTR __RPC_FAR *StatusText); - virtual HRESULT STDMETHODCALLTYPE put_StatusText(BSTR StatusText); - virtual HRESULT STDMETHODCALLTYPE get_ToolBar(int __RPC_FAR *Value); - virtual HRESULT STDMETHODCALLTYPE put_ToolBar(int Value); - virtual HRESULT STDMETHODCALLTYPE get_MenuBar(VARIANT_BOOL __RPC_FAR *Value); - virtual HRESULT STDMETHODCALLTYPE put_MenuBar(VARIANT_BOOL Value); - virtual HRESULT STDMETHODCALLTYPE get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen); - virtual HRESULT STDMETHODCALLTYPE put_FullScreen(VARIANT_BOOL bFullScreen); - -// IWebBrowser2 implementation - virtual HRESULT STDMETHODCALLTYPE Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers); - virtual HRESULT STDMETHODCALLTYPE QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf); - virtual HRESULT STDMETHODCALLTYPE ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut); - virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize); - virtual HRESULT STDMETHODCALLTYPE get_ReadyState(READYSTATE __RPC_FAR *plReadyState); - virtual HRESULT STDMETHODCALLTYPE get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline); - virtual HRESULT STDMETHODCALLTYPE put_Offline(VARIANT_BOOL bOffline); - virtual HRESULT STDMETHODCALLTYPE get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent); - virtual HRESULT STDMETHODCALLTYPE put_Silent(VARIANT_BOOL bSilent); - virtual HRESULT STDMETHODCALLTYPE get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister); - virtual HRESULT STDMETHODCALLTYPE put_RegisterAsBrowser(VARIANT_BOOL bRegister); - virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister); - virtual HRESULT STDMETHODCALLTYPE put_RegisterAsDropTarget(VARIANT_BOOL bRegister); - virtual HRESULT STDMETHODCALLTYPE get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister); - virtual HRESULT STDMETHODCALLTYPE put_TheaterMode(VARIANT_BOOL bRegister); - virtual HRESULT STDMETHODCALLTYPE get_AddressBar(VARIANT_BOOL __RPC_FAR *Value); - virtual HRESULT STDMETHODCALLTYPE put_AddressBar(VARIANT_BOOL Value); - virtual HRESULT STDMETHODCALLTYPE get_Resizable(VARIANT_BOOL __RPC_FAR *Value); - virtual HRESULT STDMETHODCALLTYPE put_Resizable(VARIANT_BOOL Value); - -public: - HRESULT OnDraw(ATL_DRAWINFO& di); - -}; - -#endif //__MOZILLABROWSER_H_ diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.htm b/mozilla/webshell/embed/ActiveX/MozillaBrowser.htm deleted file mode 100644 index 3053476c802..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - - -ATL 2.0 test page for object MozillaBrowser - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
Back
Forward
Netscape
Yahoo!
Microsoft
Linux.org
CNN
 
-
- - diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.ico b/mozilla/webshell/embed/ActiveX/MozillaBrowser.ico deleted file mode 100644 index 01c6f785d3e017ea6566acd7417bd92193112f33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4710 zcmeH~PiP!f9LImVNp-1#B(mF6in}i!rYqgXo!vtN#Tpl(fkL9Bdnwe@;7vTWh|oc> ziUukOC39)RMnwli>9MChd9ZVCF9w1=RBFH!FQKh@etz%mCQaOwdhld_yT5tw_vih7 z-}${a^WKQ$WLV1OF;V(0FY+es*qE1toJeg*u&Y(%+k(iMVYPet-2)<9BO(D}89oVX zJf)aegDJ*{C60Z=m9BKVU0O9*_ZMrm2lG>vUUsN3|N4%gy|)*3$p;qR+6!QpJQa`S zxwCDWUwE-Ty)DU9E@wJvPd270!};md%SObQ$v5(;myI!H6b4c4`LZ$9vf%9Hx=HJu z&XjtmlOjVV?P#|=#HB+dZ6?#|iiWR?YE!~ZrpwiQYJ8ZowxYCmurqHH4dGD_w zQUZ0#Z3S>=bnsQ}eRQ3{2BM5m!vFATMmZ5;LrmKdDxc!p7*vYuL;0I8o%{ z18aNXo#w&^KRoOx`X0qM(sVhU>WeIe8|m_o+oE;~z1)4}r#s$G#lm_DvUZDg@Hjt0 zR^AXAv0cA(wupr&oA3s_26ua`eYM*d#%OVZbBuo;9)(}BkGdD_)&-W_`|v~9ldkhI zxD5B#d6)iRido}WSktcIO84p4dG2EdL%BKM9vCy)sh9Iie%|CwHDx(f%T?Chv|9lk zW>Ko0ytW#)qQ`0~N@Ioi=r9=LTDC`|>+W6o z;=Aw35W*3hz?m0AbRoJBU8p*4L|r2E5uFHqgg!#A!xHof`UD|CpP;9a41I<^L!Y6@ zv>?b9*=8BB?3phidHfIAl~=0+Dsm_I zxl)rm0aHTKgaiqg5^^UP6LKfyPRQ-1!{tU#{)GGq`E`mC@+Z_L0Yd_YggWT7Q5ARh zXlS|WG*W|%d>Pm>aAf3jQ>!?rK?aUYad2a9x*3##B?C(ah>V1834kSIV1`qMA_EJ5 zm^jQy29`|g;jrjx&{;qS1`7rY1`7rY1`7taoWPKQ!GghpAp-+pVEn;g!C=8)!9Zvj zJs2z)EEp^REcr8nSq561B4R|y5jd=itv-=d-!eg9^mRXg6kRK*1-04$qs(gb62@As zvD<#ERtx4@SjW}efOhOP&{PcSASf1#J@d95E#bJKiiTCv(T#q7Z&tObm~CsLk8e%~ z_lXd0tPc0%fz>Beji6$@14_lGHs|b}7*+{%EPu84%t)ZqMEHW%rxZ~~N6xMe8jCy8 z;ncV3t*We10q(ES&`PKrX#Jawo=Yzf_Q1u!UQ&F}86QNU^wYWUGv3U#?L79FgB`mI z(j?Qb^FA1^L1~v=+E$8J*L$%PU8$enr&+RMu34G2noEa&zMbB8u36jEbA&V3PVKRZ zEG=DY;LvXLYrDr|*4+juD~-nd9-E3q&Ifvx7!-F=qRbKQS%p8M=am1= zIc1%#-@Qh81t|S~qO?mconRODCOLZaXz4H;vfIb!I8amqwnpC2*!`v)u$A({M%29t zLcvvzsaL>u$zG|l+XLM;ucAAbuurv{&2|%ik7wzsumzoEL~mbOwM(lOdk+n-_ICSh zt=9XTL|dF~A9Jz#9=!PnzTLOK1=swyGoQ`>_#RZ9ekVTCZ$afz&Uo*+W1svD!0_@; diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.rgs b/mozilla/webshell/embed/ActiveX/MozillaBrowser.rgs deleted file mode 100644 index 4bf4b5113df..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.rgs +++ /dev/null @@ -1,34 +0,0 @@ -HKCR -{ - Mozilla.Browser.1 = s 'Mozilla Web Browser' - { - CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}' - } - Mozilla.Browser = s 'Mozilla Web Browser' - { - CurVer = s 'Mozilla.Browser.1' - } - NoRemove CLSID - { - ForceRemove {1339B54C-3453-11D2-93B9-000000000000} = s 'MozillaBrowser Class' - { - ProgID = s 'Mozilla.Browser.1' - VersionIndependentProgID = s 'Mozilla.Browser' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - ForceRemove 'Control' - ForceRemove 'Programmable' - ForceRemove 'Insertable' - ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 1' - 'MiscStatus' = s '0' - { - '1' = s '131473' - } - 'TypeLib' = s '{1339B53E-3453-11D2-93B9-000000000000}' - 'Version' = s '1.0' - } - } -} diff --git a/mozilla/webshell/embed/ActiveX/MozillaControl.cpp b/mozilla/webshell/embed/ActiveX/MozillaControl.cpp deleted file mode 100644 index 6c867d27715..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControl.cpp +++ /dev/null @@ -1,105 +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.org 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): - */ - -// MozillaControl.cpp : Implementation of DLL Exports. - - -// Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, -// run nmake -f MozillaControlps.mk in the project directory. - -#include "stdafx.h" -#include "resource.h" -#include "initguid.h" -#include "MozillaControl.h" - -#include "MozillaControl_i.c" -#ifdef USE_CONTROL -#include "MozillaBrowser.h" -#endif - -CComModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) -#ifdef USE_CONTROL - OBJECT_ENTRY(CLSID_MozillaBrowser, CMozillaBrowser) -#endif -END_OBJECT_MAP() - -///////////////////////////////////////////////////////////////////////////// -// DLL Entry Point - -extern "C" -BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) -{ - NG_TRACE_METHOD(DllMain); - - if (dwReason == DLL_PROCESS_ATTACH) - { - NG_TRACE(_T("Mozilla ActiveX - DLL_PROCESS_ATTACH\n")); - _Module.Init(ObjectMap, hInstance); - DisableThreadLibraryCalls(hInstance); - } - else if (dwReason == DLL_PROCESS_DETACH) - { - NG_TRACE(_T("Mozilla ActiveX - DLL_PROCESS_DETACH\n")); - _Module.Term(); - } - - return TRUE; // ok -} - -///////////////////////////////////////////////////////////////////////////// -// Used to determine whether the DLL can be unloaded by OLE - -STDAPI DllCanUnloadNow(void) -{ - return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; -} - -///////////////////////////////////////////////////////////////////////////// -// Returns a class factory to create an object of the requested type - -STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) -{ - return _Module.GetClassObject(rclsid, riid, ppv); -} - -///////////////////////////////////////////////////////////////////////////// -// DllRegisterServer - Adds entries to the system registry - -STDAPI DllRegisterServer(void) -{ - // registers object, typelib and all interfaces in typelib - return _Module.RegisterServer(TRUE); -} - -///////////////////////////////////////////////////////////////////////////// -// DllUnregisterServer - Removes entries from the system registry - -STDAPI DllUnregisterServer(void) -{ - _Module.UnregisterServer(); - return S_OK; -} - - diff --git a/mozilla/webshell/embed/ActiveX/MozillaControl.dsp b/mozilla/webshell/embed/ActiveX/MozillaControl.dsp deleted file mode 100644 index 58b5c125994..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControl.dsp +++ /dev/null @@ -1,317 +0,0 @@ -# Microsoft Developer Studio Project File - Name="MozillaControl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=MozillaControl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "MozillaControl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "MozillaControl.mak" CFG="MozillaControl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "MozillaControl - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "MozillaControl - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "MozillaControl - Win32 Release" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f MozillaControl.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "MozillaControl.exe" -# PROP BASE Bsc_Name "MozillaControl.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "NMAKE /f MozillaControl.mak" -# PROP Rebuild_Opt "/a" -# PROP Target_File "MozillaControl.exe" -# PROP Bsc_Name "MozillaControl.bsc" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "MozillaControl - Win32 Debug" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f MozillaControl.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "MozillaControl.exe" -# PROP BASE Bsc_Name "MozillaControl.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "NMAKE /f makefile.win control_and_plugin" -# PROP Rebuild_Opt "/a" -# PROP Target_File "M:\moz\mozilla\dist\WIN32_D.OBJ\bin\npmozctl.dll" -# PROP Bsc_Name "MozillaControl.bsc" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "MozillaControl - Win32 Release" -# Name "MozillaControl - Win32 Debug" - -!IF "$(CFG)" == "MozillaControl - Win32 Release" - -!ELSEIF "$(CFG)" == "MozillaControl - Win32 Debug" - -!ENDIF - -# Begin Group "Source Files" - -# PROP Default_Filter "*.cpp,*.c,*.idl,*.rc" -# Begin Source File - -SOURCE=.\ActiveScriptSite.cpp -# End Source File -# Begin Source File - -SOURCE=.\ActiveXPlugin.cpp -# End Source File -# Begin Source File - -SOURCE=.\ActiveXPluginInstance.cpp -# End Source File -# Begin Source File - -SOURCE=.\ControlSite.cpp -# End Source File -# Begin Source File - -SOURCE=.\ControlSiteIPFrame.cpp -# End Source File -# Begin Source File - -SOURCE=.\DropTarget.cpp -# End Source File -# Begin Source File - -SOURCE=.\guids.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlDocument.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlElement.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlElementCollection.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlNode.cpp -# End Source File -# Begin Source File - -SOURCE=.\ItemContainer.cpp -# End Source File -# Begin Source File - -SOURCE=.\LegacyPlugin.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.idl -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.rc -# End Source File -# Begin Source File - -SOURCE=.\npmozctl.def -# End Source File -# Begin Source File - -SOURCE=.\npwin.cpp -# End Source File -# Begin Source File - -SOURCE=.\nsSetupRegistry.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropertyBag.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# End Source File -# Begin Source File - -SOURCE=.\WebShellContainer.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ActiveScriptSite.h -# End Source File -# Begin Source File - -SOURCE=.\ActiveXPlugin.h -# End Source File -# Begin Source File - -SOURCE=.\ActiveXPluginInstance.h -# End Source File -# Begin Source File - -SOURCE=.\ActiveXTypes.h -# End Source File -# Begin Source File - -SOURCE=.\BrowserDiagnostics.h -# End Source File -# Begin Source File - -SOURCE=.\ControlSite.h -# End Source File -# Begin Source File - -SOURCE=.\ControlSiteIPFrame.h -# End Source File -# Begin Source File - -SOURCE=.\CPMozillaControl.h -# End Source File -# Begin Source File - -SOURCE=.\DHTMLCmdIds.h -# End Source File -# Begin Source File - -SOURCE=.\DropTarget.h -# End Source File -# Begin Source File - -SOURCE=.\guids.h -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlDocument.h -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlElement.h -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlElementCollection.h -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlNode.h -# End Source File -# Begin Source File - -SOURCE=.\IOleCommandTargetImpl.h -# End Source File -# Begin Source File - -SOURCE=.\ItemContainer.h -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.h -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.h -# End Source File -# Begin Source File - -SOURCE=.\PropertyBag.h -# End Source File -# Begin Source File - -SOURCE=.\PropertyList.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# Begin Source File - -SOURCE=.\WebShellContainer.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\MozillaBrowser.ico -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.rgs -# End Source File -# End Group -# Begin Group "Mozilla Headers" - -# PROP Default_Filter "" -# End Group -# Begin Group "Make Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\config\config.mak -# End Source File -# Begin Source File - -SOURCE=..\..\..\config\config.mk -# End Source File -# Begin Source File - -SOURCE=..\..\..\config\rules.mak -# End Source File -# End Group -# Begin Source File - -SOURCE=.\makefile.win -# End Source File -# Begin Source File - -SOURCE=.\mkctldef.bat -# End Source File -# End Target -# End Project diff --git a/mozilla/webshell/embed/ActiveX/MozillaControl.html b/mozilla/webshell/embed/ActiveX/MozillaControl.html deleted file mode 100644 index f5c87fe4712..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControl.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - -

Mozilla Control

- - diff --git a/mozilla/webshell/embed/ActiveX/MozillaControl.idl b/mozilla/webshell/embed/ActiveX/MozillaControl.idl deleted file mode 100644 index 5c19af65e16..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControl.idl +++ /dev/null @@ -1,433 +0,0 @@ -#include -// MozillaControl.idl : IDL source for MozillaControl.dll -// - -// This file will be processed by the MIDL tool to -// produce the type library (MozillaControl.tlb) and marshalling code. - -import "oaidl.idl"; -import "ocidl.idl"; -import "docobj.idl"; - -// See note below for why IWebBrowser is not imported this way -// import "exdisp.idl"; -#include - -[ - uuid(1339B53E-3453-11D2-93B9-000000000000), - version(1.0), - helpstring("MozillaControl 1.0 Type Library") -] -library MOZILLACONTROLLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - // Stop interfaces and other bits from being redefined by the IE header file - - cpp_quote("#ifndef __exdisp_h__") - cpp_quote("#define __exdisp_h__") - - // NOTE: There is a very specific reason for repeating the IWebBrowser - // and other bits verbatim rather than import'ing exdisp.idl - - // MIDL fails with a MIDL2020 error if we try that! - - [ - uuid(EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B), // IID_IWebBrowser - helpstring("Web Browser interface"), - helpcontext(0x0000), - hidden, - dual, - oleautomation, - odl - ] - interface IWebBrowser : IDispatch - { - [id(100), helpstring("Navigates to the previous item in the history list."), helpcontext(0x0000)] - HRESULT GoBack(); - [id(101), helpstring("Navigates to the next item in the history list."), helpcontext(0x0000)] - HRESULT GoForward(); - [id(102), helpstring("Go home/start page."), helpcontext(0x0000)] - HRESULT GoHome(); - [id(103), helpstring("Go Search Page."), helpcontext(0x0000)] - HRESULT GoSearch(); - - [id(104), helpstring("Navigates to a URL or file."), helpcontext(0x0000)] - HRESULT Navigate([in] BSTR URL, - [in, optional] VARIANT * Flags, - [in, optional] VARIANT * TargetFrameName, - [in, optional] VARIANT * PostData, - [in, optional] VARIANT * Headers); - typedef - [ - uuid(14EE5380-A378-11cf-A731-00A0C9082637), - helpstring("Constants for WebBrowser navigation flags") - ] - enum BrowserNavConstants { - [helpstring("Open in new window")] navOpenInNewWindow = 0x0001, - [helpstring("Exclude from history list")] navNoHistory = 0x0002, - [helpstring("Don't read from cache")] navNoReadFromCache = 0x0004, - [helpstring("Don't write from cache")] navNoWriteToCache = 0x0008, - [helpstring("Try other sites on failure")] navAllowAutosearch = 0x0010, - [helpstring("OpenBrowserBar")] navBrowserBar = 0x0020, - } BrowserNavConstants; - - [id(DISPID_REFRESH), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)] - HRESULT Refresh(); - - // The standard Refresh takes no parameters and we need some... use a new name - [id(105), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)] - HRESULT Refresh2([in,optional] VARIANT * Level); - - typedef - [ - uuid(C317C261-A991-11cf-A731-00A0C9082637), - helpstring("Constants for Refresh") - ] - enum RefreshConstants { // must map to these in sdk\inc\docobj.h - [helpstring("Refresh normal")] REFRESH_NORMAL = 0, //== OLECMDIDF_REFRESH_NORMAL - [helpstring("Refresh if expired")] REFRESH_IFEXPIRED = 1, //== OLECMDIDF_REFRESH_IFEXPIRED - [helpstring("Refresh completely")] REFRESH_COMPLETELY = 3 //== OLECMDIDF_REFRESH_COMPLETELY - } RefreshConstants; - - [id(106), helpstring("Stops opening a file."), helpcontext(0x0000)] - HRESULT Stop(); - - // Automation heirarchy... - [id(200), propget, helpstring("Returns the application automation object if accessible, this automation object otherwise.."), helpcontext(0x0000)] - HRESULT Application([out,retval] IDispatch** ppDisp); - - [id(201), propget, helpstring("Returns the automation object of the container/parent if one exists or this automation object."), helpcontext(0x0000)] - HRESULT Parent([out,retval] IDispatch** ppDisp); - - [id(202), propget, helpstring("Returns the container/parent automation object, if any."), helpcontext(0x0000)] - HRESULT Container([out,retval] IDispatch** ppDisp); - - [id(203), propget, helpstring("Returns the active Document automation object, if any."), helpcontext(0x0000)] - HRESULT Document([out,retval] IDispatch** ppDisp); - - [id(204), propget, helpstring("Returns True if this is the top level object."), helpcontext(0x0000)] - HRESULT TopLevelContainer([out, retval] VARIANT_BOOL* pBool); - - [id(205), propget, helpstring("Returns the type of the contained document object."), helpcontext(0x0000)] - HRESULT Type([out,retval] BSTR* Type); - - // Window stuff... - [id(206), propget, helpstring("The horizontal position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)] - HRESULT Left([out, retval] long *pl); - [id(206), propput] - HRESULT Left([in] long Left); - [id(207), propget, helpstring("The vertical position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)] - HRESULT Top([out, retval] long *pl); - [id(207), propput] - HRESULT Top([in] long Top); - [id(208), propget, helpstring("The horizontal dimension (pixels) of the frame window/object."), helpcontext(0x0000)] - HRESULT Width([out, retval] long *pl); - [id(208), propput] - HRESULT Width([in] long Width); - [id(209), propget, helpstring("The vertical dimension (pixels) of the frame window/object."), helpcontext(0x0000)] - HRESULT Height([out, retval] long *pl); - [id(209), propput] - HRESULT Height([in] long Height); - - // WebBrowser stuff... - [id(210), propget, helpstring("Gets the short (UI-friendly) name of the URL/file currently viewed."), helpcontext(0x0000)] - HRESULT LocationName([out,retval] BSTR *LocationName); - - [id(211), propget, helpstring("Gets the full URL/path currently viewed."), helpcontext(0x0000)] - HRESULT LocationURL([out,retval] BSTR * LocationURL); - - // Added a property to see if the viewer is currenly busy or not... - [id(212), propget, helpstring("Query to see if something is still in progress."), helpcontext(0x0000)] - HRESULT Busy([out,retval] VARIANT_BOOL *pBool); - } - - [ - uuid(0002DF05-0000-0000-C000-000000000046), // IID_IWebBrowserApp - helpstring("Web Browser Application Interface."), - helpcontext(0x0000), - hidden, - oleautomation, - dual - ] - interface IWebBrowserApp : IWebBrowser - { - [id(300), helpstring("Exits application and closes the open document."), helpcontext(0x0000)] - HRESULT Quit(); - - [id(301), helpstring("Converts client sizes into window sizes."), helpcontext(0x0000)] - HRESULT ClientToWindow([in,out] int* pcx, [in,out] int* pcy); - - [id(302), helpstring("Associates vtValue with the name szProperty in the context of the object."), helpcontext(0x0000)] - HRESULT PutProperty([in] BSTR Property, [in] VARIANT vtValue); - - [id(303), helpstring("Retrieve the Associated value for the property vtValue in the context of the object."), helpcontext(0x0000)] - HRESULT GetProperty([in] BSTR Property, [out, retval] VARIANT *pvtValue); - - [id(0), propget, helpstring("Returns name of the application."), helpcontext(0x0000)] - HRESULT Name([out,retval] BSTR* Name); - - [id(DISPID_HWND), propget, helpstring("Returns the HWND of the current IE window."), helpcontext(0x0000)] - HRESULT HWND([out,retval] long *pHWND); - - [id(400), propget, helpstring("Returns file specification of the application, including path."), helpcontext(0x0000)] - HRESULT FullName([out,retval] BSTR* FullName); - - [id(401), propget, helpstring("Returns the path to the application."), helpcontext(0x0000)] - HRESULT Path([out,retval] BSTR* Path); - - [id(402), propget, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)] - HRESULT Visible([out, retval] VARIANT_BOOL* pBool); - [id(402), propput, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)] - HRESULT Visible([in] VARIANT_BOOL Value); - - [id(403), propget, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)] - HRESULT StatusBar([out, retval] VARIANT_BOOL* pBool); - [id(403), propput, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)] - HRESULT StatusBar([in] VARIANT_BOOL Value); - - [id(404), propget, helpstring("Text of Status window."), helpcontext(0x0000)] - HRESULT StatusText([out, retval] BSTR *StatusText); - [id(404), propput, helpstring("Text of Status window."), helpcontext(0x0000)] - HRESULT StatusText([in] BSTR StatusText); - - [id(405), propget, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)] - HRESULT ToolBar([out, retval] int * Value); - [id(405), propput, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)] - HRESULT ToolBar([in] int Value); - - [id(406), propget, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)] - HRESULT MenuBar([out, retval] VARIANT_BOOL * Value); - [id(406), propput, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)] - HRESULT MenuBar([in] VARIANT_BOOL Value); - - [id(407), propget, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)] - HRESULT FullScreen([out, retval] VARIANT_BOOL * pbFullScreen); - [id(407), propput, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)] - HRESULT FullScreen([in] VARIANT_BOOL bFullScreen); - } - - [ - uuid(D30C1661-CDAF-11d0-8A3E-00C04FC9E26E), // IID_IWebBrowser2 - helpstring("Web Browser Interface for IE4."), - helpcontext(0x0000), - hidden, - oleautomation, - dual - ] - interface IWebBrowser2 : IWebBrowserApp - { - [id(500), helpstring("Navigates to a URL or file or pidl."), helpcontext(0x0000)] - HRESULT Navigate2([in] VARIANT * URL, - [in, optional] VARIANT * Flags, - [in, optional] VARIANT * TargetFrameName, - [in, optional] VARIANT * PostData, - [in, optional] VARIANT * Headers); - - - [id(501), helpstring("IOleCommandTarget::QueryStatus"), helpcontext(0x0000)] - HRESULT QueryStatusWB([in] OLECMDID cmdID, [out, retval] OLECMDF * pcmdf); - [id(502), helpstring("IOleCommandTarget::Exec"), helpcontext(0x0000)] - HRESULT ExecWB([in] OLECMDID cmdID, [in] OLECMDEXECOPT cmdexecopt, [in, optional] VARIANT * pvaIn, [out, in, optional] VARIANT * pvaOut); - [id(503), helpstring("Set BrowserBar to Clsid"), helpcontext(0x0000)] - HRESULT ShowBrowserBar( [in] VARIANT * pvaClsid, - [in, optional] VARIANT * pvarShow, - [in, optional] VARIANT * pvarSize ); - - [id(DISPID_READYSTATE), propget, bindable] - HRESULT ReadyState([retval, out] READYSTATE * plReadyState); - - [id(550), propget, helpstring("Controls if the frame is offline (read from cache)"), helpcontext(0x0000)] - HRESULT Offline([out, retval] VARIANT_BOOL * pbOffline); - [id(550), propput, helpstring("Controls if the frame is offline (read from cache)"), helpcontext(0x0000)] - HRESULT Offline([in] VARIANT_BOOL bOffline); - - [id(551), propget, helpstring("Controls if any dialog boxes can be shown"), helpcontext(0x0000)] - HRESULT Silent([out, retval] VARIANT_BOOL * pbSilent); - [id(551), propput, helpstring("Controls if any dialog boxes can be shown"), helpcontext(0x0000)] - HRESULT Silent([in] VARIANT_BOOL bSilent); - - [id(552), propget, helpstring("Registers OC as a top-level browser (for target name resolution)"), helpcontext(0x0000)] - HRESULT RegisterAsBrowser([out, retval] VARIANT_BOOL * pbRegister); - [id(552), propput, helpstring("Registers OC as a top-level browser (for target name resolution)"), helpcontext(0x0000)] - HRESULT RegisterAsBrowser([in] VARIANT_BOOL bRegister); - - [id(553), propget, helpstring("Registers OC as a drop target for navigation"), helpcontext(0x0000)] - HRESULT RegisterAsDropTarget([out, retval] VARIANT_BOOL * pbRegister); - [id(553), propput, helpstring("Registers OC as a drop target for navigation"), helpcontext(0x0000)] - HRESULT RegisterAsDropTarget([in] VARIANT_BOOL bRegister); - - [id(554), propget, helpstring("Controls if the browser is in theater mode"), helpcontext(0x0000)] - HRESULT TheaterMode([out, retval] VARIANT_BOOL * pbRegister); - [id(554), propput, helpstring("Controls if the browser is in theater mode"), helpcontext(0x0000)] - HRESULT TheaterMode([in] VARIANT_BOOL bRegister); - - [id(555), propget, helpstring("Controls whether address bar is shown"), helpcontext(0x0000)] - HRESULT AddressBar([out, retval] VARIANT_BOOL * Value); - [id(555), propput, helpstring("Controls whether address bar is shown"), helpcontext(0x0000)] - HRESULT AddressBar([in] VARIANT_BOOL Value); - - [id(556), propget, helpstring("Controls whether the window is resizable"), helpcontext(0x0000)] - HRESULT Resizable([out, retval] VARIANT_BOOL * Value); - [id(556), propput, helpstring("Controls whether the window is resizable"), helpcontext(0x0000)] - HRESULT Resizable([in] VARIANT_BOOL Value); - } - - [ - uuid(EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B), // DIID_DWebBrowserEvents - helpstring("Web Browser Control Events (old)"), - hidden - ] - dispinterface DWebBrowserEvents - { - properties: - methods: - [id(DISPID_BEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to."), helpcontext(0x0000)] - void BeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]VARIANT_BOOL * Cancel); - - [id(DISPID_NAVIGATECOMPLETE), helpstring("Fired when the document being navigated to becomes visible and enters the navigation stack."), helpcontext(0x0000)] - void NavigateComplete([in] BSTR URL ); - - [id(DISPID_STATUSTEXTCHANGE), helpstring("Statusbar text changed."), helpcontext(0x0000)] - void StatusTextChange([in]BSTR Text); - - [id(DISPID_PROGRESSCHANGE), helpstring("Fired when download progress is updated."), helpcontext(0x0000)] - void ProgressChange([in] long Progress, [in] long ProgressMax); - - [id(DISPID_DOWNLOADCOMPLETE), helpstring("Download of page complete."), helpcontext(0x0000)] - void DownloadComplete(); - - [id(DISPID_COMMANDSTATECHANGE), helpstring("The enabled state of a command changed"), helpcontext(0x0000)] - void CommandStateChange([in] long Command, [in] VARIANT_BOOL Enable); - - [id(DISPID_DOWNLOADBEGIN), helpstring("Download of a page started."), helpcontext(0x000)] - void DownloadBegin(); - - [id(DISPID_NEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)] - void NewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] VARIANT_BOOL * Processed); - - [id(DISPID_TITLECHANGE), helpstring("Document title changed."), helpcontext(0x0000)] - void TitleChange([in]BSTR Text); - - [id(DISPID_FRAMEBEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)] - void FrameBeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]VARIANT_BOOL * Cancel); - - [id(DISPID_FRAMENAVIGATECOMPLETE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)] - void FrameNavigateComplete([in] BSTR URL ); - - [id(DISPID_FRAMENEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)] - void FrameNewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] VARIANT_BOOL * Processed); - - // The following are IWebBrowserApp specific: - // - [id(DISPID_QUIT), helpstring("Fired when application is quiting."), helpcontext(0x0000)] - void Quit([in, out] VARIANT_BOOL * Cancel); - - [id(DISPID_WINDOWMOVE), helpstring("Fired when window has been moved."), helpcontext(0x0000)] - void WindowMove(); - - [id(DISPID_WINDOWRESIZE), helpstring("Fired when window has been sized."), helpcontext(0x0000)] - void WindowResize(); - - [id(DISPID_WINDOWACTIVATE), helpstring("Fired when window has been activated."), helpcontext(0x0000)] - void WindowActivate(); - - [id(DISPID_PROPERTYCHANGE), helpstring("Fired when the PutProperty method has been called."), helpcontext(0x0000)] - void PropertyChange([in] BSTR Property); - } - - [ - uuid(34A715A0-6587-11D0-924A-0020AFC7AC4D), // IID_DWebBrowserEvents2 - helpstring("Web Browser Control events interface"), - hidden - ] - dispinterface DWebBrowserEvents2 - { - properties: - methods: - [id(DISPID_STATUSTEXTCHANGE), helpstring("Statusbar text changed."), helpcontext(0x0000)] - void StatusTextChange([in]BSTR Text); - - [id(DISPID_PROGRESSCHANGE), helpstring("Fired when download progress is updated."), helpcontext(0x0000)] - void ProgressChange([in] long Progress, [in] long ProgressMax); - - [id(DISPID_COMMANDSTATECHANGE), helpstring("The enabled state of a command changed."), helpcontext(0x0000)] - void CommandStateChange([in] long Command, [in] VARIANT_BOOL Enable); - - [id(DISPID_DOWNLOADBEGIN), helpstring("Download of a page started."), helpcontext(0x000)] - void DownloadBegin(); - - [id(DISPID_DOWNLOADCOMPLETE), helpstring("Download of page complete."), helpcontext(0x0000)] - void DownloadComplete(); - - [id(DISPID_TITLECHANGE), helpstring("Document title changed."), helpcontext(0x0000)] - void TitleChange([in] BSTR Text); - - [id(DISPID_PROPERTYCHANGE), helpstring("Fired when the PutProperty method has been called."), helpcontext(0x0000)] - void PropertyChange([in] BSTR szProperty); - - // New events for IE40: - // - [id(DISPID_BEFORENAVIGATE2), helpstring("Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified."), helpcontext(0x0000)] - void BeforeNavigate2([in] IDispatch* pDisp, - [in] VARIANT * URL, [in] VARIANT * Flags, [in] VARIANT * TargetFrameName, [in] VARIANT * PostData, [in] VARIANT * Headers, - [in,out] VARIANT_BOOL * Cancel); - - [id(DISPID_NEWWINDOW2), helpstring("A new, hidden, non-navigated WebBrowser window is needed."), helpcontext(0x0000)] - void NewWindow2([in, out] IDispatch** ppDisp, [in, out] VARIANT_BOOL * Cancel); - - [id(DISPID_NAVIGATECOMPLETE2), helpstring("Fired when the document being navigated to becomes visible and enters the navigation stack."), helpcontext(0x0000)] - void NavigateComplete2([in] IDispatch* pDisp, [in] VARIANT * URL ); - - [id(DISPID_DOCUMENTCOMPLETE), helpstring("Fired when the document being navigated to reaches ReadyState_Complete."), helpcontext(0x0000)] - void DocumentComplete([in] IDispatch* pDisp, [in] VARIANT * URL ); - - [id(DISPID_ONQUIT), helpstring("Fired when application is quiting."), helpcontext(0x0000)] - void OnQuit(); - - [id(DISPID_ONVISIBLE), helpstring("Fired when the window should be shown/hidden"), helpcontext(0x0000)] - void OnVisible([in] VARIANT_BOOL Visible); - - [id(DISPID_ONTOOLBAR), helpstring("Fired when the toolbar should be shown/hidden"), helpcontext(0x0000)] - void OnToolBar([in] VARIANT_BOOL ToolBar); - - [id(DISPID_ONMENUBAR), helpstring("Fired when the menubar should be shown/hidden"), helpcontext(0x0000)] - void OnMenuBar([in] VARIANT_BOOL MenuBar); - - [id(DISPID_ONSTATUSBAR), helpstring("Fired when the statusbar should be shown/hidden"), helpcontext(0x0000)] - void OnStatusBar([in] VARIANT_BOOL StatusBar); - - [id(DISPID_ONFULLSCREEN), helpstring("Fired when fullscreen mode should be on/off"), helpcontext(0x0000)] - void OnFullScreen([in] VARIANT_BOOL FullScreen); - - [id(DISPID_ONTHEATERMODE), helpstring("Fired when theater mode should be on/off"), helpcontext(0x0000)] - void OnTheaterMode([in] VARIANT_BOOL TheaterMode); - } - - typedef - [ - uuid(34A226E0-DF30-11CF-89A9-00A0C9054129), - helpstring("Constants for WebBrowser CommandStateChange") - ] - enum CommandStateChangeConstants { - [helpstring("Command Change")] CSC_UPDATECOMMANDS = 0xFFFFFFFF, - [helpstring("Navigate Forward")] CSC_NAVIGATEFORWARD = 0x00000001, - [helpstring("Navigate Back")] CSC_NAVIGATEBACK = 0x00000002, - } CommandStateChangeConstants; - - [ - uuid(1339B54C-3453-11D2-93B9-000000000000), - helpstring("MozillaBrowser Class") - ] - coclass MozillaBrowser - { - [default] interface IWebBrowser2; - interface IWebBrowser; - interface IWebBrowserApp; - interface IDispatch; - [source] dispinterface DWebBrowserEvents; - [default, source] dispinterface DWebBrowserEvents2; - }; - - cpp_quote("#endif") -}; diff --git a/mozilla/webshell/embed/ActiveX/MozillaControl.rc b/mozilla/webshell/embed/ActiveX/MozillaControl.rc deleted file mode 100644 index 2c0d23bb2cc..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControl.rc +++ /dev/null @@ -1,189 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "1 TYPELIB ""MozillaControl.tlb""\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Mozilla ActiveX control and plugin module\0" - VALUE "FileExtents", "*|*|*.axs\0" - VALUE "FileOpenName", "ActiveX (*.*)|ActiveX (*.*)|ActiveScript(*.axs)\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "NPMOZCTL\0" - VALUE "LegalCopyright", "Copyright 1999\0" - VALUE "LegalTrademarks", "\0" - VALUE "MIMEType", "application/x-oleobject|application/oleobject|text/x-activescript\0" - VALUE "OriginalFilename", "NPMOZCTL.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Mozilla ActiveX control and plugin support\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_MOZILLABROWSER REGISTRY DISCARDABLE "MozillaBrowser.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MOZILLABROWSER ICON DISCARDABLE "MozillaBrowser.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_POPUP_PAGE MENU DISCARDABLE -BEGIN - POPUP "Page Popup" - BEGIN - MENUITEM "&Back", ID_BROWSE_BACK - MENUITEM "&Forward", ID_BROWSE_FORWARD - MENUITEM SEPARATOR - MENUITEM "Select &All", ID_EDIT_SELECTALL - MENUITEM "&Paste", ID_EDIT_PASTE - MENUITEM SEPARATOR - MENUITEM "&View Source", ID_FILE_VIEWSOURCE - MENUITEM SEPARATOR - MENUITEM "Pr&int", ID_FILE_PRINT - MENUITEM "&Refresh", ID_FILE_REFRESH - MENUITEM SEPARATOR - MENUITEM "&Properties", ID_PAGE_PROPERTIES - END -END - -IDR_POPUP_LINK MENU DISCARDABLE -BEGIN - POPUP "Link Popup" - BEGIN - MENUITEM "&Open", ID_FILE_OPEN - MENUITEM "Open in &New Window", ID_FILE_OPENINNEWWINDOW - MENUITEM SEPARATOR - MENUITEM "Copy Shor&tcut", ID_EDIT_COPYSHORTCUT - MENUITEM SEPARATOR - MENUITEM "&Properties", ID_LINK_PROPERTIES - END -END - -IDR_POPUP_CLIPBOARD MENU DISCARDABLE -BEGIN - POPUP "Selection Popup" - BEGIN - MENUITEM "Cu&t", ID_EDIT_CUT, GRAYED - MENUITEM "&Copy", ID_EDIT_COPY - MENUITEM "&Paste", ID_EDIT_PASTE, GRAYED - MENUITEM "Select &All", ID_EDIT_SELECTALL - MENUITEM "Print", ID_SELECTIONPOPUP_PRINT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PROJNAME "MozillaControl" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -1 TYPELIB "MozillaControl.tlb" - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/mozilla/webshell/embed/ActiveX/MozillaControlps.def b/mozilla/webshell/embed/ActiveX/MozillaControlps.def deleted file mode 100644 index 4ae9180893b..00000000000 --- a/mozilla/webshell/embed/ActiveX/MozillaControlps.def +++ /dev/null @@ -1,11 +0,0 @@ - -LIBRARY "MozillaControlPS" - -DESCRIPTION 'Proxy/Stub DLL' - -EXPORTS - DllGetClassObject @1 PRIVATE - DllCanUnloadNow @2 PRIVATE - GetProxyDllInfo @3 PRIVATE - DllRegisterServer @4 PRIVATE - DllUnregisterServer @5 PRIVATE diff --git a/mozilla/webshell/embed/ActiveX/PropertyBag.cpp b/mozilla/webshell/embed/ActiveX/PropertyBag.cpp deleted file mode 100644 index 2165593b104..00000000000 --- a/mozilla/webshell/embed/ActiveX/PropertyBag.cpp +++ /dev/null @@ -1,98 +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.org 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): - */ - -#include "StdAfx.h" - -#include "PropertyBag.h" - - -CPropertyBag::CPropertyBag() -{ -} - - -CPropertyBag::~CPropertyBag() -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IPropertyBag implementation - -HRESULT STDMETHODCALLTYPE CPropertyBag::Read(/* [in] */ LPCOLESTR pszPropName, /* [out][in] */ VARIANT __RPC_FAR *pVar, /* [in] */ IErrorLog __RPC_FAR *pErrorLog) -{ - if (pszPropName == NULL) - { - return E_INVALIDARG; - } - if (pVar == NULL) - { - return E_INVALIDARG; - } - - VariantInit(pVar); - PropertyList::iterator i; - for (i = m_PropertyList.begin(); i != m_PropertyList.end(); i++) - { - // Is the property already in the list? - if (wcsicmp((*i).szName, pszPropName) == 0) - { - // Copy the new value - VariantCopy(pVar, &(*i).vValue); - return S_OK; - } - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CPropertyBag::Write(/* [in] */ LPCOLESTR pszPropName, /* [in] */ VARIANT __RPC_FAR *pVar) -{ - if (pszPropName == NULL) - { - return E_INVALIDARG; - } - if (pVar == NULL) - { - return E_INVALIDARG; - } - - PropertyList::iterator i; - for (i = m_PropertyList.begin(); i != m_PropertyList.end(); i++) - { - // Is the property already in the list? - if (wcsicmp((*i).szName, pszPropName) == 0) - { - // Copy the new value - (*i).vValue = CComVariant(*pVar); - return S_OK; - } - } - - Property p; - p.szName = CComBSTR(pszPropName); - p.vValue = *pVar; - - m_PropertyList.push_back(p); - return S_OK; -} - diff --git a/mozilla/webshell/embed/ActiveX/PropertyBag.h b/mozilla/webshell/embed/ActiveX/PropertyBag.h deleted file mode 100644 index 1d88c3bda44..00000000000 --- a/mozilla/webshell/embed/ActiveX/PropertyBag.h +++ /dev/null @@ -1,52 +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.org 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 PROPERTYBAG_H -#define PROPERTYBAG_H - - -// Object wrapper for property list. This class can be set up with a -// list of properties and used to initialise a control with them - -class CPropertyBag : public CComObjectRootEx, - public IPropertyBag -{ - // List of properties in the bag - PropertyList m_PropertyList; - -public: - // Constructor - CPropertyBag(); - // Destructor - virtual ~CPropertyBag(); - -BEGIN_COM_MAP(CPropertyBag) - COM_INTERFACE_ENTRY(IPropertyBag) -END_COM_MAP() - -// IPropertyBag methods - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read(/* [in] */ LPCOLESTR pszPropName, /* [out][in] */ VARIANT __RPC_FAR *pVar, /* [in] */ IErrorLog __RPC_FAR *pErrorLog); - virtual HRESULT STDMETHODCALLTYPE Write(/* [in] */ LPCOLESTR pszPropName, /* [in] */ VARIANT __RPC_FAR *pVar); -}; - -typedef CComObject CPropertyBagInstance; - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/PropertyList.h b/mozilla/webshell/embed/ActiveX/PropertyList.h deleted file mode 100644 index 64b9249e8ed..00000000000 --- a/mozilla/webshell/embed/ActiveX/PropertyList.h +++ /dev/null @@ -1,49 +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.org 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 PROPERTYLIST_H -#define PROPERTYLIST_H - - -// Property is a name,variant pair held by the browser. In IE, properties -// offer a primitive way for DHTML elements to talk back and forth with -// the host app. - -struct Property -{ - CComBSTR szName; - CComVariant vValue; -}; - -// A list of properties -typedef std::vector PropertyList; - - -// DEVNOTE: These operators are required since the unpatched VC++ 5.0 -// generates code even for unreferenced template methods in -// the file and will give compiler errors without -// them. Service Pack 1 and above fixes this problem - -int operator <(const Property&, const Property&); -int operator ==(const Property&, const Property&); - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/StdAfx.cpp b/mozilla/webshell/embed/ActiveX/StdAfx.cpp deleted file mode 100644 index d8ac0f6c46a..00000000000 --- a/mozilla/webshell/embed/ActiveX/StdAfx.cpp +++ /dev/null @@ -1,36 +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.org 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): - */ - -// stdafx.cpp : source file that includes just the standard includes -// stdafx.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -#ifdef _ATL_STATIC_REGISTRY -#include -#include -#endif - -#include -#include -#include diff --git a/mozilla/webshell/embed/ActiveX/StdAfx.h b/mozilla/webshell/embed/ActiveX/StdAfx.h deleted file mode 100644 index 51f6d1cb11d..00000000000 --- a/mozilla/webshell/embed/ActiveX/StdAfx.h +++ /dev/null @@ -1,167 +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.org 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): - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#if !defined(AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_) -#define AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define STRICT - -#define _WIN32_WINNT 0x0400 -#define _ATL_APARTMENT_THREADED -#define _ATL_STATIC_REGISTRY - -// Comment these out as appropriate -#ifdef MOZ_ACTIVEX_CONTROL_SUPPORT -#define USE_CONTROL -#endif - -#ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT -#define USE_PLUGIN -#endif - -// ATL headers -#include -//You may derive a class from CComModule and use it if you want to override -//something, but do not change the name of _Module -extern CComModule _Module; -#include -#include -#include -#include -#include -#include - -#ifdef USE_PLUGIN -#include -#endif - -// STL headers -#include -#include -#include - -// New winsock2.h doesn't define this anymore -typedef long int32; - -#include "jstypes.h" -#include "prtypes.h" - -// Mozilla headers - -#ifdef USE_CONTROL -#include "xp_core.h" -#include "jscompat.h" - -#include "prthread.h" -#include "prprf.h" -#include "plevent.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsIEventQueueService.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" -#include "nsViewsCID.h" -#include "nsString.h" -#include "nsCOMPtr.h" -#include "nsXPIDLString.h" -#include "nsICookieService.h" - -#include "nsIHTTPChannel.h" - -#include "nsIPref.h" -#include "nsIURL.h" -#include "nsIWebShell.h" -#include "nsIBaseWindow.h" -#include "nsIBrowserWindow.h" -#include "nsIContentViewer.h" -#include "nsIPresShell.h" -#include "nsCOMPtr.h" -#include "nsIDOMSelection.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" - -#include "nsEditorCID.h" -#include "nsIEditor.h" -#include "nsIHtmlEditor.h" - -#include "nsIDocument.h" -#include "nsIDocumentObserver.h" -#include "nsIDocumentLoaderObserver.h" -#include "nsIStreamListener.h" -#include "nsUnitConversion.h" -#include "nsVoidArray.h" -#include "nsCRT.h" - -#include "nsIDocumentViewer.h" -#include "nsIDOMNode.h" -#include "nsIDOMNodeList.h" -#include "nsIDOMDocument.h" -#include "nsIDOMDocumentType.h" -#include "nsIDOMElement.h" -#endif - -// Mozilla control headers -#include "resource.h" - -#include "ActiveXTypes.h" -#include "BrowserDiagnostics.h" -#include "IOleCommandTargetImpl.h" -#include "DHTMLCmdIds.h" - -#include "MozillaControl.h" -#include "PropertyList.h" -#include "PropertyBag.h" -#include "ItemContainer.h" -#include "ControlSite.h" -#include "ControlSiteIPFrame.h" - -#ifdef USE_CONTROL -#include "IEHtmlDocument.h" -#include "CPMozillaControl.h" -#include "MozillaBrowser.h" -#include "WebShellContainer.h" -#include "DropTarget.h" -#include "guids.h" -#endif - -#ifdef USE_PLUGIN -#include "npapi.h" -#include "nsIFactory.h" -#include "nsIPlugin.h" -#include "nsIPluginInstance.h" -#include "ActiveXPlugin.h" -#include "ActiveXPluginInstance.h" -#include "ActiveScriptSite.h" -#endif - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED) diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp deleted file mode 100644 index 7bf2f57db77..00000000000 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp +++ /dev/null @@ -1,607 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ - -#include "stdafx.h" - -#include -#include - -#include "WebShellContainer.h" - -CWebShellContainer::CWebShellContainer(CMozillaBrowser *pOwner) -{ - NS_INIT_REFCNT(); - m_pOwner = pOwner; - m_pEvents1 = m_pOwner; - m_pEvents2 = m_pOwner; -} - - -CWebShellContainer::~CWebShellContainer() -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsISupports implementation - -NS_IMPL_ADDREF(CWebShellContainer) -NS_IMPL_RELEASE(CWebShellContainer) -NS_IMPL_QUERY_HEAD(CWebShellContainer) - NS_IMPL_QUERY_BODY(nsIBrowserWindow) - NS_IMPL_QUERY_BODY(nsIStreamObserver) - NS_IMPL_QUERY_BODY(nsIDocumentLoaderObserver) - NS_IMPL_QUERY_BODY(nsIWebShellContainer) -NS_IMPL_QUERY_TAIL(nsIStreamObserver) - - -/////////////////////////////////////////////////////////////////////////////// -// nsIBrowserWindow implementation - -NS_IMETHODIMP -CWebShellContainer::Init(nsIAppShell* aAppShell, const nsRect& aBounds, PRUint32 aChromeMask, PRBool aAllowPlugins) -{ - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::MoveTo(PRInt32 aX, PRInt32 aY) -{ - NG_TRACE_METHOD(CWebShellContainer::MoveTo); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::SizeTo(PRInt32 aWidth, PRInt32 aHeight) -{ - NG_TRACE_METHOD(CWebShellContainer::SizeTo); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::SizeWindowTo(PRInt32 aWidth, PRInt32 aHeight, - PRBool aWidthTransient, PRBool aHeightTransient) -{ - NG_TRACE_METHOD(CWebShellContainer::SizeWindowTo); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::SizeContentTo(PRInt32 aWidth, PRInt32 aHeight) -{ - NG_TRACE_METHOD(CWebShellContainer::SizeContentTo); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetContentBounds(nsRect& aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetContentBounds); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetBounds(nsRect& aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetBounds); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetWindowBounds(nsRect& aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetWindowBounds); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::IsIntrinsicallySized(PRBool& aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::IsIntrinsicallySized); - aResult = PR_FALSE; - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::ShowAfterCreation() -{ - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::Show() -{ - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::Hide() -{ - NG_TRACE_METHOD(CWebShellContainer::Hide); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::Close() -{ - NG_TRACE_METHOD(CWebShellContainer::Close); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::ShowModally(PRBool aPrepare) -{ - NG_TRACE_METHOD(CWebShellContainer::ShowModally); - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::SetChrome(PRUint32 aNewChromeMask) -{ - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetChrome(PRUint32& aChromeMaskResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetChrome); - aChromeMaskResult = 0; - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::SetTitle(const PRUnichar* aTitle) -{ - //Fire a title change event - USES_CONVERSION; - LPOLESTR pszConvertedLocationName = W2OLE(const_cast(aTitle)); - BSTR __RPC_FAR LocationName = SysAllocString(pszConvertedLocationName); - m_pEvents1->Fire_TitleChange(LocationName); - m_pEvents2->Fire_TitleChange(LocationName); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetTitle(PRUnichar** aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetTitle); - *aResult = nsnull; - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::SetStatus(const PRUnichar* aStatus) -{ - - NG_TRACE_METHOD(CWebShellContainer::SetStatus); - - //Gets fired on mouse over link events. - BSTR bstrStatus = SysAllocString(W2OLE((PRUnichar *) aStatus)); - m_pEvents1->Fire_StatusTextChange(bstrStatus); - m_pEvents2->Fire_StatusTextChange(bstrStatus); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetStatus(const PRUnichar** aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetStatus); - *aResult = nsnull; - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::SetDefaultStatus(const PRUnichar* aStatus) -{ - NG_TRACE_METHOD(CWebShellContainer::SetDefaultStatus); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetDefaultStatus(const PRUnichar** aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetDefaultStatus); - *aResult = nsnull; - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::SetProgress(PRInt32 aProgress, PRInt32 aProgressMax) -{ - NG_TRACE_METHOD(CWebShellContainer::SetProgress); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::ShowMenuBar(PRBool aShow) -{ - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetWebShell(nsIWebShell*& aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetWebShell); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::GetContentWebShell(nsIWebShell **aResult) -{ - NG_TRACE_METHOD(CWebShellContainer::GetContentWebShell); - *aResult = nsnull; - return NS_OK; -} - - - -/////////////////////////////////////////////////////////////////////////////// -// nsIWebShellContainer implementation - - -NS_IMETHODIMP -CWebShellContainer::WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::WillLoadURL(..., \"%s\", %d)\n"), W2T(aURL), (int) aReason); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::BeginLoadURL(..., \"%s\")\n"), W2T(aURL)); - - // Setup the post data - CComVariant vPostDataRef; - CComVariant vPostData; - vPostDataRef.vt = VT_BYREF | VT_VARIANT; - vPostDataRef.pvarVal = &vPostData; - // TODO get the post data passed in via the original call to Navigate() - - // Fire a BeforeNavigate event - OLECHAR *pszURL = W2OLE((WCHAR *)aURL); - BSTR bstrURL = SysAllocString(pszURL); - BSTR bstrTargetFrameName = NULL; - BSTR bstrHeaders = NULL; - VARIANT_BOOL bCancel = VARIANT_FALSE; - long lFlags = 0; - - m_pEvents1->Fire_BeforeNavigate(bstrURL, lFlags, bstrTargetFrameName, &vPostDataRef, bstrHeaders, &bCancel); - - // Fire a BeforeNavigate2 event - CComVariant vURL(bstrURL); - CComVariant vFlags(lFlags); - CComVariant vTargetFrameName(bstrTargetFrameName); - CComVariant vHeaders(bstrHeaders); - - m_pEvents2->Fire_BeforeNavigate2(m_pOwner, &vURL, &vFlags, &vTargetFrameName, &vPostDataRef, &vHeaders, &bCancel); - - SysFreeString(bstrURL); - SysFreeString(bstrTargetFrameName); - SysFreeString(bstrHeaders); - - if (bCancel == VARIANT_TRUE) - { - return NS_ERROR_ABORT; - } - else - { - m_pOwner->m_bBusy = TRUE; - } - - //NOTE: The IE control fires a DownloadBegin after the first BeforeNavigate. It then fires a - // DownloadComplete after then engine has made it's initial connection to the server. It - // then fires a second DownloadBegin/DownloadComplete pair around the loading of everything - // on the page. These events get fired out of CWebShellContainer::StartDocumentLoad() and - // CWebShellContainer::EndDocumentLoad(). - // We don't appear to distinguish between the initial connection to the server and the - // actual transfer of data. Firing these events here simulates, appeasing applications - // that are expecting that initial pair. - m_pEvents1->Fire_DownloadBegin(); - m_pEvents2->Fire_DownloadBegin(); - m_pEvents1->Fire_DownloadComplete(); - m_pEvents2->Fire_DownloadComplete(); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::ProgressLoadURL(..., \"%s\", %d, %d)\n"), W2T(aURL), (int) aProgress, (int) aProgressMax); - - long nProgress = aProgress; - long nProgressMax = aProgressMax; - - if (nProgress == 0) - { - } - if (nProgressMax == 0) - { - nProgressMax = LONG_MAX; - } - if (nProgress > nProgressMax) - { - nProgress = nProgressMax; // Progress complete - } - - m_pEvents1->Fire_ProgressChange(nProgress, nProgressMax); - m_pEvents2->Fire_ProgressChange(nProgress, nProgressMax); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::EndLoadURL(..., \"%s\", %d)\n"), W2T(aURL), (int) aStatus); - - // Fire a NavigateComplete event - OLECHAR *pszURL = W2OLE((WCHAR *) aURL); - BSTR bstrURL = SysAllocString(pszURL); - m_pEvents1->Fire_NavigateComplete(bstrURL); - - // Fire a NavigateComplete2 event - CComVariant vURL(bstrURL); - m_pEvents2->Fire_NavigateComplete2(m_pOwner, &vURL); - - // Fire the new NavigateForward state - VARIANT_BOOL bEnableForward = VARIANT_FALSE; - if ( m_pOwner->m_pIWebShell->CanForward() == NS_OK ) - { - bEnableForward = VARIANT_TRUE; - } - m_pEvents2->Fire_CommandStateChange(CSC_NAVIGATEFORWARD, bEnableForward); - - // Fire the new NavigateBack state - VARIANT_BOOL bEnableBack = VARIANT_FALSE; - if ( m_pOwner->m_pIWebShell->CanBack() == NS_OK ) - { - bEnableBack = VARIANT_TRUE; - } - m_pEvents2->Fire_CommandStateChange(CSC_NAVIGATEBACK, bEnableBack); - - m_pOwner->m_bBusy = FALSE; - SysFreeString(bstrURL); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell) -{ - NG_TRACE_METHOD(CWebShellContainer::NewWebShell); - nsresult rv = NS_ERROR_OUT_OF_MEMORY; - return rv; -} - - -NS_IMETHODIMP -CWebShellContainer::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::FindWebShellWithName(\"%s\", ...)\n"), W2T(aName)); - - nsresult rv = NS_OK; - - // Zero result (in case we fail). - aResult = nsnull; - - if (m_pOwner->m_pIWebShell != NULL) - { - rv = m_pOwner->m_pIWebShell->FindChildWithName(aName, aResult); - } - - return rv; -} - - -NS_IMETHODIMP -CWebShellContainer::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken) -{ - NG_TRACE_METHOD(CWebShellContainer::FocusAvailable); - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameNode) -{ - NG_TRACE_METHOD(CWebShellContainer::ContentShellAdded); - nsresult rv = NS_OK; - return rv; -} - - -NS_IMETHODIMP -CWebShellContainer::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, - PRInt32 aXPos, PRInt32 aYPos, - const nsString& aPopupType, const nsString& anAnchorAlignment, - const nsString& aPopupAlignment, - nsIDOMWindow* aWindow, nsIDOMWindow** outPopup) -{ - NG_TRACE_METHOD(CWebShellContainer::CreatePopup); - HMENU hMenu = ::CreatePopupMenu(); - *outPopup = NULL; - InsertMenu(hMenu, 0, MF_BYPOSITION, 1, _T("TODO")); - TrackPopupMenu(hMenu, TPM_LEFTALIGN, aXPos, aYPos, NULL, NULL, NULL); - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIStreamObserver implementation -NS_IMETHODIMP -CWebShellContainer::OnStartRequest(nsIChannel* aChannel, nsISupports* aContext) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::OnStartRequest(...)\n")); - - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::OnStopRequest(nsIChannel* aChannel, nsISupports* aContext, nsresult aStatus, const PRUnichar* aMsg) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::OnStopRequest(..., %d, \"%s\")\n"), (int) aStatus, W2T((PRUnichar *) aMsg)); - - // Fire a DownloadComplete event - m_pEvents1->Fire_DownloadComplete(); - m_pEvents2->Fire_DownloadComplete(); - - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIDocumentLoaderObserver implementation - - - -NS_IMETHODIMP -CWebShellContainer::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand) -{ - char* wString = nsnull; - aURL->GetPath(&wString); - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::OnStartDocumentLoad(..., %s, \"%s\")\n"),A2CT(wString), A2CT(aCommand)); - - //Fire a DownloadBegin - m_pEvents1->Fire_DownloadBegin(); - m_pEvents2->Fire_DownloadBegin(); - - return NS_OK; -} - -// we need this to fire the document complete -NS_IMETHODIMP -CWebShellContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel *aChannel, nsresult aStatus) -{ - NG_TRACE(_T("CWebShellContainer::OnEndDocumentLoad(..., \"\")\n")); - - //Fire a DownloadComplete - m_pEvents1->Fire_DownloadComplete(); - m_pEvents2->Fire_DownloadComplete(); - - char* aString = nsnull; - nsIURI* uri = nsnull; - - aChannel->GetURI(&uri); - if (uri) { - uri->GetSpec(&aString); - } - if (aString == NULL) - { - return NS_ERROR_NULL_POINTER; - } - - USES_CONVERSION; - BSTR bstrURL = SysAllocString(A2OLE((CHAR *) aString)); - - delete [] aString; // clean up. - - // Fire a DocumentComplete event - CComVariant vURL(bstrURL); - m_pEvents2->Fire_DocumentComplete(m_pOwner, &vURL); - SysFreeString(bstrURL); - - //Fire a StatusTextChange event - BSTR bstrStatus = SysAllocString(A2OLE((CHAR *) "Done")); - m_pEvents1->Fire_StatusTextChange(bstrStatus); - m_pEvents2->Fire_StatusTextChange(bstrStatus); - - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* aChannel) -{ - NG_TRACE(_T("CWebShellContainer::OnStartURLLoad(..., \"\")\n")); - - //NOTE: This appears to get fired once for each individual item on a page. - - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* aChannel, PRUint32 aProgress, PRUint32 aProgressMax) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebShellContainer::OnProgress(..., \"%d\", \"%d\")\n"), (int) aProgress, (int) aProgressMax); - - return NS_OK; -} - -NS_IMETHODIMP -CWebShellContainer::OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* aChannel, nsString& aMsg) -{ - NG_TRACE(_T("CWebShellContainer::OnStatusURLLoad(..., \"\")\n")); - - //NOTE: This appears to get fired for each individual item on a page, indicating the status of that item. - BSTR bstrStatus = SysAllocString(W2OLE((PRUnichar *) aMsg.GetUnicode())); - m_pEvents1->Fire_StatusTextChange(bstrStatus); - m_pEvents2->Fire_StatusTextChange(bstrStatus); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebShellContainer::OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus) -{ - NG_TRACE(_T("CWebShellContainer::OnEndURLLoad(..., \"\")\n")); - - //NOTE: This appears to get fired once for each individual item on a page. - - return NS_OK; -} - diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.h b/mozilla/webshell/embed/ActiveX/WebShellContainer.h deleted file mode 100644 index 427b9aaa106..00000000000 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.h +++ /dev/null @@ -1,108 +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.org 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 WEBSHELLCONTAINER_H -#define WEBSHELLCONTAINER_H - -// This is the class that handles the XPCOM side of things, callback -// interfaces into the web shell and so forth. - -class CWebShellContainer : - public nsIBrowserWindow, - public nsIWebShellContainer, - public nsIStreamObserver, - public nsIDocumentLoaderObserver -{ -public: - CWebShellContainer(CMozillaBrowser *pOwner); - -protected: - virtual ~CWebShellContainer(); - -// Protected members -protected: - nsString m_sTitle; - - CMozillaBrowser *m_pOwner; - CDWebBrowserEvents1 *m_pEvents1; - CDWebBrowserEvents2 *m_pEvents2; - -public: - // nsISupports - NS_DECL_ISUPPORTS - - // nsIBrowserWindow - - NS_IMETHOD Init(nsIAppShell* aAppShell, const nsRect& aBounds, PRUint32 aChromeMask, PRBool aAllowPlugins = PR_TRUE); - NS_IMETHOD MoveTo(PRInt32 aX, PRInt32 aY); - NS_IMETHOD SizeTo(PRInt32 aWidth, PRInt32 aHeight); - NS_IMETHOD GetContentBounds(nsRect& aResult); - NS_IMETHOD GetBounds(nsRect& aResult); - NS_IMETHOD GetWindowBounds(nsRect& aResult); - NS_IMETHOD IsIntrinsicallySized(PRBool& aResult); - NS_IMETHOD SizeWindowTo(PRInt32 aWidth, PRInt32 aHeight, - PRBool aWidthTransient, PRBool aHeightTransient); - NS_IMETHOD SizeContentTo(PRInt32 aWidth, PRInt32 aHeight); - NS_IMETHOD ShowAfterCreation(); - NS_IMETHOD Show(); - NS_IMETHOD Hide(); - NS_IMETHOD Close(); - NS_IMETHOD ShowModally(PRBool aPrepare); - NS_IMETHOD SetChrome(PRUint32 aNewChromeMask); - NS_IMETHOD GetChrome(PRUint32& aChromeMaskResult); - NS_IMETHOD SetTitle(const PRUnichar* aTitle); - NS_IMETHOD GetTitle(PRUnichar** aResult); - NS_IMETHOD SetStatus(const PRUnichar* aStatus); - NS_IMETHOD GetStatus(const PRUnichar** aResult); - NS_IMETHOD SetDefaultStatus(const PRUnichar* aStatus); - NS_IMETHOD GetDefaultStatus(const PRUnichar** aResult); - NS_IMETHOD SetProgress(PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD ShowMenuBar(PRBool aShow); - NS_IMETHOD GetWebShell(nsIWebShell*& aResult); - NS_IMETHOD GetContentWebShell(nsIWebShell **aResult); - - // nsIWebShellContainer - NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); - NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL); - NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus); - NS_IMETHOD NewWebShell(PRUint32 aChromeMask, - PRBool aVisible, - nsIWebShell *&aNewWebShell); - NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); - NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken); - NS_IMETHOD ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameNode); - NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, - PRInt32 aXPos, PRInt32 aYPos, - const nsString& aPopupType, const nsString& anAnchorAlignment, - const nsString& aPopupAlignment, - nsIDOMWindow* aWindow, nsIDOMWindow** outPopup); - - // nsIStreamObserver - NS_IMETHOD OnStartRequest(nsIChannel* aChannel, nsISupports* aContext); - NS_IMETHOD OnStopRequest(nsIChannel* aChannel, nsISupports* aContext, nsresult aStatus, const PRUnichar* aMsg); - - // nsIDocumentLoaderObserver - NS_DECL_NSIDOCUMENTLOADEROBSERVER -}; - -#endif - diff --git a/mozilla/webshell/embed/ActiveX/guids.cpp b/mozilla/webshell/embed/ActiveX/guids.cpp deleted file mode 100644 index 78d31652188..00000000000 --- a/mozilla/webshell/embed/ActiveX/guids.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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): - */ -#include "stdafx.h" -#include "guids.h" - -// Class IDs -NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -NS_DEFINE_IID(kHTMLEditorCID, NS_HTMLEDITOR_CID); -NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID); - -// Interface IDs -NS_DEFINE_IID(kIBaseWindowIID, NS_IBASEWINDOW_IID); -NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID); -NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); -NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); -NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID); -NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); -NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID); -NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID); -NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); -NS_DEFINE_IID(kIDocumentLoaderObserverIID, NS_IDOCUMENT_LOADER_OBSERVER_IID); -NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - -#ifdef USE_PLUGIN -NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); -NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID); -NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID); -#endif diff --git a/mozilla/webshell/embed/ActiveX/guids.h b/mozilla/webshell/embed/ActiveX/guids.h deleted file mode 100644 index 9b8e67a9ebc..00000000000 --- a/mozilla/webshell/embed/ActiveX/guids.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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.org 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 GUIDS_H -#define GUIDS_H - -#define NS_EXTERN_IID(_name) \ - extern const nsIID _name; - -// Class IDs -NS_EXTERN_IID(kEventQueueServiceCID); -NS_EXTERN_IID(kHTMLEditorCID); -NS_EXTERN_IID(kCookieServiceCID); - -// Interface IDs -NS_EXTERN_IID(kIBaseWindowIID); -NS_EXTERN_IID(kIBrowserWindowIID); -NS_EXTERN_IID(kIEventQueueServiceIID); -NS_EXTERN_IID(kIDocumentViewerIID); -NS_EXTERN_IID(kIDOMDocumentIID); -NS_EXTERN_IID(kIDOMNodeIID); -NS_EXTERN_IID(kIDOMElementIID); -NS_EXTERN_IID(kIWebShellContainerIID); -NS_EXTERN_IID(kIStreamObserverIID); -NS_EXTERN_IID(kIDocumentLoaderObserverIID); -NS_EXTERN_IID(kISupportsIID); - -#ifdef USE_PLUGIN -NS_EXTERN_IID(kIFactoryIID); -NS_EXTERN_IID(kIPluginIID); -NS_EXTERN_IID(kIPluginInstanceIID); -#endif - -#endif \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/makefile.win b/mozilla/webshell/embed/ActiveX/makefile.win deleted file mode 100644 index 4fc9aeddd74..00000000000 --- a/mozilla/webshell/embed/ActiveX/makefile.win +++ /dev/null @@ -1,198 +0,0 @@ -#!nmake -# -# 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.org 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): - -!if "$(MSSDK)" == "" -!message This module requires the MS Platform SDK to be installed. -!else - -DLLNAME = npmozctl -QUIET = -DEPTH =..\..\.. - - -# The default is to include control support unless told to do otherwise -!ifndef MOZ_ACTIVEX_NO_CONTROL_SUPPORT -MOZ_ACTIVEX_CONTROL_SUPPORT = 1 -!endif - -!ifndef MOZ_ACTIVEX_NO_PLUGIN_SUPPORT -# MOZ_ACTIVEX_PLUGIN_SUPPORT = 1 -!endif - - -MAKE_OBJ_TYPE = DLL -DLL=.\$(OBJDIR)\$(DLLNAME).dll -RESFILE = MozillaControl.res -DEFFILE = npmozctl.def - -OBJS = \ - .\$(OBJDIR)\StdAfx.obj \ - .\$(OBJDIR)\ControlSite.obj \ - .\$(OBJDIR)\ControlSiteIPFrame.obj \ - .\$(OBJDIR)\ItemContainer.obj \ - .\$(OBJDIR)\PropertyBag.obj \ - .\$(OBJDIR)\MozillaControl.obj \ -!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT - .\$(OBJDIR)\nsSetupRegistry.obj \ - .\$(OBJDIR)\MozillaBrowser.obj \ - .\$(OBJDIR)\WebShellContainer.obj \ - .\$(OBJDIR)\IEHtmlNode.obj \ - .\$(OBJDIR)\IEHtmlElementCollection.obj \ - .\$(OBJDIR)\IEHtmlElement.obj \ - .\$(OBJDIR)\IEHtmlDocument.obj \ - .\$(OBJDIR)\DropTarget.obj \ - .\$(OBJDIR)\guids.obj \ -!endif -# .\$(OBJDIR)\ActiveXPlugin.obj \ -# .\$(OBJDIR)\ActiveXPluginInstance.obj \ -!ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT - .\$(OBJDIR)\ActiveScriptSite.obj \ - .\$(OBJDIR)\LegacyPlugin.obj \ - .\$(OBJDIR)\npwin.obj \ -!endif - $(NULL) - -# most of these have to be here for nsSetupRegistry.cpp... - -LINCS= \ -!ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT - -I$(MOZ_PLUGINSDK)\include \ -!endif - -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\xpcom \ - -I$(PUBLIC)\dom \ - -I$(PUBLIC)\js \ - -I$(PUBLIC)\netlib \ - -I$(PUBLIC)\java \ - -I$(PUBLIC)\plugin \ - -I$(PUBLIC)\caps \ - -I$(PUBLIC)\oji \ - -I$(PUBLIC)\editor \ - -I$(PUBLIC)\uconv \ - -I$(PUBLIC)\intl \ - -I$(PUBLIC)\locale \ - -I$(PUBLIC)\lwbrk \ - -I$(PUBLIC)\unicharutil \ - -I$(PUBLIC)\pref \ - -I$(PUBLIC)\wallet \ - -I$(PUBLIC)\rdf \ - -I$(PUBLIC)\profile \ - $(NULL) - -LLIBS= \ -!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT - $(DIST)\lib\gkgfxwin.lib \ - $(DIST)\lib\gkweb.lib \ - $(DIST)\lib\xpcom.lib \ - $(LIBNSPR) \ -!endif - $(NULL) - -WIN_LIBS = \ - comdlg32.lib \ - ole32.lib \ - oleaut32.lib \ - uuid.lib \ - shell32.lib \ - $(NULL) - - -LCFLAGS = /D "WIN32" /GX /FR /U "ClientWallet" -LLFLAGS = -SUBSYSTEM:windows /DLL - -include <$(DEPTH)\config\rules.mak> - -!ifdef MOZ_NO_DEBUG_RTL -LCFLAGS = $(LCFLAGS) -DMOZ_NO_DEBUG_RTL -!endif - -!ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT -LCFLAGS = $(LCFLAGS) -DMOZ_ACTIVEX_PLUGIN_SUPPORT -!endif - -!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT -LCFLAGS = $(LCFLAGS) -DMOZ_ACTIVEX_CONTROL_SUPPORT -!endif - -install:: $(DLL) - $(MAKE_INSTALL) $(DLL) $(DIST)\bin - $(MAKE_INSTALL) MozillaControl.html $(DIST)\bin\res - regsvr32 /s /c $(DIST)\bin\$(DLLNAME).dll - -$(DEFFILE) : mkctldef.bat - mkctldef.bat $(DEFFILE) - -MozillaControl_i.c MozillaControl.h: MozillaControl.idl - midl /Oicf /h MozillaControl.h /iid MozillaControl_i.c MozillaControl.idl - -!ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT -ActiveScriptSite.cpp: StdAfx.h ActiveScriptSite.h - -LegacyPlugin.cpp \ -ActiveXPlugin.cpp \ -ActiveXPluginInstance.cpp: StdAfx.h ActiveXPlugin.h ActiveXPluginInstance.h - -npwin.cpp: $(MOZ_PLUGINSDK)/common/npwin.cpp - -cp -f $(MOZ_PLUGINSDK)/common/npwin.cpp . -!endif - -ControlSite.cpp \ -ControlSiteIPFrame.cpp \ -PropertyBag.cpp : StdAfx.h PropertyBag.h ControlSite.h ControlSiteIPFrame.h - -ItemContainer.cpp : StdAfx.h ItemContainer.h - -MozillaControl.cpp \ -StdAfx.cpp: StdAfx.h MozillaControl.h MozillaBrowser.h WebShellContainer.h - -!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT -IEHtmlNode.cpp : StdAfx.h IEHtmlNode.h - -IEHtmlElementCollection.cpp : StdAfx.h IEHtmlElementCollection.h - -IEHtmlElement.cpp : StdAfx.h IEHtmlNode.h IEHtmlElement.h - -IEHtmlDocument.cpp : StdAfx.h IEHtmlNode.h IEHtmlDocument.h - -DropTarget.cpp: StdAfx.h DropTarget.h - -MozillaControl.cpp \ -MozillaBrowser.cpp \ -WebShellContainer.cpp \ -StdAfx.cpp: StdAfx.h MozillaControl.h MozillaBrowser.h WebShellContainer.h IOleCommandTargetImpl.h -!endif - -guids.cpp: StdAfx.h guids.h - -control_and_plugin: - nmake /f makefile.win MOZ_ACTIVEX_PLUGIN_SUPPORT=1 MOZ_ACTIVEX_CONTROL_SUPPORT=1 - -plugin_only:: - nmake /f makefile.win MOZ_ACTIVEX_PLUGIN_SUPPORT=1 MOZ_ACTIVEX_NO_CONTROL_SUPPORT=1 - -control_only:: - nmake /f makefile.win MOZ_ACTIVEX_CONTROL_SUPPORT=1 MOZ_ACTIVEX_NO_PLUGIN_SUPPORT=1 - -clobber:: - -regsvr32 /s /c /u $(DIST)\bin\$(DLLNAME).dll - -del $(DEFFILE) - -!endif diff --git a/mozilla/webshell/embed/ActiveX/mkctldef.bat b/mozilla/webshell/embed/ActiveX/mkctldef.bat deleted file mode 100755 index f3cea56f1e3..00000000000 --- a/mozilla/webshell/embed/ActiveX/mkctldef.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off - -REM This script generates the DEF file for the control DLL depending on -REM what has been set to go into it - -echo ; npmozctl.def : Declares the module parameters. > %1 -echo ; This file was autogenerated by mkctldef.bat! >> %1 -echo. >> %1 -echo LIBRARY "npmozctl.DLL" >> %1 -echo EXPORTS >> %1 -echo ; ActiveX exports >> %1 -echo DllCanUnloadNow @100 PRIVATE >> %1 -echo DllGetClassObject @101 PRIVATE >> %1 -echo DllRegisterServer @102 PRIVATE >> %1 -echo DllUnregisterServer @103 PRIVATE >> %1 -echo. >> %1 - -:test_plugin -if NOT "%MOZ_ACTIVEX_PLUGIN_SUPPORT%"=="1" goto test_control -echo ; Plugin exports >> %1 -echo NP_GetEntryPoints @1 >> %1 -echo NP_Initialize @2 >> %1 -echo NP_Shutdown @3 >> %1 -echo ; NSGetFactory @10 >> %1 - -:test_control -if NOT "%MOT_ACTIVEX_CONTROL_SUPPORT%"=="1" goto end - - -:end \ No newline at end of file diff --git a/mozilla/webshell/embed/ActiveX/nsSetupRegistry.cpp b/mozilla/webshell/embed/ActiveX/nsSetupRegistry.cpp deleted file mode 100644 index a82612e03e6..00000000000 --- a/mozilla/webshell/embed/ActiveX/nsSetupRegistry.cpp +++ /dev/null @@ -1,29 +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): - */ - -/* - * This evil file will go away when the XPCOM registry can be - * externally initialized! - * - * Until then, include the real file to keep everything in sync. - */ -#include "..\..\..\xpfe\bootstrap\nsSetupRegistry.cpp" diff --git a/mozilla/webshell/embed/ActiveX/resource.h b/mozilla/webshell/embed/ActiveX/resource.h deleted file mode 100644 index c687b46ba45..00000000000 --- a/mozilla/webshell/embed/ActiveX/resource.h +++ /dev/null @@ -1,36 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by MozillaControl.rc -// -#define IDS_PROJNAME 100 -#define IDR_MOZILLABROWSER 101 -#define IDI_MOZILLABROWSER 201 -#define IDR_POPUP_PAGE 202 -#define IDR_POPUP_LINK 203 -#define IDR_POPUP_CLIPBOARD 204 -#define ID_BROWSE_BACK 32768 -#define ID_BROWSE_FORWARD 32769 -#define ID_FILE_REFRESH 32772 -#define ID_FILE_PRINT 32773 -#define ID_PAGE_PROPERTIES 32774 -#define ID_FILE_VIEWSOURCE 32775 -#define ID_FILE_OPEN 32776 -#define ID_FILE_OPENINNEWWINDOW 32777 -#define ID_EDIT_COPYSHORTCUT 32778 -#define ID_LINK_PROPERTIES 32779 -#define ID_EDIT_CUT 32780 -#define ID_EDIT_COPY 32781 -#define ID_EDIT_PASTE 32782 -#define ID_EDIT_SELECTALL 32783 -#define ID_SELECTIONPOPUP_PRINT 32784 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 205 -#define _APS_NEXT_COMMAND_VALUE 32785 -#define _APS_NEXT_CONTROL_VALUE 201 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif