FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
ActiveXCore/AXDOM/Element.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Sep 21, 2010
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2010 Facebook, Inc and the Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_AXDOM_ELEMENT
17 #define H_AXDOM_ELEMENT
18 
19 #include "win_common.h"
20 #include <atlctl.h>
21 #include <string>
22 #include <boost/lexical_cast.hpp>
23 #include "IDispatchAPI.h"
24 #include "JSObject.h"
25 #include "Node.h"
26 #include "DOM/Element.h"
27 
28 namespace FB { namespace ActiveX {
29  namespace AXDOM {
30 
36  class Element : public virtual FB::ActiveX::AXDOM::Node, public virtual FB::DOM::Element
37  {
38  public:
39  Element(const FB::JSObjectPtr& element, IWebBrowser *web);
40  virtual ~Element();
41 
42  virtual std::vector<FB::DOM::ElementPtr> getElementsByTagName(const std::string& tagName) const;
43  virtual std::string getStringAttribute(const std::string& attr) const;
44  virtual std::string getInnerHTML() const;
45  virtual void setInnerHTML(const std::string& html) const;
46 
47  public:
48  CComQIPtr<IDispatch> m_axDisp;
49  CComPtr<IWebBrowser> m_webBrowser;
50  };
51 
52  };
53 } }
54 
55 #endif // H_AXDOM_ELEMENT
56 
boost::shared_ptr< FB::JSObject > JSObjectPtr
Defines an alias representing a JSObject shared_ptr (you should never use a JSObject* directly) ...
Definition: APITypes.h:109
virtual void setInnerHTML(const std::string &html) const
Sets an inner html for the element.
Provides an ActiveX specific implementation of DOM::Node.
virtual std::vector< FB::DOM::ElementPtr > getElementsByTagName(const std::string &tagName) const
Gets a list of all elements in the document with the specified tag name.
DOM Element wrapper.
virtual std::string getInnerHTML() const
Gets the inner html for the element.
ActiveX specific implementation of DOM::Element.
ElementPtr element()
Gets a FB::DOM::ElementPtr pointing to the current object.