| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 /** | 1 /** |
| 2 * \file Wrapper.h Wrappers for Windows platform calls and the like. | 2 * \file Wrapper.h Wrappers for Windows platform calls and the like. |
| 3 * | 3 * |
| 4 * The main purpose of this file is to isolate Windows-specific data types, repl acing them with ones from the standard library. | 4 * The main purpose of this file is to isolate Windows-specific data types, repl acing them with ones from the standard library. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef WRAPPER_H | 7 #ifndef WRAPPER_H |
|
sergei
2014/07/08 11:58:34
`WRAPPER_H` is too generic and it's very easy to g
Eric
2014/07/08 17:46:37
This is the convention we've been using in all rec
| |
| 8 #define WRAPPER_H | 8 #define WRAPPER_H |
| 9 | 9 |
| 10 /* | 10 /* |
| 11 * We need ATL for the time being to write the Browser class, which wraps CComQI Ptr. | 11 * We need ATL for the time being to write the Browser class, which wraps CComQI Ptr. |
| 12 */ | 12 */ |
| 13 #include "ATL_Deprecate.h" | 13 #include "ATL_Deprecate.h" |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include <Mshtml.h> | |
| 17 #include <Exdisp.h> | 18 #include <Exdisp.h> |
| 18 | 19 |
| 19 namespace Wrapper | 20 namespace Wrapper |
| 20 { | 21 { |
| 21 /** | 22 /** |
| 22 * Wrapper for UrlUnescape | 23 * Wrapper for UrlUnescape |
| 23 * | 24 * |
| 24 * Modifies the string value in place. | 25 * Modifies the string value in place. |
| 25 */ | 26 */ |
| 26 std::wstring & Unescape_URL( std::wstring & url ) ; | 27 std::wstring & Unescape_URL( std::wstring & url ) ; |
| 27 | 28 |
| 28 /** | 29 /** |
| 29 * Wrapper around a pointer to an IWebBrowser2 interface. | 30 * Wrapper around a pointer to an IWebBrowser2 interface. |
| 30 */ | 31 */ |
| 31 class Browser | 32 class Browser |
|
Oleksandr
2014/06/26 00:48:43
I suppose the general idea is to make these classe
Eric
2014/06/26 15:13:56
Yes, basically.
| |
| 32 { | 33 { |
| 33 /** | 34 /** |
| 34 * The underlying browser | 35 * The underlying browser |
| 35 */ | 36 */ |
| 36 CComQIPtr<IWebBrowser2> _browser; | 37 IWebBrowser2 * _browser; |
| 37 | 38 |
| 38 public: | 39 public: |
| 39 /** | 40 /** |
| 40 * Ordinary constructor. | 41 * Ordinary constructor. |
| 41 */ | 42 */ |
| 42 Browser( CComQIPtr<IWebBrowser2> browser ) | 43 Browser( IWebBrowser2 * browser ) |
| 43 : _browser( browser ) | 44 : _browser( browser ) |
| 44 {} | 45 {} |
| 45 | 46 |
| 46 /** | 47 /** |
| 47 * Navigate to a url in a new tab, or failing that, in a new window. | 48 * Navigate to a url in a new tab, or failing that, in a new window. |
| 48 * | 49 * |
| 49 * return true iff navigation was successful | 50 * return true iff navigation was successful |
| 50 */ | 51 */ |
| 51 HRESULT navigate( std::wstring url ); | 52 HRESULT navigate( std::wstring url ); |
| 52 | 53 |
| 53 /** | 54 /** |
| 54 * Retrieve the "LocationURL" property | 55 * Retrieve the "LocationURL" property |
| 55 */ | 56 */ |
| 56 bool Location_URL( std::wstring & value ) const; | 57 bool Location_URL( std::wstring & value ) const; |
|
sergei
2014/07/08 11:58:34
It should be without the underscore.
| |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 /** | 60 /** |
| 60 * | 61 * |
| 61 */ | 62 */ |
| 62 class Internet_Bind_Info | 63 class Internet_Bind_Info |
|
sergei
2014/07/08 11:58:34
In the other parts of the project the naming conve
| |
| 63 { | 64 { |
| 64 IInternetBindInfo * _bind_info; | 65 IInternetBindInfo * _bind_info; |
| 65 public: | 66 public: |
| 66 Internet_Bind_Info( IInternetBindInfo * bind_info ) | 67 Internet_Bind_Info( IInternetBindInfo * bind_info ) |
| 67 : _bind_info( bind_info ) | 68 : _bind_info( bind_info ) |
| 68 {} | 69 {} |
| 69 | 70 |
| 70 std::wstring bind_string_single( BINDSTRING type ); | 71 std::wstring bind_string_single( BINDSTRING type ); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 /** | 74 /** |
| 74 * | 75 * |
| 75 */ | 76 */ |
| 76 class HTML_Element | 77 class HTML_Element |
|
sergei
2014/07/08 11:58:34
But here for me `HTML_Element` looks better than `
| |
| 77 { | 78 { |
| 78 IHTMLElement * _element; | 79 IHTMLElement * _element; |
| 79 public: | 80 public: |
| 80 HTML_Element( IHTMLElement * element ) | 81 HTML_Element( IHTMLElement * element ) |
| 81 : _element( element ) | 82 : _element( element ) |
| 82 {} | 83 {} |
| 83 | 84 |
| 84 /** | 85 /** |
| 85 * Retrieve an attribute value, if present. | 86 * Retrieve an attribute value, if present. |
| 86 * | 87 * |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 * \return | 180 * \return |
| 180 * IDispatch point to the element if the element is found | 181 * IDispatch point to the element if the element is found |
| 181 * 0 otherwise | 182 * 0 otherwise |
| 182 */ | 183 */ |
| 183 IDispatch * at( long index ); | 184 IDispatch * at( long index ); |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 } | 187 } |
| 187 | 188 |
| 188 #endif | 189 #endif |
| LEFT | RIGHT |