Commit 346d5bc7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added beginning IDM_BROWSEMODE implementation.

parent a9cdb5b8
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment