Back to index

lightning-sunbird  0.9+nobinonly
IEHtmlDocument.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 #ifndef IEHTMLDOCUMENT_H
00039 #define IEHTMLDOCUMENT_H
00040 
00041 #include "nsIDOMHTMLDocument.h"
00042 #include "nsIDOMHTMLElement.h"
00043 
00044 #include "IEHtmlNode.h"
00045 
00046 class CMozillaBrowser;
00047 
00048 class CIEHtmlDocument :
00049     public CNode,
00050     public IDispatchImpl<IHTMLDocument2, &IID_IHTMLDocument2, &LIBID_MSHTML, 4, 0>,
00051     public IOleCommandTarget
00052 {
00053 public:
00054     CIEHtmlDocument();
00055 protected:
00056     virtual ~CIEHtmlDocument();
00057 
00058     // Pointer to browser that owns the document
00059     CMozillaBrowser *mControl;
00060     nsCOMPtr<nsIDOMHTMLDocument> mDOMDocument;
00061 
00062     HRESULT WriteCommon(SAFEARRAY __RPC_FAR * psarray, int bLn);
00063 
00064 public:
00065     virtual void SetParent(CMozillaBrowser *parent);
00066     virtual void SetNative(nsIDOMHTMLDocument *native);
00067 
00068 BEGIN_COM_MAP(CIEHtmlDocument)
00069     COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLDocument2)
00070     COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument, IHTMLDocument2)
00071     COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument2, IHTMLDocument2)
00072     COM_INTERFACE_ENTRY(IOleCommandTarget)
00073 END_COM_MAP()
00074 
00075     // IOleCommandTarget methods
00076     virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText);
00077     virtual HRESULT STDMETHODCALLTYPE Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut);
00078 
00079     // IHTMLDocument methods
00080     virtual HRESULT STDMETHODCALLTYPE get_Script(IDispatch __RPC_FAR *__RPC_FAR *p);
00081 
00082     // IHTMLDocument2 methods
00083     virtual  HRESULT STDMETHODCALLTYPE get_all(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00084     virtual  HRESULT STDMETHODCALLTYPE get_body(IHTMLElement __RPC_FAR *__RPC_FAR *p);
00085     virtual  HRESULT STDMETHODCALLTYPE get_activeElement(IHTMLElement __RPC_FAR *__RPC_FAR *p);
00086     virtual  HRESULT STDMETHODCALLTYPE get_images(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00087     virtual  HRESULT STDMETHODCALLTYPE get_applets(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00088     virtual  HRESULT STDMETHODCALLTYPE get_links(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00089     virtual  HRESULT STDMETHODCALLTYPE get_forms(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00090     virtual  HRESULT STDMETHODCALLTYPE get_anchors(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00091     virtual  HRESULT STDMETHODCALLTYPE put_title(BSTR v);
00092     virtual  HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p);
00093     virtual  HRESULT STDMETHODCALLTYPE get_scripts(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00094     virtual  HRESULT STDMETHODCALLTYPE put_designMode(BSTR v);
00095     virtual  HRESULT STDMETHODCALLTYPE get_designMode(BSTR __RPC_FAR *p);
00096     virtual  HRESULT STDMETHODCALLTYPE get_selection(IHTMLSelectionObject __RPC_FAR *__RPC_FAR *p);
00097     virtual  HRESULT STDMETHODCALLTYPE get_readyState(BSTR __RPC_FAR *p);
00098     virtual  HRESULT STDMETHODCALLTYPE get_frames(IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p);
00099     virtual  HRESULT STDMETHODCALLTYPE get_embeds(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00100     virtual  HRESULT STDMETHODCALLTYPE get_plugins(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p);
00101     virtual  HRESULT STDMETHODCALLTYPE put_alinkColor(VARIANT v);
00102     virtual  HRESULT STDMETHODCALLTYPE get_alinkColor(VARIANT __RPC_FAR *p);
00103     virtual  HRESULT STDMETHODCALLTYPE put_bgColor(VARIANT v);
00104     virtual  HRESULT STDMETHODCALLTYPE get_bgColor(VARIANT __RPC_FAR *p);
00105     virtual  HRESULT STDMETHODCALLTYPE put_fgColor(VARIANT v);
00106     virtual  HRESULT STDMETHODCALLTYPE get_fgColor(VARIANT __RPC_FAR *p);
00107     virtual  HRESULT STDMETHODCALLTYPE put_linkColor(VARIANT v);
00108     virtual  HRESULT STDMETHODCALLTYPE get_linkColor(VARIANT __RPC_FAR *p);
00109     virtual  HRESULT STDMETHODCALLTYPE put_vlinkColor(VARIANT v);
00110     virtual  HRESULT STDMETHODCALLTYPE get_vlinkColor(VARIANT __RPC_FAR *p);
00111     virtual  HRESULT STDMETHODCALLTYPE get_referrer(BSTR __RPC_FAR *p);
00112     virtual  HRESULT STDMETHODCALLTYPE get_location(IHTMLLocation __RPC_FAR *__RPC_FAR *p);
00113     virtual  HRESULT STDMETHODCALLTYPE get_lastModified(BSTR __RPC_FAR *p);
00114     virtual  HRESULT STDMETHODCALLTYPE put_URL(BSTR v);
00115     virtual  HRESULT STDMETHODCALLTYPE get_URL(BSTR __RPC_FAR *p);
00116     virtual  HRESULT STDMETHODCALLTYPE put_domain(BSTR v);
00117     virtual  HRESULT STDMETHODCALLTYPE get_domain(BSTR __RPC_FAR *p);
00118     virtual  HRESULT STDMETHODCALLTYPE put_cookie(BSTR v);
00119     virtual  HRESULT STDMETHODCALLTYPE get_cookie(BSTR __RPC_FAR *p);
00120     virtual  HRESULT STDMETHODCALLTYPE put_expando(VARIANT_BOOL v);
00121     virtual  HRESULT STDMETHODCALLTYPE get_expando(VARIANT_BOOL __RPC_FAR *p);
00122     virtual  HRESULT STDMETHODCALLTYPE put_charset(BSTR v);
00123     virtual  HRESULT STDMETHODCALLTYPE get_charset(BSTR __RPC_FAR *p);
00124     virtual  HRESULT STDMETHODCALLTYPE put_defaultCharset(BSTR v);
00125     virtual  HRESULT STDMETHODCALLTYPE get_defaultCharset(BSTR __RPC_FAR *p);
00126     virtual  HRESULT STDMETHODCALLTYPE get_mimeType(BSTR __RPC_FAR *p);
00127     virtual  HRESULT STDMETHODCALLTYPE get_fileSize(BSTR __RPC_FAR *p);
00128     virtual  HRESULT STDMETHODCALLTYPE get_fileCreatedDate(BSTR __RPC_FAR *p);
00129     virtual  HRESULT STDMETHODCALLTYPE get_fileModifiedDate(BSTR __RPC_FAR *p);
00130     virtual  HRESULT STDMETHODCALLTYPE get_fileUpdatedDate(BSTR __RPC_FAR *p);
00131     virtual  HRESULT STDMETHODCALLTYPE get_security(BSTR __RPC_FAR *p);
00132     virtual  HRESULT STDMETHODCALLTYPE get_protocol(BSTR __RPC_FAR *p);
00133     virtual  HRESULT STDMETHODCALLTYPE get_nameProp(BSTR __RPC_FAR *p);
00134     virtual  HRESULT STDMETHODCALLTYPE write(SAFEARRAY __RPC_FAR * psarray);
00135     virtual  HRESULT STDMETHODCALLTYPE writeln(SAFEARRAY __RPC_FAR * psarray);
00136     virtual  HRESULT STDMETHODCALLTYPE open(BSTR url, VARIANT name, VARIANT features, VARIANT replace, IDispatch __RPC_FAR *__RPC_FAR *pomWindowResult);
00137     virtual  HRESULT STDMETHODCALLTYPE close(void);
00138     virtual  HRESULT STDMETHODCALLTYPE clear(void);
00139     virtual  HRESULT STDMETHODCALLTYPE queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet);
00140     virtual  HRESULT STDMETHODCALLTYPE queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet);
00141     virtual  HRESULT STDMETHODCALLTYPE queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet);
00142     virtual  HRESULT STDMETHODCALLTYPE queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet);
00143     virtual  HRESULT STDMETHODCALLTYPE queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText);
00144     virtual  HRESULT STDMETHODCALLTYPE queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue);
00145     virtual  HRESULT STDMETHODCALLTYPE execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet);
00146     virtual  HRESULT STDMETHODCALLTYPE execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet);
00147     virtual  HRESULT STDMETHODCALLTYPE createElement(BSTR eTag, IHTMLElement __RPC_FAR *__RPC_FAR *newElem);
00148     virtual  HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v);
00149     virtual  HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p);
00150     virtual  HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v);
00151     virtual  HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p);
00152     virtual  HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v);
00153     virtual  HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p);
00154     virtual  HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v);
00155     virtual  HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p);
00156     virtual  HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v);
00157     virtual  HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p);
00158     virtual  HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v);
00159     virtual  HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p);
00160     virtual  HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v);
00161     virtual  HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p);
00162     virtual  HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v);
00163     virtual  HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p);
00164     virtual  HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v);
00165     virtual  HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p);
00166     virtual  HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v);
00167     virtual  HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p);
00168     virtual  HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v);
00169     virtual  HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p);
00170     virtual  HRESULT STDMETHODCALLTYPE put_onreadystatechange(VARIANT v);
00171     virtual  HRESULT STDMETHODCALLTYPE get_onreadystatechange(VARIANT __RPC_FAR *p);
00172     virtual  HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v);
00173     virtual  HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p);
00174     virtual  HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v);
00175     virtual  HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p);
00176     virtual  HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v);
00177     virtual  HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p);
00178     virtual  HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v);
00179     virtual  HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p);
00180     virtual  HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v);
00181     virtual  HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p);
00182     virtual  HRESULT STDMETHODCALLTYPE elementFromPoint(long x, long y, IHTMLElement __RPC_FAR *__RPC_FAR *elementHit);
00183     virtual  HRESULT STDMETHODCALLTYPE get_parentWindow(IHTMLWindow2 __RPC_FAR *__RPC_FAR *p);
00184     virtual  HRESULT STDMETHODCALLTYPE get_styleSheets(IHTMLStyleSheetsCollection __RPC_FAR *__RPC_FAR *p);
00185     virtual  HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v);
00186     virtual  HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p);
00187     virtual  HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v);
00188     virtual  HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p);
00189     virtual  HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String);
00190     virtual  HRESULT STDMETHODCALLTYPE createStyleSheet(BSTR bstrHref, long lIndex, IHTMLStyleSheet __RPC_FAR *__RPC_FAR *ppnewStyleSheet);
00191 };
00192 
00193 typedef CComObject<CIEHtmlDocument> CIEHtmlDocumentInstance;
00194 
00195 #endif