Back to index

lightning-sunbird  0.9+nobinonly
IEHtmlElement.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@netscape.com>
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 IEHTMLELEMENT_H
00039 #define IEHTMLELEMENT_H
00040 
00041 #include "IEHtmlNode.h"
00042 #include "IEHtmlElementCollection.h"
00043 
00044 class CIEHtmlElement :
00045     public CNode,
00046     public IDispatchImpl<IHTMLElement, &IID_IHTMLElement, &LIBID_MSHTML>
00047 {
00048 public:
00049     DECLARE_AGGREGATABLE(CIEHtmlElement)
00050     CIEHtmlElement();
00051     HRESULT FinalConstruct( );
00052     void FinalRelease( );
00053 
00054 DECLARE_GET_CONTROLLING_UNKNOWN()
00055 
00056 protected:
00057     virtual ~CIEHtmlElement();
00058 
00059 public:
00060 
00061 BEGIN_COM_MAP(CIEHtmlElement)
00062     COM_INTERFACE_ENTRY2(IDispatch, IHTMLElement)
00063     COM_INTERFACE_ENTRY(IHTMLElement)
00064     COM_INTERFACE_ENTRY_AGGREGATE(__uuidof(IHTMLDOMNode), m_pNodeAgg)
00065 END_COM_MAP()
00066 
00067     virtual HRESULT GetChildren(CIEHtmlElementCollectionInstance **ppCollection);
00068     virtual HRESULT GetHtmlDomNode(CIEHtmlDomNode **ppHtmlDomNode);
00069     virtual HRESULT SetDOMNode(nsIDOMNode *pDomNode);
00070     virtual HRESULT SetParent(CNode *pParent);
00071 
00072     // Implementation of IHTMLElement
00073     virtual HRESULT STDMETHODCALLTYPE setAttribute(BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags);
00074     virtual HRESULT STDMETHODCALLTYPE getAttribute(BSTR strAttributeName, LONG lFlags, VARIANT __RPC_FAR *AttributeValue);
00075     virtual HRESULT STDMETHODCALLTYPE removeAttribute(BSTR strAttributeName, LONG lFlags, VARIANT_BOOL __RPC_FAR *pfSuccess);
00076     virtual HRESULT STDMETHODCALLTYPE put_className(BSTR v);
00077     virtual HRESULT STDMETHODCALLTYPE get_className(BSTR __RPC_FAR *p);
00078     virtual HRESULT STDMETHODCALLTYPE put_id(BSTR v);
00079     virtual HRESULT STDMETHODCALLTYPE get_id(BSTR __RPC_FAR *p);
00080     virtual HRESULT STDMETHODCALLTYPE get_tagName(BSTR __RPC_FAR *p);
00081     virtual HRESULT STDMETHODCALLTYPE get_parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *p);
00082     virtual HRESULT STDMETHODCALLTYPE get_style(IHTMLStyle __RPC_FAR *__RPC_FAR *p);
00083     virtual HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v);
00084     virtual HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p);
00085     virtual HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v);
00086     virtual HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p);
00087     virtual HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v);
00088     virtual HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p);
00089     virtual HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v);
00090     virtual HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p);
00091     virtual HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v);
00092     virtual HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p);
00093     virtual HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v);
00094     virtual HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p);
00095     virtual HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v);
00096     virtual HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p);
00097     virtual HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v);
00098     virtual HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p);
00099     virtual HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v);
00100     virtual HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p);
00101     virtual HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v);
00102     virtual HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p);
00103     virtual HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v);
00104     virtual HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p);
00105     virtual HRESULT STDMETHODCALLTYPE get_document(IDispatch __RPC_FAR *__RPC_FAR *p);
00106     virtual HRESULT STDMETHODCALLTYPE put_title(BSTR v);
00107     virtual HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p);
00108     virtual HRESULT STDMETHODCALLTYPE put_language(BSTR v);
00109     virtual HRESULT STDMETHODCALLTYPE get_language(BSTR __RPC_FAR *p);
00110     virtual HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v);
00111     virtual HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p);
00112     virtual HRESULT STDMETHODCALLTYPE scrollIntoView(VARIANT varargStart);
00113     virtual HRESULT STDMETHODCALLTYPE contains(IHTMLElement __RPC_FAR *pChild, VARIANT_BOOL __RPC_FAR *pfResult);
00114     virtual HRESULT STDMETHODCALLTYPE get_sourceIndex(long __RPC_FAR *p);
00115     virtual HRESULT STDMETHODCALLTYPE get_recordNumber(VARIANT __RPC_FAR *p);
00116     virtual HRESULT STDMETHODCALLTYPE put_lang(BSTR v);
00117     virtual HRESULT STDMETHODCALLTYPE get_lang(BSTR __RPC_FAR *p);
00118     virtual HRESULT STDMETHODCALLTYPE get_offsetLeft(long __RPC_FAR *p);
00119     virtual HRESULT STDMETHODCALLTYPE get_offsetTop(long __RPC_FAR *p);
00120     virtual HRESULT STDMETHODCALLTYPE get_offsetWidth(long __RPC_FAR *p);
00121     virtual HRESULT STDMETHODCALLTYPE get_offsetHeight(long __RPC_FAR *p);
00122     virtual HRESULT STDMETHODCALLTYPE get_offsetParent(IHTMLElement __RPC_FAR *__RPC_FAR *p);
00123     virtual HRESULT STDMETHODCALLTYPE put_innerHTML(BSTR v);
00124     virtual HRESULT STDMETHODCALLTYPE get_innerHTML(BSTR __RPC_FAR *p);
00125     virtual HRESULT STDMETHODCALLTYPE put_innerText(BSTR v);
00126     virtual HRESULT STDMETHODCALLTYPE get_innerText(BSTR __RPC_FAR *p);
00127     virtual HRESULT STDMETHODCALLTYPE put_outerHTML(BSTR v);
00128     virtual HRESULT STDMETHODCALLTYPE get_outerHTML(BSTR __RPC_FAR *p);
00129     virtual HRESULT STDMETHODCALLTYPE put_outerText(BSTR v);
00130     virtual HRESULT STDMETHODCALLTYPE get_outerText(BSTR __RPC_FAR *p);
00131     virtual HRESULT STDMETHODCALLTYPE insertAdjacentHTML(BSTR where, BSTR html);
00132     virtual HRESULT STDMETHODCALLTYPE insertAdjacentText(BSTR where, BSTR text);
00133     virtual HRESULT STDMETHODCALLTYPE get_parentTextEdit(IHTMLElement __RPC_FAR *__RPC_FAR *p);
00134     virtual HRESULT STDMETHODCALLTYPE get_isTextEdit(VARIANT_BOOL __RPC_FAR *p);
00135     virtual HRESULT STDMETHODCALLTYPE click(void);
00136     virtual HRESULT STDMETHODCALLTYPE get_filters(IHTMLFiltersCollection __RPC_FAR *__RPC_FAR *p);
00137     virtual HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v);
00138     virtual HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p);
00139     virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String);
00140     virtual HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v);
00141     virtual HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p);
00142     virtual HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v);
00143     virtual HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p);
00144     virtual HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v);
00145     virtual HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p);
00146     virtual HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v);
00147     virtual HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p);
00148     virtual HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v);
00149     virtual HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p);
00150     virtual HRESULT STDMETHODCALLTYPE put_ondatasetchanged(VARIANT v);
00151     virtual HRESULT STDMETHODCALLTYPE get_ondatasetchanged(VARIANT __RPC_FAR *p);
00152     virtual HRESULT STDMETHODCALLTYPE put_ondataavailable(VARIANT v);
00153     virtual HRESULT STDMETHODCALLTYPE get_ondataavailable(VARIANT __RPC_FAR *p);
00154     virtual HRESULT STDMETHODCALLTYPE put_ondatasetcomplete(VARIANT v);
00155     virtual HRESULT STDMETHODCALLTYPE get_ondatasetcomplete(VARIANT __RPC_FAR *p);
00156     virtual HRESULT STDMETHODCALLTYPE put_onfilterchange(VARIANT v);
00157     virtual HRESULT STDMETHODCALLTYPE get_onfilterchange(VARIANT __RPC_FAR *p);
00158     virtual HRESULT STDMETHODCALLTYPE get_children(IDispatch __RPC_FAR *__RPC_FAR *p);
00159     virtual HRESULT STDMETHODCALLTYPE get_all(IDispatch __RPC_FAR *__RPC_FAR *p);
00160     
00161 protected:
00162     IUnknown* m_pNodeAgg;
00163 };
00164 
00165 #define CIEHTMLELEMENT_INTERFACES \
00166     COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLElement) \
00167     COM_INTERFACE_ENTRY_IID(IID_IHTMLElement, IHTMLElement)
00168 
00169 typedef CComObject<CIEHtmlElement> CIEHtmlElementInstance;
00170 
00171 #endif
00172 
00173