From d6108c6c247121781c8950047039db544dfc683d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 2 Nov 2006 17:34:01 +0100 Subject: [PATCH] mshtml: Added beginning of set_progress task implementation. --- dlls/mshtml/mshtml_private.h | 3 ++- dlls/mshtml/persist.c | 10 +++++++++ dlls/mshtml/task.c | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index b3ad4798927..b352c5fc473 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -353,7 +353,8 @@ typedef struct task_t { enum { TASK_SETDOWNLOADSTATE, - TASK_PARSECOMPLETE + TASK_PARSECOMPLETE, + TASK_SETPROGRESS } task_id; struct task_t *next; diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 7b35e96e210..39c3a7e47c6 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -243,6 +243,16 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva bscallback = create_bscallback(pimkName); + if(This->frame) { + task = mshtml_alloc(sizeof(task_t)); + + task->doc = This; + task->task_id = TASK_SETPROGRESS; + task->next = NULL; + + push_task(task); + } + task = mshtml_alloc(sizeof(task_t)); task->doc = This; diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 6b5d0931e36..84108d1b886 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -179,6 +179,44 @@ static void set_parsecomplete(HTMLDocument *doc) } } +static void set_progress(HTMLDocument *doc) +{ + IOleCommandTarget *olecmd = NULL; + HRESULT hres; + + TRACE("(%p)\n", doc); + + if(doc->client) + IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd); + + if(olecmd) { + VARIANT progress_max, progress; + + V_VT(&progress_max) = VT_I4; + V_I4(&progress_max) = 0; /* FIXME */ + IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER, + &progress_max, NULL); + + V_VT(&progress) = VT_I4; + V_I4(&progress) = 0; /* FIXME */ + IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER, + &progress, NULL); + } + + if(doc->usermode == EDITMODE && doc->hostui) { + DOCHOSTUIINFO hostinfo; + + memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO)); + hostinfo.cbSize = sizeof(DOCHOSTUIINFO); + hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo); + if(SUCCEEDED(hres)) + /* FIXME: use hostinfo */ + TRACE("hostinfo = {%u %08x %08x %s %s}\n", + hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick, + debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS)); + } +} + static void process_task(task_t *task) { switch(task->task_id) { @@ -186,6 +224,8 @@ static void process_task(task_t *task) return set_downloading(task->doc); case TASK_PARSECOMPLETE: return set_parsecomplete(task->doc); + case TASK_SETPROGRESS: + return set_progress(task->doc); default: ERR("Wrong task_id %d\n", task->task_id); }