Back to index

lightning-sunbird  0.9+nobinonly
IWebBrowserImpl.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Adam Lock <adamlock@eircom.net>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef IWEBBROWSERIMPL_H
00040 #define IWEBBROWSERIMPL_H
00041 
00042 #include <mshtml.h>
00043 
00044 #include "nsIWebNavigation.h"
00045 #include "nsIPrefBranch.h"
00046 #include "nsIPrefLocalizedString.h"
00047 #include "nsIDOMWindow.h"
00048 #include "nsIBaseWindow.h"
00049 #include "nsIWindowWatcher.h"
00050 #include "nsIInputStream.h"
00051 #include "nsIByteArrayInputStream.h"
00052 #include "nsIURI.h"
00053 
00054 #include "PropertyList.h"
00055 
00056 // CPMozillaControl.h was autogenerated by the ATL proxy wizard so don't edit it!
00057 #include "CPMozillaControl.h"
00058 
00059 #define ENSURE_BROWSER_IS_VALID() \
00060     if (!BrowserIsValid()) \
00061     { \
00062         NS_ASSERTION(0, "Browser is not valid"); \
00063         return SetErrorInfo(E_UNEXPECTED, L"Browser is not in a valid state"); \
00064     }
00065 
00066 #define ENSURE_GET_WEBNAV() \
00067     nsCOMPtr<nsIWebNavigation> webNav; \
00068     nsresult rv = GetWebNavigation(getter_AddRefs(webNav)); \
00069     if (NS_FAILED(rv)) \
00070     { \
00071         NS_ASSERTION(0, "Cannot get nsIWebNavigation"); \
00072         return SetErrorInfo(E_UNEXPECTED, L"Could not obtain nsIWebNavigation interface"); \
00073     }
00074 
00075 template<class T, const CLSID *pclsid, const GUID* plibid = &LIBID_MSHTML>
00076 class IWebBrowserImpl :
00077     public CStockPropImpl<T, IWebBrowser2, &IID_IWebBrowser2, plibid>,
00078     public CProxyDWebBrowserEvents<T>,
00079     public CProxyDWebBrowserEvents2<T>
00080 {
00081 public:
00082     IWebBrowserImpl()
00083     {
00084         // Ready state of control
00085         mBrowserReadyState = READYSTATE_UNINITIALIZED;
00086         // Flag indicates if the browser is busy
00087         mBusyFlag = PR_FALSE;
00088     }
00089 
00090 public:
00091 // Methods to be implemented by the derived class
00092     // Return the nsIWebNavigation object
00093     virtual nsresult GetWebNavigation(nsIWebNavigation **aWebNav) = 0;
00094     // Return the nsIDOMWindow object
00095     virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow) = 0;
00096     // Return the nsIPrefBranch object
00097     virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch) = 0;
00098     // Return the valid state of the browser
00099     virtual PRBool BrowserIsValid() = 0;
00100 
00101 public:
00102 // Properties related to this interface
00103     // Post data from last navigate operation
00104     CComVariant             mLastPostData;
00105     // Ready status of the browser
00106     READYSTATE              mBrowserReadyState;
00107     // Controls starts off unbusy
00108     PRBool                  mBusyFlag;
00109     // Property list
00110     PropertyList            mPropertyList;
00111 
00112 // Helper methods
00113 
00114     //
00115     // Sets error information for VB programmers and the like who want to know why
00116     // some method call failed.
00117     //
00118     virtual HRESULT SetErrorInfo(HRESULT hr, LPCOLESTR lpszDesc = NULL)
00119     {
00120         if (lpszDesc == NULL)
00121         {
00122             // Fill in a few generic descriptions
00123             switch (hr)
00124             {
00125             case E_UNEXPECTED:
00126                 lpszDesc = L"Method was called while control was uninitialized";
00127                 break;
00128             case E_INVALIDARG:
00129                 lpszDesc = L"Method was called with an invalid parameter";
00130                 break;
00131             }
00132         }
00133         AtlSetErrorInfo(*pclsid, lpszDesc, 0, NULL, GUID_NULL, hr, NULL);
00134         return hr;
00135     }
00136 
00137 
00138 // IWebBrowser implementation
00139     virtual HRESULT STDMETHODCALLTYPE GoBack(void)
00140     {
00141         ATLTRACE(_T("IWebBrowserImpl::GoBack()\n"));
00142         ENSURE_BROWSER_IS_VALID();
00143         ENSURE_GET_WEBNAV();
00144 
00145         PRBool aCanGoBack = PR_FALSE;
00146         webNav->GetCanGoBack(&aCanGoBack);
00147         if (aCanGoBack == PR_TRUE)
00148         {
00149             webNav->GoBack();
00150         }
00151         return S_OK;
00152     }
00153 
00154     virtual HRESULT STDMETHODCALLTYPE GoForward(void)
00155     {
00156         ATLTRACE(_T("IWebBrowserImpl::GoBack()\n"));
00157         ENSURE_BROWSER_IS_VALID();
00158         ENSURE_GET_WEBNAV();
00159 
00160         PRBool aCanGoForward = PR_FALSE;
00161         webNav->GetCanGoForward(&aCanGoForward);
00162         if (aCanGoForward == PR_TRUE)
00163         {
00164             webNav->GoForward();
00165         }
00166         return S_OK;
00167     }
00168 
00169     virtual HRESULT STDMETHODCALLTYPE GoHome(void)
00170     {
00171         ATLTRACE(_T("IWebBrowserImpl::GoHome()\n"));
00172         ENSURE_BROWSER_IS_VALID();
00173 
00174         CComBSTR bstrUrl(L"http://home.netscape.com/");
00175 
00176         // Find the home page stored in prefs
00177         nsCOMPtr<nsIPrefBranch> prefBranch;
00178         if (NS_SUCCEEDED(GetPrefs(getter_AddRefs(prefBranch))))
00179         {
00180             nsCOMPtr<nsIPrefLocalizedString> homePage;
00181             prefBranch->GetComplexValue("browser.startup.homepage",
00182                                             NS_GET_IID(nsIPrefLocalizedString),
00183                                             getter_AddRefs(homePage));
00184 
00185             if (homePage)
00186             {
00187                 nsXPIDLString homePageString;
00188                 nsresult rv = homePage->ToString(getter_Copies(homePageString));
00189                 if (NS_SUCCEEDED(rv))
00190                 {
00191                     bstrUrl = homePageString.get();
00192                 }
00193             }
00194         }
00195 
00196         // Navigate to the home page
00197         Navigate(bstrUrl, NULL, NULL, NULL, NULL);
00198     
00199         return S_OK;
00200     }
00201     virtual HRESULT STDMETHODCALLTYPE GoSearch(void)
00202     {
00203         ATLTRACE(_T("IWebBrowserImpl::GoSearch()\n"));
00204         ENSURE_BROWSER_IS_VALID();
00205 
00206         CComBSTR bstrUrl(L"http://search.netscape.com/");
00207 
00208         //NOTE:    This code has not been implemented yet
00209 #if 0
00210         // Find the home page stored in prefs
00211         nsCOMPtr<nsIPrefBranch> prefBranch;
00212         if (NS_SUCCEEDED(GetPrefs(getter_AddRefs(prefBranch))))
00213         {
00214             // TODO find and navigate to the search page stored in prefs
00215             //      and not this hard coded address
00216         }
00217 #endif
00218         // Navigate to the search page
00219         Navigate(bstrUrl, NULL, NULL, NULL, NULL);
00220     
00221         return S_OK;
00222     }
00223     
00224     virtual HRESULT STDMETHODCALLTYPE Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers)
00225     {
00226         ATLTRACE(_T("IWebBrowserImpl::Navigate()\n"));
00227         ENSURE_BROWSER_IS_VALID();
00228 
00229         // Extract the URL parameter
00230         if (URL == NULL)
00231         {
00232             NS_ASSERTION(0, "No URL supplied");
00233             return SetErrorInfo(E_INVALIDARG);
00234         }
00235 
00236         PRBool openInNewWindow = PR_FALSE;
00237         PRUint32 loadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
00238 
00239         // Extract the navigate flags parameter
00240         LONG lFlags = 0;
00241         if (Flags &&
00242             Flags->vt != VT_ERROR &&
00243             Flags->vt != VT_EMPTY &&
00244             Flags->vt != VT_NULL)
00245         {
00246             CComVariant vFlags;
00247             if ( vFlags.ChangeType(VT_I4, Flags) != S_OK )
00248             {
00249                 NS_ASSERTION(0, "Flags param is invalid");
00250                 return SetErrorInfo(E_INVALIDARG);
00251             }
00252             lFlags = vFlags.lVal;
00253         }
00254         if (lFlags & navOpenInNewWindow) 
00255         {
00256             openInNewWindow = PR_TRUE;
00257         }
00258         if (lFlags & navNoHistory)
00259         {
00260             // Disable history
00261             loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY;
00262         }
00263         if (lFlags & navNoReadFromCache)
00264         {
00265             // Disable read from cache
00266             loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE;
00267 
00268         }
00269         if (lFlags & navNoWriteToCache)
00270         {
00271             // Disable write to cache
00272             loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE;
00273         }
00274 
00275         // Extract the target frame parameter
00276         nsCOMPtr<nsIWebNavigation> targetNav;
00277         if (TargetFrameName &&
00278             TargetFrameName->vt == VT_BSTR &&
00279             TargetFrameName->bstrVal)
00280         {
00281             // Search for the named frame
00282             nsCOMPtr<nsIDOMWindow> window;
00283             GetDOMWindow(getter_AddRefs(window));
00284             if (window)
00285             {
00286                 nsCOMPtr<nsIWindowWatcher> windowWatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
00287                 if (windowWatcher)
00288                 {
00289                     nsCOMPtr<nsIDOMWindow> targetWindow;
00290                     windowWatcher->GetWindowByName(TargetFrameName->bstrVal, window,
00291                         getter_AddRefs(targetWindow));
00292                     if (targetWindow)
00293                     {
00294                         targetNav = do_GetInterface(targetWindow);
00295                     }
00296                 }
00297             }
00298             // No target nav? Open in new window
00299             if (!targetNav)
00300                 openInNewWindow = PR_TRUE;
00301         }
00302 
00303         // Open in new window
00304         if (openInNewWindow)
00305         {
00306             CComQIPtr<IDispatch> spDispNew;
00307             VARIANT_BOOL bCancel = VARIANT_FALSE;
00308         
00309             // Test if the event sink can give us a new window to navigate into
00310             Fire_NewWindow2(&spDispNew, &bCancel);
00311 
00312             lFlags &= ~(navOpenInNewWindow);
00313             if ((bCancel == VARIANT_FALSE) && spDispNew)
00314             {
00315                 CComQIPtr<IWebBrowser2> spOther = spDispNew;
00316                 if (spOther)
00317                 {
00318                     CComVariant vURL(URL);
00319                     CComVariant vFlags(lFlags);
00320                     return spOther->Navigate2(&vURL, &vFlags, TargetFrameName, PostData, Headers);
00321                 }
00322             }
00323 
00324             // NOTE: The IE control will launch an instance of iexplore.exe and
00325             //       return an interface to that if the client does not respond to
00326             //       FireNewWindow2, but the Mozilla control will not. Potentially
00327             //       it could also open an instance of IE for such occasions.
00328             //
00329 
00330             // Can't open a new window without client support
00331             return S_OK;
00332         }
00333 
00334         // As documented in MSDN:
00335         //
00336         //   The post data specified by PostData is passed as a SAFEARRAY
00337         //   structure. The variant should be of type VT_ARRAY and point to
00338         //   a SAFEARRAY. The SAFEARRAY should be of element type VT_UI1,
00339         //   dimension one, and have an element count equal to the number of
00340         //   bytes of post data.
00341 
00342         // Extract the post data parameter
00343         nsCOMPtr<nsIInputStream> postDataStream;
00344         mLastPostData.Clear();
00345         if (PostData &&
00346             PostData->vt == (VT_ARRAY | VT_UI1) &&
00347             PostData->parray)
00348         {
00349             mLastPostData.Copy(PostData);
00350             
00351             unsigned long nSizeData = PostData->parray->rgsabound[0].cElements;
00352             if (nSizeData > 0)
00353             {
00354                 char szCL[64];
00355                 sprintf(szCL, "Content-Length: %lu\r\n\r\n", nSizeData);
00356                 unsigned long nSizeCL = strlen(szCL);
00357                 unsigned long nSize = nSizeCL + nSizeData;
00358 
00359                 char *tmp = (char *) nsMemory::Alloc(nSize + 1); // byte stream owns this mem
00360                 if (tmp)
00361                 {
00362 
00363                     // Copy the array data into a buffer
00364                     SafeArrayLock(PostData->parray);
00365                     memcpy(tmp, szCL, nSizeCL);
00366                     memcpy(tmp + nSizeCL, PostData->parray->pvData, nSizeData);
00367                     tmp[nSize] = '\0';
00368                     SafeArrayUnlock(PostData->parray);
00369 
00370                     // Create a byte array input stream object.
00371                     nsCOMPtr<nsIByteArrayInputStream> stream;
00372                     nsresult rv = NS_NewByteArrayInputStream(
00373                         getter_AddRefs(stream), tmp, nSize);
00374                     if (NS_FAILED(rv) || !stream)
00375                     {
00376                         NS_ASSERTION(0, "cannot create byte stream");
00377                         nsMemory::Free(tmp);
00378                         return SetErrorInfo(E_UNEXPECTED);
00379                     }
00380 
00381                     postDataStream = stream;
00382                 }
00383             }
00384         }
00385 
00386         // Extract the headers parameter
00387         nsCOMPtr<nsIByteArrayInputStream> headersStream;
00388         if (Headers &&
00389             Headers->vt == VT_BSTR &&
00390             Headers->bstrVal)
00391         {
00392             
00393             USES_CONVERSION;
00394             char *headers = OLE2A(Headers->bstrVal);
00395             if (headers)
00396             {
00397                 size_t nSize = SysStringLen(Headers->bstrVal) + 1;
00398                 char *tmp = (char *) nsMemory::Alloc(nSize); // byteArray stream owns this mem
00399                 if (tmp)
00400                 {
00401                     // Copy BSTR to buffer
00402                     WideCharToMultiByte(CP_ACP, 0, Headers->bstrVal, nSize - 1, tmp, nSize, NULL, NULL);
00403                     tmp[nSize - 1] = '\0';
00404 
00405                     // Create a byte array input stream object which will own the buffer
00406                     nsCOMPtr<nsIByteArrayInputStream> stream;
00407                     nsresult rv = 
00408                         NS_NewByteArrayInputStream(getter_AddRefs(stream), tmp, nSize);
00409                     if (NS_FAILED(rv) || !stream)
00410                     {
00411                         NS_ASSERTION(0, "cannot create byte stream");
00412                         nsMemory::Free(tmp);
00413                     }
00414                     headersStream = do_QueryInterface(stream);
00415                 }
00416             }
00417         }
00418 
00419         // Use the specified target or the top level web navigation
00420         nsCOMPtr<nsIWebNavigation> webNavToUse;
00421         if (targetNav)
00422         {
00423             webNavToUse = targetNav;
00424         }
00425         else
00426         {
00427             GetWebNavigation(getter_AddRefs(webNavToUse));
00428         }
00429     
00430         // Load the URL    
00431         nsresult rv = NS_ERROR_FAILURE;
00432         if (webNavToUse)
00433         {
00434             rv = webNavToUse->LoadURI(URL,
00435                     loadFlags, nsnull, postDataStream, headersStream);
00436         }
00437 
00438         return NS_SUCCEEDED(rv) ? S_OK : E_FAIL;
00439     }
00440     
00441     virtual HRESULT STDMETHODCALLTYPE Refresh(void)
00442     {
00443         ATLTRACE(_T("IWebBrowserImpl::Refresh()\n"));
00444         // Reload the page
00445         CComVariant vRefreshType(REFRESH_NORMAL);
00446         return Refresh2(&vRefreshType);
00447     }
00448 
00449     virtual HRESULT STDMETHODCALLTYPE Refresh2(VARIANT __RPC_FAR *Level)
00450     {
00451         ATLTRACE(_T("IWebBrowserImpl::Refresh2()\n"));
00452 
00453         ENSURE_BROWSER_IS_VALID();
00454         ENSURE_GET_WEBNAV();
00455         if (Level == NULL)
00456             return E_INVALIDARG;
00457 
00458         // Check the requested refresh type
00459         OLECMDID_REFRESHFLAG iRefreshLevel = OLECMDIDF_REFRESH_NORMAL;
00460         CComVariant vLevelAsInt;
00461         if ( vLevelAsInt.ChangeType(VT_I4, Level) != S_OK )
00462         {
00463             NS_ASSERTION(0, "Cannot change refresh type to int");
00464             return SetErrorInfo(E_UNEXPECTED);
00465         }
00466         iRefreshLevel = (OLECMDID_REFRESHFLAG) vLevelAsInt.iVal;
00467 
00468         // Turn the IE refresh type into the nearest NG equivalent
00469         PRUint32 flags = nsIWebNavigation::LOAD_FLAGS_NONE;
00470         switch (iRefreshLevel & OLECMDIDF_REFRESH_LEVELMASK)
00471         {
00472         case OLECMDIDF_REFRESH_NORMAL:
00473         case OLECMDIDF_REFRESH_IFEXPIRED:
00474         case OLECMDIDF_REFRESH_CONTINUE:
00475         case OLECMDIDF_REFRESH_NO_CACHE:
00476         case OLECMDIDF_REFRESH_RELOAD:
00477             flags = nsIWebNavigation::LOAD_FLAGS_NONE;
00478             break;
00479         case OLECMDIDF_REFRESH_COMPLETELY:
00480             flags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
00481             break;
00482         default:
00483             // No idea what refresh type this is supposed to be
00484             NS_ASSERTION(0, "Unknown refresh type");
00485             return SetErrorInfo(E_UNEXPECTED);
00486         }
00487 
00488         webNav->Reload(flags);
00489 
00490         return S_OK;
00491     }
00492     virtual HRESULT STDMETHODCALLTYPE Stop(void)
00493     {
00494         ATLTRACE(_T("IWebBrowserImpl::Stop()\n"));
00495         ENSURE_BROWSER_IS_VALID();
00496         ENSURE_GET_WEBNAV();
00497         webNav->Stop(nsIWebNavigation::STOP_ALL);
00498         return S_OK;
00499     }
00500     virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
00501     {
00502         ATLTRACE(_T("IWebBrowserImpl::get_Application()\n"));
00503         ENSURE_BROWSER_IS_VALID();
00504         if (!ppDisp)
00505         {
00506             return SetErrorInfo(E_INVALIDARG);
00507         }
00508         // Return a pointer to this controls dispatch interface
00509         *ppDisp = (IDispatch *) this;
00510         (*ppDisp)->AddRef();
00511         return S_OK;
00512     }
00513     virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
00514     {
00515         // TODO
00516         return E_NOTIMPL;
00517     }
00518     virtual HRESULT STDMETHODCALLTYPE get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
00519     {
00520         ATLTRACE(_T("IWebBrowserImpl::get_Container()\n"));
00521         ENSURE_BROWSER_IS_VALID();
00522         if (!ppDisp)
00523         {
00524             return SetErrorInfo(E_INVALIDARG);
00525         }
00526         //TODO: Implement get_Container: Retrieve a pointer to the IDispatch interface of the container.
00527         *ppDisp = NULL;
00528         return SetErrorInfo(E_UNEXPECTED);
00529     }
00530     virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
00531     {
00532         ATLTRACE(_T("IWebBrowserImpl::get_Document()\n"));
00533         ENSURE_BROWSER_IS_VALID();
00534         if (!ppDisp)
00535         {
00536             return SetErrorInfo(E_INVALIDARG);
00537         }
00538         *ppDisp = NULL;
00539         return E_NOTIMPL;
00540     }
00541     virtual HRESULT STDMETHODCALLTYPE get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool)
00542     {
00543         ATLTRACE(_T("IWebBrowserImpl::get_TopLevelContainer()\n"));
00544         ENSURE_BROWSER_IS_VALID();
00545         if (!pBool)
00546         {
00547             return SetErrorInfo(E_INVALIDARG);
00548         }
00549         //TODO: Implement get_TopLevelContainer
00550         *pBool = VARIANT_TRUE;
00551         return S_OK;
00552     }
00553     
00554     virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR __RPC_FAR *Type)
00555     {
00556         ATLTRACE(_T("IWebBrowserImpl::get_Type()\n"));
00557         ENSURE_BROWSER_IS_VALID();
00558 
00559         //NOTE:    This code should work in theory, but can't be verified because GetDoctype
00560         //        has not been implemented yet.
00561 #if 0
00562         nsIDOMDocument *pIDOMDocument = nsnull;
00563         if ( SUCCEEDED(GetDOMDocument(&pIDOMDocument)) )
00564         {
00565             nsIDOMDocumentType *pIDOMDocumentType = nsnull;
00566             if ( SUCCEEDED(pIDOMDocument->GetDoctype(&pIDOMDocumentType)) )
00567             {
00568                 nsAutoString docName;
00569                 pIDOMDocumentType->GetName(docName);
00570                 //NG_TRACE("pIDOMDocumentType returns: %s", docName);
00571                 //Still need to manipulate docName so that it goes into *Type param of this function.
00572             }
00573         }
00574 #endif
00575         //TODO: Implement get_Type
00576         return SetErrorInfo(E_FAIL, L"get_Type: failed");
00577     }
00578 
00579     virtual HRESULT STDMETHODCALLTYPE get_Left(long __RPC_FAR *pl)
00580     {
00581         ATLTRACE(_T("IWebBrowserImpl::get_Left()\n"));
00582         ENSURE_BROWSER_IS_VALID();
00583         if (pl == NULL)
00584         {
00585             return SetErrorInfo(E_INVALIDARG);
00586         }
00587 
00588         //TODO: Implement get_Left - Should return the left position of this control.
00589         *pl = 0;
00590         return S_OK;
00591     }
00592     virtual HRESULT STDMETHODCALLTYPE put_Left(long Left)
00593     {
00594         ATLTRACE(_T("IWebBrowserImpl::put_Left()\n"));
00595         ENSURE_BROWSER_IS_VALID();
00596         //TODO: Implement put_Left - Should set the left position of this control.
00597         return S_OK;
00598     }
00599     virtual HRESULT STDMETHODCALLTYPE get_Top(long __RPC_FAR *pl)
00600     {
00601         ATLTRACE(_T("IWebBrowserImpl::get_Top()\n"));
00602         ENSURE_BROWSER_IS_VALID();
00603         if (pl == NULL)
00604         {
00605             return SetErrorInfo(E_INVALIDARG);
00606         }
00607         //TODO: Implement get_Top - Should return the top position of this control.
00608         *pl = 0;
00609         return S_OK;
00610     }
00611     virtual HRESULT STDMETHODCALLTYPE put_Top(long Top)
00612     {
00613         ATLTRACE(_T("IWebBrowserImpl::put_Top()\n"));
00614         ENSURE_BROWSER_IS_VALID();
00615         //TODO: Implement set_Top - Should set the top position of this control.
00616         return S_OK;
00617     }
00618     virtual HRESULT STDMETHODCALLTYPE get_Width(long __RPC_FAR *pl)
00619     {
00620         ATLTRACE(_T("IWebBrowserImpl::get_Width()\n"));
00621         ENSURE_BROWSER_IS_VALID();
00622         //TODO: Implement get_Width- Should return the width of this control.
00623         if (pl == NULL)
00624         {
00625             return SetErrorInfo(E_INVALIDARG);
00626         }
00627         *pl = 0;
00628         return S_OK;
00629     }
00630     virtual HRESULT STDMETHODCALLTYPE put_Width(long Width)
00631     {
00632         ATLTRACE(_T("IWebBrowserImpl::put_Width()\n"));
00633         ENSURE_BROWSER_IS_VALID();
00634         //TODO: Implement put_Width - Should set the width of this control.
00635         return S_OK;
00636     }
00637     virtual HRESULT STDMETHODCALLTYPE get_Height(long __RPC_FAR *pl)
00638     {
00639         ATLTRACE(_T("IWebBrowserImpl::get_Height()\n"));
00640         ENSURE_BROWSER_IS_VALID();
00641         if (pl == NULL)
00642         {
00643             return SetErrorInfo(E_INVALIDARG);
00644         }
00645 
00646         //TODO: Implement get_Height - Should return the hieght of this control.
00647         *pl = 0;
00648         return S_OK;
00649     }
00650     virtual HRESULT STDMETHODCALLTYPE put_Height(long Height)
00651     {
00652         ATLTRACE(_T("IWebBrowserImpl::put_Height()\n"));
00653         ENSURE_BROWSER_IS_VALID();
00654         //TODO: Implement put_Height - Should set the height of this control.
00655         return S_OK;
00656     }
00657 
00658     virtual HRESULT STDMETHODCALLTYPE get_LocationName(BSTR __RPC_FAR *LocationName)
00659     {
00660         ATLTRACE(_T("IWebBrowserImpl::get_LocationName()\n"));
00661         ENSURE_BROWSER_IS_VALID();
00662         if (LocationName == NULL)
00663         {
00664             return SetErrorInfo(E_INVALIDARG);
00665         }
00666         // Get the url from the web shell
00667         nsXPIDLString szLocationName;
00668         ENSURE_GET_WEBNAV();
00669         nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webNav);
00670         baseWindow->GetTitle(getter_Copies(szLocationName));
00671         if (nsnull == (const PRUnichar *) szLocationName)
00672         {
00673             return SetErrorInfo(E_UNEXPECTED);
00674         }
00675 
00676         // Convert the string to a BSTR
00677         USES_CONVERSION;
00678         LPCOLESTR pszConvertedLocationName = W2COLE((const PRUnichar *) szLocationName);
00679         *LocationName = SysAllocString(pszConvertedLocationName);
00680 
00681         return S_OK;
00682     }
00683     
00684     virtual HRESULT STDMETHODCALLTYPE get_LocationURL(BSTR __RPC_FAR *LocationURL)
00685     {
00686         ATLTRACE(_T("IWebBrowserImpl::get_LocationURL()\n"));
00687         ENSURE_BROWSER_IS_VALID();
00688 
00689         if (LocationURL == NULL)
00690         {
00691             return SetErrorInfo(E_INVALIDARG);
00692         }
00693         nsCOMPtr<nsIURI> uri;
00694         // Get the current url from the browser
00695         nsCOMPtr<nsIWebNavigation> webNav;
00696         GetWebNavigation(getter_AddRefs(webNav));
00697         if (webNav)
00698         {
00699             webNav->GetCurrentURI(getter_AddRefs(uri));
00700         }
00701         if (uri)
00702         {
00703             USES_CONVERSION;
00704             nsCAutoString aURI;
00705             uri->GetAsciiSpec(aURI);
00706             *LocationURL = SysAllocString(A2OLE(aURI.get()));
00707         }
00708         else
00709         {
00710             *LocationURL = NULL;
00711         }
00712 
00713     return S_OK;
00714     }
00715     
00716     virtual HRESULT STDMETHODCALLTYPE get_Busy(VARIANT_BOOL __RPC_FAR *pBool)
00717     {
00718         ATLTRACE(_T("IWebBrowserImpl::get_Busy()\n"));
00719         ENSURE_BROWSER_IS_VALID();
00720         if (!pBool)
00721         {
00722             return SetErrorInfo(E_INVALIDARG);
00723         }
00724         *pBool = (mBusyFlag) ? VARIANT_TRUE : VARIANT_FALSE;
00725         return S_OK;
00726     }
00727 
00728 // IWebBrowserApp implementation
00729     virtual HRESULT STDMETHODCALLTYPE Quit(void)
00730     {
00731         ATLTRACE(_T("IWebBrowserImpl::Quit()\n"));
00732         ENSURE_BROWSER_IS_VALID();
00733 
00734         //This generates an exception in the IE control.
00735         // TODO fire quit event
00736         return S_OK;
00737     }
00738 
00739     virtual HRESULT STDMETHODCALLTYPE ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy)
00740     {
00741         ATLTRACE(_T("IWebBrowserImpl::ClientToWindow()\n"));
00742         ENSURE_BROWSER_IS_VALID();
00743 
00744         //This generates an exception in the IE control.
00745         // TODO convert points to be relative to browser
00746         return S_OK;
00747     }
00748     
00749     virtual HRESULT STDMETHODCALLTYPE PutProperty(BSTR Property, VARIANT vtValue)
00750     {
00751         ATLTRACE(_T("IWebBrowserImpl::PutProperty()\n"));
00752         ENSURE_BROWSER_IS_VALID();
00753         if (Property == NULL)
00754         {
00755             return SetErrorInfo(E_INVALIDARG);
00756         }
00757         mPropertyList.AddOrReplaceNamedProperty(Property, vtValue);
00758         return S_OK;
00759     }
00760     
00761     virtual HRESULT STDMETHODCALLTYPE GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue)
00762     {
00763         ATLTRACE(_T("IWebBrowserImpl::GetProperty()\n"));
00764         ENSURE_BROWSER_IS_VALID();
00765         if (Property == NULL || pvtValue == NULL)
00766         {
00767             return SetErrorInfo(E_INVALIDARG);
00768         }
00769         VariantInit(pvtValue);
00770         for (unsigned long i = 0; i < mPropertyList.GetSize(); i++)
00771         {
00772             if (wcsicmp(mPropertyList.GetNameOf(i), Property) == 0)
00773             {
00774                 // Copy the new value
00775                 VariantCopy(pvtValue, const_cast<VARIANT *>(mPropertyList.GetValueOf(i)));
00776                 return S_OK;
00777             }
00778         }
00779         return S_OK;
00780     }
00781     
00782     virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR __RPC_FAR *Name)
00783     {
00784         ATLTRACE(_T("IWebBrowserImpl::get_Name()\n"));
00785         ENSURE_BROWSER_IS_VALID();
00786         if (Name == NULL)
00787         {
00788             return SetErrorInfo(E_INVALIDARG);
00789         }
00790 
00791         // TODO: Implement get_Name (get Mozilla's executable name)
00792         *Name = SysAllocString(L"Mozilla Web Browser Control");
00793         return S_OK;
00794     }
00795     
00796     virtual HRESULT STDMETHODCALLTYPE get_HWND(long __RPC_FAR *pHWND)
00797     {
00798         ATLTRACE(_T("IWebBrowserImpl::get_HWND()\n"));
00799         ENSURE_BROWSER_IS_VALID();
00800         if (pHWND == NULL)
00801         {
00802             return SetErrorInfo(E_INVALIDARG);
00803         }
00804 
00805         //This is supposed to return a handle to the IE main window.  Since that doesn't exist
00806         //in the control's case, this shouldn't do anything.
00807         *pHWND = NULL;
00808         return S_OK;
00809     }
00810     
00811     virtual HRESULT STDMETHODCALLTYPE get_FullName(BSTR __RPC_FAR *FullName)
00812     {
00813         ATLTRACE(_T("IWebBrowserImpl::get_FullName()\n"));
00814         ENSURE_BROWSER_IS_VALID();
00815         if (FullName == NULL)
00816         {
00817             return SetErrorInfo(E_INVALIDARG);
00818         }
00819 
00820         // TODO: Implement get_FullName (Return the full path of the executable containing this control)
00821         *FullName = SysAllocString(L""); // TODO get Mozilla's executable name
00822         return S_OK;
00823     }
00824     
00825     virtual HRESULT STDMETHODCALLTYPE get_Path(BSTR __RPC_FAR *Path)
00826     {
00827         ATLTRACE(_T("IWebBrowserImpl::get_Path()\n"));
00828         ENSURE_BROWSER_IS_VALID();
00829 
00830         if (Path == NULL)
00831         {
00832             return SetErrorInfo(E_INVALIDARG);
00833         }
00834 
00835         // TODO: Implement get_Path (get Mozilla's path)
00836         *Path = SysAllocString(L"");
00837         return S_OK;
00838     }
00839     
00840     virtual HRESULT STDMETHODCALLTYPE get_Visible(VARIANT_BOOL __RPC_FAR *pBool)
00841     {
00842         ATLTRACE(_T("IWebBrowserImpl::get_Visible()\n"));
00843         ENSURE_BROWSER_IS_VALID();
00844 
00845         if (pBool == NULL)
00846         {
00847             return SetErrorInfo(E_INVALIDARG);
00848         }
00849 
00850         //TODO: Implement get_Visible?
00851         *pBool = VARIANT_TRUE;
00852         return S_OK;
00853     }
00854     
00855     virtual HRESULT STDMETHODCALLTYPE put_Visible(VARIANT_BOOL Value)
00856     {
00857         ATLTRACE(_T("IWebBrowserImpl::put_Visible()\n"));
00858         ENSURE_BROWSER_IS_VALID();
00859 
00860         //TODO: Implement put_Visible?
00861         return S_OK;
00862     }
00863     
00864     virtual HRESULT STDMETHODCALLTYPE get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool)
00865     {
00866         ATLTRACE(_T("IWebBrowserImpl::get_StatusBar()\n"));
00867         ENSURE_BROWSER_IS_VALID();
00868         if (pBool == NULL)
00869         {
00870             return SetErrorInfo(E_INVALIDARG);
00871         }
00872         //There is no StatusBar in this control.
00873         *pBool = VARIANT_FALSE;
00874         return S_OK;
00875     }
00876     
00877     virtual HRESULT STDMETHODCALLTYPE put_StatusBar(VARIANT_BOOL Value)
00878     {
00879         ATLTRACE(_T("IWebBrowserImpl::put_StatusBar()\n"));
00880         ENSURE_BROWSER_IS_VALID();
00881         //There is no StatusBar in this control.
00882         return S_OK;
00883     }
00884     
00885     virtual HRESULT STDMETHODCALLTYPE get_StatusText(BSTR __RPC_FAR *StatusText)
00886     {
00887         ATLTRACE(_T("IWebBrowserImpl::get_StatusText()\n"));
00888         ENSURE_BROWSER_IS_VALID();
00889         if (StatusText == NULL)
00890         {
00891             return SetErrorInfo(E_INVALIDARG);
00892         }
00893 
00894         //TODO: Implement get_StatusText
00895         //NOTE: This function is related to the MS status bar which doesn't exist in this control.  Needs more
00896         //        investigation, but probably doesn't apply.
00897         *StatusText = SysAllocString(L"");
00898         return S_OK;
00899     }
00900     
00901     virtual HRESULT STDMETHODCALLTYPE put_StatusText(BSTR StatusText)
00902     {
00903         ATLTRACE(_T("IWebBrowserImpl::put_StatusText()\n"));
00904         ENSURE_BROWSER_IS_VALID();
00905         //TODO: Implement put_StatusText
00906         //NOTE: This function is related to the MS status bar which doesn't exist in this control.  Needs more
00907         //        investigation, but probably doesn't apply.
00908         return S_OK;
00909     }
00910     
00911     virtual HRESULT STDMETHODCALLTYPE get_ToolBar(int __RPC_FAR *Value)
00912     {
00913         ATLTRACE(_T("IWebBrowserImpl::get_ToolBar()\n"));
00914         ENSURE_BROWSER_IS_VALID();
00915         if (Value == NULL)
00916         {
00917             return SetErrorInfo(E_INVALIDARG);
00918         }
00919 
00920         //There is no ToolBar in this control.
00921         *Value = FALSE;
00922         return S_OK;
00923     }
00924     
00925     virtual HRESULT STDMETHODCALLTYPE put_ToolBar(int Value)
00926     {
00927         ATLTRACE(_T("IWebBrowserImpl::put_ToolBar()\n"));
00928         ENSURE_BROWSER_IS_VALID();
00929         //There is no ToolBar in this control.
00930         return S_OK;
00931     }
00932     
00933     virtual HRESULT STDMETHODCALLTYPE get_MenuBar(VARIANT_BOOL __RPC_FAR *Value)
00934     {
00935         ATLTRACE(_T("IWebBrowserImpl::get_MenuBar()\n"));
00936         ENSURE_BROWSER_IS_VALID();
00937         if (Value == NULL)
00938         {
00939             return SetErrorInfo(E_INVALIDARG);
00940         }
00941 
00942         //There is no MenuBar in this control.
00943         *Value = VARIANT_FALSE;
00944         return S_OK;
00945     }
00946     
00947     virtual HRESULT STDMETHODCALLTYPE put_MenuBar(VARIANT_BOOL Value)
00948     {
00949         ATLTRACE(_T("IWebBrowserImpl::put_MenuBar()\n"));
00950         ENSURE_BROWSER_IS_VALID();
00951         //There is no MenuBar in this control.
00952         return S_OK;
00953     }
00954     
00955     virtual HRESULT STDMETHODCALLTYPE get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen)
00956     {
00957         ATLTRACE(_T("IWebBrowserImpl::get_FullScreen()\n"));
00958         ENSURE_BROWSER_IS_VALID();
00959         if (pbFullScreen == NULL)
00960         {
00961             return SetErrorInfo(E_INVALIDARG);
00962         }
00963 
00964         //FullScreen mode doesn't really apply to this control.
00965         *pbFullScreen = VARIANT_FALSE;
00966         return S_OK;
00967     }
00968     
00969     virtual HRESULT STDMETHODCALLTYPE put_FullScreen(VARIANT_BOOL bFullScreen)
00970     {
00971         ATLTRACE(_T("IWebBrowserImpl::put_FullScreen()\n"));
00972         ENSURE_BROWSER_IS_VALID();
00973         //FullScreen mode doesn't really apply to this control.
00974         return S_OK;
00975     }
00976 
00977 // IWebBrowser2 implementation
00978     virtual HRESULT STDMETHODCALLTYPE Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers)
00979     {
00980         ATLTRACE(_T("IWebBrowserImpl::Navigate2()\n"));
00981         CComVariant vURLAsString;
00982         if (vURLAsString.ChangeType(VT_BSTR, URL) != S_OK)
00983         {
00984             return SetErrorInfo(E_INVALIDARG);
00985         }
00986         return Navigate(vURLAsString.bstrVal, Flags, TargetFrameName, PostData, Headers);
00987     }
00988     
00989     virtual HRESULT STDMETHODCALLTYPE QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf)
00990     {
00991         ATLTRACE(_T("IWebBrowserImpl::QueryStatusWB()\n"));
00992         ENSURE_BROWSER_IS_VALID();
00993         if (pcmdf == NULL)
00994         {
00995             return SetErrorInfo(E_INVALIDARG);
00996         }
00997         // Call through to IOleCommandTarget::QueryStatus
00998         CComQIPtr<IOleCommandTarget> cmdTarget = this;
00999         if (cmdTarget)
01000         {
01001             OLECMD cmd;
01002             HRESULT hr;
01003     
01004             cmd.cmdID = cmdID;
01005             cmd.cmdf = 0;
01006             hr = cmdTarget->QueryStatus(NULL, 1, &cmd, NULL);
01007             if (SUCCEEDED(hr))
01008             {
01009                 *pcmdf = (OLECMDF) cmd.cmdf;
01010             }
01011             return hr;
01012         }
01013         return E_NOTIMPL;
01014     }
01015     
01016     virtual HRESULT STDMETHODCALLTYPE ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut)
01017     {
01018         ATLTRACE(_T("IWebBrowserImpl::ExecWB()\n"));
01019         ENSURE_BROWSER_IS_VALID();
01020         // Call through to IOleCommandTarget::Exec
01021         CComQIPtr<IOleCommandTarget> cmdTarget = this;
01022         if (cmdTarget)
01023         {
01024             return cmdTarget->Exec(NULL, cmdID, cmdexecopt, pvaIn, pvaOut);
01025         }
01026         return E_NOTIMPL;
01027     }
01028     
01029     virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize)
01030     {
01031         ATLTRACE(_T("IWebBrowserImpl::ShowBrowserBar()\n"));
01032         ENSURE_BROWSER_IS_VALID();
01033         return S_OK;
01034     }
01035     
01036     virtual HRESULT STDMETHODCALLTYPE get_ReadyState(READYSTATE __RPC_FAR *plReadyState)
01037     {
01038         ATLTRACE(_T("IWebBrowserImpl::get_ReadyState()\n"));
01039         // Note: may be called when browser is not yet initialized so there
01040         // is no validity check here.
01041         if (plReadyState == NULL)
01042         {
01043             return SetErrorInfo(E_INVALIDARG);
01044         }
01045         *plReadyState = mBrowserReadyState;
01046         return S_OK;
01047     }
01048     
01049     virtual HRESULT STDMETHODCALLTYPE get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline)
01050     {
01051         ATLTRACE(_T("IWebBrowserImpl::get_Offline()\n"));
01052         ENSURE_BROWSER_IS_VALID();
01053         if (pbOffline == NULL)
01054         {
01055             return SetErrorInfo(E_INVALIDARG);
01056         }
01057         //TODO: Implement get_Offline
01058         *pbOffline = VARIANT_FALSE;
01059         return S_OK;
01060     }
01061     virtual HRESULT STDMETHODCALLTYPE put_Offline(VARIANT_BOOL bOffline)
01062     {
01063         ATLTRACE(_T("IWebBrowserImpl::put_Offline()\n"));
01064         ENSURE_BROWSER_IS_VALID();
01065         //TODO: Implement get_Offline
01066         return S_OK;
01067     }
01068     
01069     virtual HRESULT STDMETHODCALLTYPE get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent)
01070     {
01071         ATLTRACE(_T("IWebBrowserImpl::get_Silent()\n"));
01072         ENSURE_BROWSER_IS_VALID();
01073         if (pbSilent == NULL)
01074         {
01075             return SetErrorInfo(E_INVALIDARG);
01076         }
01077         //Only really applies to the IE app, not a control
01078         *pbSilent = VARIANT_FALSE;
01079         return S_OK;
01080     }
01081     virtual HRESULT STDMETHODCALLTYPE put_Silent(VARIANT_BOOL bSilent)
01082     {
01083         ATLTRACE(_T("IWebBrowserImpl::put_Silent()\n"));
01084         ENSURE_BROWSER_IS_VALID();
01085         //Only really applies to the IE app, not a control
01086         return S_OK;
01087     }
01088     
01089     virtual HRESULT STDMETHODCALLTYPE get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister)
01090     {
01091         ATLTRACE(_T("IWebBrowserImpl::get_RegisterAsBrowser()\n"));
01092         ENSURE_BROWSER_IS_VALID();
01093 
01094         if (pbRegister == NULL)
01095         {
01096             return SetErrorInfo(E_INVALIDARG);
01097         }
01098         //TODO: Implement get_RegisterAsBrowser
01099         *pbRegister = VARIANT_FALSE;
01100         return S_OK;
01101     }
01102     virtual HRESULT STDMETHODCALLTYPE put_RegisterAsBrowser(VARIANT_BOOL bRegister)
01103     {
01104         ATLTRACE(_T("IWebBrowserImpl::put_RegisterAsBrowser()\n"));
01105         ENSURE_BROWSER_IS_VALID();
01106         //TODO: Implement put_RegisterAsBrowser
01107         return S_OK;
01108     }
01109     
01110     virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister)
01111     {
01112         // TODO
01113         return E_NOTIMPL;
01114     }
01115     virtual HRESULT STDMETHODCALLTYPE put_RegisterAsDropTarget(VARIANT_BOOL bRegister)
01116     {
01117         // TODO
01118         return E_NOTIMPL;
01119     }
01120     
01121     virtual HRESULT STDMETHODCALLTYPE get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister)
01122     {
01123         ATLTRACE(_T("IWebBrowserImpl::get_TheaterMode()\n"));
01124         ENSURE_BROWSER_IS_VALID();
01125         if (pbRegister == NULL)
01126         {
01127             return SetErrorInfo(E_INVALIDARG);
01128         }
01129         // TheaterMode doesn't apply to this control.
01130         *pbRegister = VARIANT_FALSE;
01131         return S_OK;
01132     }
01133     virtual HRESULT STDMETHODCALLTYPE put_TheaterMode(VARIANT_BOOL bRegister)
01134     {
01135         ATLTRACE(_T("IWebBrowserImpl::put_TheaterMode()\n"));
01136         ENSURE_BROWSER_IS_VALID();
01137         //There is no TheaterMode in this control.
01138         return S_OK;
01139     }
01140 
01141     virtual HRESULT STDMETHODCALLTYPE get_AddressBar(VARIANT_BOOL __RPC_FAR *Value)
01142     {
01143         ATLTRACE(_T("IWebBrowserImpl::get_AddressBar()\n"));
01144         ENSURE_BROWSER_IS_VALID();
01145         if (Value == NULL)
01146         {
01147             return SetErrorInfo(E_INVALIDARG);
01148         }
01149         //There is no AddressBar in this control.
01150         *Value = VARIANT_FALSE;
01151         return S_OK;
01152     }
01153     virtual HRESULT STDMETHODCALLTYPE put_AddressBar(VARIANT_BOOL Value)
01154     {
01155         ATLTRACE(_T("IWebBrowserImpl::put_AddressBar()\n"));
01156         ENSURE_BROWSER_IS_VALID();
01157         //There is no AddressBar in this control.
01158         return S_OK;
01159     }
01160     
01161     virtual HRESULT STDMETHODCALLTYPE get_Resizable(VARIANT_BOOL __RPC_FAR *Value)
01162     {
01163         ATLTRACE(_T("IWebBrowserImpl::get_Resizable()\n"));
01164         ENSURE_BROWSER_IS_VALID();
01165         if (Value == NULL)
01166         {
01167             return SetErrorInfo(E_INVALIDARG);
01168         }
01169         //TODO:  Not sure if this should actually be implemented or not.
01170         *Value = VARIANT_TRUE;
01171         return S_OK;
01172     }
01173     virtual HRESULT STDMETHODCALLTYPE put_Resizable(VARIANT_BOOL Value)
01174     {
01175         ATLTRACE(_T("IWebBrowserImpl::put_Resizable()\n"));
01176         ENSURE_BROWSER_IS_VALID();
01177         //TODO:  Not sure if this should actually be implemented or not.
01178         return S_OK;
01179     }
01180 };
01181 
01182 #endif