mshtml: Added beginning IDM_BROWSEMODE implementation.

This commit is contained in:
Jacek Caban 2006-06-30 23:44:04 +02:00 committed by Alexandre Julliard
parent a9cdb5b832
commit 346d5bc7d0
3 changed files with 34 additions and 5 deletions

View File

@ -47,6 +47,12 @@ typedef struct HTMLDOMNode HTMLDOMNode;
typedef struct ConnectionPoint ConnectionPoint;
typedef struct BSCallback BSCallback;
typedef enum {
UNKNOWN_USERMODE,
BROWSEMODE,
EDITMODE
} USERMODE;
typedef struct {
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
@ -78,6 +84,7 @@ typedef struct {
HWND hwnd;
HWND tooltips_hwnd;
USERMODE usermode;
BOOL in_place_active;
BOOL ui_active;
BOOL window_active;

View File

@ -30,6 +30,7 @@
#include "shlguid.h"
#include "mshtmdid.h"
#include "idispids.h"
#include "mshtmcid.h"
#include "wine/debug.h"
@ -237,6 +238,15 @@ static HRESULT exec_get_print_template(HTMLDocument *This, DWORD nCmdexecopt, VA
return E_NOTIMPL;
}
static HRESULT exec_browsemode(HTMLDocument *This)
{
WARN("(%p)\n", This);
This->usermode = BROWSEMODE;
return S_OK;
}
static const struct {
OLECMDF cmdf;
HRESULT (*func)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
@ -374,9 +384,14 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID);
return OLECMDERR_E_NOTSUPPORTED;
}else if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
switch(nCmdID) {
case IDM_BROWSEMODE:
return exec_browsemode(This);
default:
FIXME("unsupported nCmdID %ld of CGID_MSHTML group\n", nCmdID);
return OLECMDERR_E_NOTSUPPORTED;
}
}
FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
return OLECMDERR_E_UNKNOWNGROUP;

View File

@ -76,6 +76,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
if(This->client) {
IOleClientSite_Release(This->client);
This->client = NULL;
This->usermode = UNKNOWN_USERMODE;
}
if(This->hostui) {
@ -161,7 +162,9 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->client = pClientSite;
This->hostui = pDocHostUIHandler;
if(This->usermode == UNKNOWN_USERMODE)
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_SILENT);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
@ -571,9 +574,11 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
return S_OK;
if(V_VT(&res) == VT_BOOL) {
if(!V_BOOL(&res)) {
if(V_BOOL(&res)) {
This->usermode = BROWSEMODE;
}else {
FIXME("edit mode is not supported\n");
hres = E_FAIL;
This->usermode = EDITMODE;
}
}else {
FIXME("V_VT(res)=%d\n", V_VT(&res));
@ -679,6 +684,8 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
This->lpOleDocumentVtbl = &OleDocumentVtbl;
This->lpOleControlVtbl = &OleControlVtbl;
This->usermode = UNKNOWN_USERMODE;
This->client = NULL;
This->hostui = NULL;