ReactOS 0.4.15-dev-5667-ged97270
olecmd.c File Reference
#include "mshtml_private.h"
Include dependency graph for olecmd.c:

Go to the source code of this file.

Classes

struct  refresh_task_t
 

Macros

#define NSCMD_COPY   "cmd_copy"
 
#define NSCMD_SELECTALL   "cmd_selectAll"
 

Functions

void do_ns_command (HTMLDocument *This, const char *cmd, nsICommandParams *nsparam)
 
static nsIClipboardCommandsget_clipboard_commands (HTMLDocument *doc)
 
static HTMLDocumentimpl_from_IOleCommandTarget (IOleCommandTarget *iface)
 
static HRESULT exec_open (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_new (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_save (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_save_as (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_save_copy_as (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static nsresult set_head_text (nsIPrintSettings *settings, LPCWSTR template, BOOL head, int pos)
 
static void set_print_template (nsIPrintSettings *settings, LPCWSTR template, BOOL head)
 
static void set_default_templates (nsIPrintSettings *settings)
 
static HRESULT exec_print (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_print_preview (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_page_setup (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_spell (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_properties (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_cut (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_copy (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_paste (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_paste_special (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_undo (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_rendo (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_select_all (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT exec_clear_selection (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_zoom (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_get_zoom_range (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static void refresh_proc (task_t *_task)
 
static void refresh_destr (task_t *_task)
 
static HRESULT exec_refresh (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_stop (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_stop_download (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_find (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_delete (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_enable_interaction (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_on_unload (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_show_page_setup (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_show_print (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_close (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_set_print_template (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_get_print_template (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT exec_optical_zoom (HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static HRESULT query_mshtml_copy (HTMLDocument *This, OLECMD *cmd)
 
static HRESULT exec_mshtml_copy (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT query_mshtml_cut (HTMLDocument *This, OLECMD *cmd)
 
static HRESULT exec_mshtml_cut (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT query_mshtml_paste (HTMLDocument *This, OLECMD *cmd)
 
static HRESULT exec_mshtml_paste (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT query_selall_status (HTMLDocument *This, OLECMD *cmd)
 
static HRESULT exec_browsemode (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT exec_editmode (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT exec_htmleditmode (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT exec_baselinefont3 (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT exec_respectvisibility_indesign (HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT query_enabled_stub (HTMLDocument *This, OLECMD *cmd)
 
static HRESULT WINAPI OleCommandTarget_QueryInterface (IOleCommandTarget *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI OleCommandTarget_AddRef (IOleCommandTarget *iface)
 
static ULONG WINAPI OleCommandTarget_Release (IOleCommandTarget *iface)
 
static HRESULT query_from_table (HTMLDocument *This, const cmdtable_t *cmdtable, OLECMD *cmd)
 
static HRESULT WINAPI OleCommandTarget_QueryStatus (IOleCommandTarget *iface, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
static HRESULT exec_from_table (HTMLDocument *This, const cmdtable_t *cmdtable, DWORD cmdid, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
 
static HRESULT WINAPI OleCommandTarget_Exec (IOleCommandTarget *iface, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
void show_context_menu (HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch *elem)
 
void HTMLDocument_OleCmd_Init (HTMLDocument *This)
 

Variables

struct {
   OLECMDF   cmdf
 
   HRESULT(*   func )(HTMLDocument *, DWORD,
       VARIANT *, VARIANT *)
 
exec_table []
 
static const cmdtable_t base_cmds []
 
static const IOleCommandTargetVtbl OleCommandTargetVtbl
 

Macro Definition Documentation

◆ NSCMD_COPY

#define NSCMD_COPY   "cmd_copy"

Definition at line 21 of file olecmd.c.

◆ NSCMD_SELECTALL

#define NSCMD_SELECTALL   "cmd_selectAll"

Definition at line 22 of file olecmd.c.

Function Documentation

◆ do_ns_command()

void do_ns_command ( HTMLDocument This,
const char cmd,
nsICommandParams nsparam 
)

Definition at line 24 of file olecmd.c.

25{
26 nsICommandManager *cmdmgr;
27 nsresult nsres;
28
29 TRACE("(%p)\n", This);
30
31 if(!This->doc_obj || !This->doc_obj->nscontainer)
32 return;
33
34 nsres = get_nsinterface((nsISupports*)This->doc_obj->nscontainer->webbrowser, &IID_nsICommandManager, (void**)&cmdmgr);
35 if(NS_FAILED(nsres)) {
36 ERR("Could not get nsICommandManager: %08x\n", nsres);
37 return;
38 }
39
40 nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, This->window->nswindow);
41 if(NS_FAILED(nsres))
42 ERR("DoCommand(%s) failed: %08x\n", debugstr_a(cmd), nsres);
43
44 nsICommandManager_Release(cmdmgr);
45}
#define ERR(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
nsresult get_nsinterface(nsISupports *, REFIID, void **) DECLSPEC_HIDDEN
Definition: nsembed.c:907
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
Definition: ftp_var.h:139

Referenced by exec_bold(), exec_copy(), exec_forecolor(), exec_horizontalline(), exec_indent(), exec_italic(), exec_mshtml_copy(), exec_orderlist(), exec_outdent(), exec_select_all(), exec_underline(), exec_unorderlist(), set_ns_align(), and set_ns_fontname().

◆ exec_baselinefont3()

static HRESULT exec_baselinefont3 ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 670 of file olecmd.c.

671{
672 FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
673 return S_OK;
674}
#define FIXME(fmt,...)
Definition: debug.h:111
GLuint in
Definition: glext.h:9616
#define S_OK
Definition: intsafe.h:52
static FILE * out
Definition: regtests2xml.c:44

◆ exec_browsemode()

static HRESULT exec_browsemode ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 642 of file olecmd.c.

643{
644 WARN("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
645
646 if(in || out)
647 FIXME("unsupported args\n");
648
649 This->doc_obj->usermode = BROWSEMODE;
650
651 return S_OK;
652}
#define WARN(fmt,...)
Definition: debug.h:112
@ BROWSEMODE

◆ exec_clear_selection()

static HRESULT exec_clear_selection ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 384 of file olecmd.c.

385{
386 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
387 return E_NOTIMPL;
388}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ exec_close()

static HRESULT exec_close ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 523 of file olecmd.c.

524{
525 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
526 return E_NOTIMPL;
527}

◆ exec_copy()

static HRESULT exec_copy ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 338 of file olecmd.c.

339{
340 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
341
343 return S_OK;
344}
#define NULL
Definition: types.h:112
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define NSCMD_COPY
Definition: olecmd.c:21
void do_ns_command(HTMLDocument *This, const char *cmd, nsICommandParams *nsparam)
Definition: olecmd.c:24

◆ exec_cut()

static HRESULT exec_cut ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 332 of file olecmd.c.

333{
334 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
335 return E_NOTIMPL;
336}

◆ exec_delete()

static HRESULT exec_delete ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 485 of file olecmd.c.

486{
487 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
488 return E_NOTIMPL;
489}

◆ exec_editmode()

static HRESULT exec_editmode ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 654 of file olecmd.c.

655{
656 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
657
658 if(in || out)
659 FIXME("unsupported args\n");
660
661 return setup_edit_mode(This->doc_obj);
662}
HRESULT setup_edit_mode(HTMLDocumentObj *doc)
Definition: editor.c:1221

◆ exec_enable_interaction()

static HRESULT exec_enable_interaction ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 491 of file olecmd.c.

492{
493 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
494 return E_NOTIMPL;
495}

◆ exec_find()

static HRESULT exec_find ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 479 of file olecmd.c.

480{
481 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
482 return E_NOTIMPL;
483}

◆ exec_from_table()

static HRESULT exec_from_table ( HTMLDocument This,
const cmdtable_t cmdtable,
DWORD  cmdid,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 873 of file olecmd.c.

875{
876 const cmdtable_t *iter = cmdtable;
877
878 while(iter->id && iter->id != cmdid)
879 iter++;
880
881 if(!iter->id || !iter->exec)
882 return OLECMDERR_E_NOTSUPPORTED;
883
884 return iter->exec(This, cmdexecopt, in, out);
885}
HRESULT(* exec)(HTMLDocument *, DWORD, VARIANT *, VARIANT *)

Referenced by OleCommandTarget_Exec().

◆ exec_get_print_template()

static HRESULT exec_get_print_template ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 535 of file olecmd.c.

536{
537 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
538 return E_NOTIMPL;
539}

◆ exec_get_zoom_range()

static HRESULT exec_get_zoom_range ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 396 of file olecmd.c.

397{
398 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
399 return E_NOTIMPL;
400}

◆ exec_htmleditmode()

static HRESULT exec_htmleditmode ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 664 of file olecmd.c.

665{
666 FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
667 return S_OK;
668}

◆ exec_mshtml_copy()

static HRESULT exec_mshtml_copy ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 561 of file olecmd.c.

562{
563 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
564
565 if(This->doc_obj->usermode == EDITMODE)
566 return editor_exec_copy(This, cmdexecopt, in, out);
567
569 return S_OK;
570}
HRESULT editor_exec_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: editor.c:870
@ EDITMODE

◆ exec_mshtml_cut()

static HRESULT exec_mshtml_cut ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 579 of file olecmd.c.

580{
581 nsIClipboardCommands *clipboard_commands;
582 nsresult nsres;
583
584 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
585
586 if(This->doc_obj->usermode == EDITMODE)
587 return editor_exec_cut(This, cmdexecopt, in, out);
588
589 clipboard_commands = get_clipboard_commands(This);
590 if(!clipboard_commands)
591 return E_UNEXPECTED;
592
593 nsres = nsIClipboardCommands_CutSelection(clipboard_commands);
594 nsIClipboardCommands_Release(clipboard_commands);
595 if(NS_FAILED(nsres)) {
596 ERR("Paste failed: %08x\n", nsres);
597 return E_FAIL;
598 }
599
600 return S_OK;
601}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT editor_exec_cut(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: editor.c:881
static nsIClipboardCommands * get_clipboard_commands(HTMLDocument *doc)
Definition: olecmd.c:47
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ exec_mshtml_paste()

static HRESULT exec_mshtml_paste ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 610 of file olecmd.c.

611{
612 nsIClipboardCommands *clipboard_commands;
613 nsresult nsres;
614
615 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
616
617 if(This->doc_obj->usermode == EDITMODE)
618 return editor_exec_paste(This, cmdexecopt, in, out);
619
620 clipboard_commands = get_clipboard_commands(This);
621 if(!clipboard_commands)
622 return E_UNEXPECTED;
623
624 nsres = nsIClipboardCommands_Paste(clipboard_commands);
625 nsIClipboardCommands_Release(clipboard_commands);
626 if(NS_FAILED(nsres)) {
627 ERR("Paste failed: %08x\n", nsres);
628 return E_FAIL;
629 }
630
631 return S_OK;
632}
HRESULT editor_exec_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: editor.c:892

◆ exec_new()

static HRESULT exec_new ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 84 of file olecmd.c.

85{
86 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
87 return E_NOTIMPL;
88}

◆ exec_on_unload()

static HRESULT exec_on_unload ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 497 of file olecmd.c.

498{
499 TRACE("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
500
501 /* Tests show that we have nothing more to do here */
502
503 if(pvaOut) {
504 V_VT(pvaOut) = VT_BOOL;
505 V_BOOL(pvaOut) = VARIANT_TRUE;
506 }
507
508 return S_OK;
509}
@ VT_BOOL
Definition: compat.h:2306
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211

◆ exec_open()

static HRESULT exec_open ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 78 of file olecmd.c.

79{
80 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
81 return E_NOTIMPL;
82}

◆ exec_optical_zoom()

static HRESULT exec_optical_zoom ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 541 of file olecmd.c.

542{
543 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
544
545 if(!pvaIn || V_VT(pvaIn) != VT_I4) {
546 FIXME("Unsupported argument %s\n", debugstr_variant(pvaIn));
547 return E_NOTIMPL;
548 }
549
550 set_viewer_zoom(This->doc_obj->nscontainer, (float)V_I4(pvaIn)/100);
551 return S_OK;
552}
@ VT_I4
Definition: compat.h:2298
void set_viewer_zoom(NSContainer *, float) DECLSPEC_HIDDEN
Definition: nsembed.c:1130
#define V_I4(A)
Definition: oleauto.h:247

◆ exec_page_setup()

static HRESULT exec_page_setup ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 314 of file olecmd.c.

315{
316 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
317 return E_NOTIMPL;
318}

◆ exec_paste()

static HRESULT exec_paste ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 346 of file olecmd.c.

347{
348 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
349 return E_NOTIMPL;
350}

◆ exec_paste_special()

static HRESULT exec_paste_special ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 352 of file olecmd.c.

353{
354 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
355 return E_NOTIMPL;
356}

◆ exec_print()

static HRESULT exec_print ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 223 of file olecmd.c.

224{
225 nsIWebBrowserPrint *nsprint;
227 nsresult nsres;
228
229 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
230
231 if(pvaOut)
232 FIXME("unsupported pvaOut\n");
233
234 if(!This->doc_obj->nscontainer)
235 return S_OK;
236
237 nsres = get_nsinterface((nsISupports*)This->doc_obj->nscontainer->webbrowser, &IID_nsIWebBrowserPrint,
238 (void**)&nsprint);
239 if(NS_FAILED(nsres)) {
240 ERR("Could not get nsIWebBrowserPrint: %08x\n", nsres);
241 return S_OK;
242 }
243
244 nsres = nsIWebBrowserPrint_GetGlobalPrintSettings(nsprint, &settings);
245 if(NS_FAILED(nsres))
246 ERR("GetCurrentPrintSettings failed: %08x\n", nsres);
247
249
250 if(pvaIn) {
251 switch(V_VT(pvaIn)) {
252 case VT_BYREF|VT_ARRAY: {
253 VARIANT *opts;
254 DWORD opts_cnt;
255
256 if(V_ARRAY(pvaIn)->cDims != 1)
257 WARN("cDims = %d\n", V_ARRAY(pvaIn)->cDims);
258
259 SafeArrayAccessData(V_ARRAY(pvaIn), (void**)&opts);
260 opts_cnt = V_ARRAY(pvaIn)->rgsabound[0].cElements;
261
262 if(opts_cnt >= 1) {
263 switch(V_VT(opts)) {
264 case VT_BSTR:
265 TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts)));
267 break;
268 case VT_NULL:
269 break;
270 default:
271 WARN("opts = %s\n", debugstr_variant(opts));
272 }
273 }
274
275 if(opts_cnt >= 2) {
276 switch(V_VT(opts+1)) {
277 case VT_BSTR:
278 TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts+1)));
280 break;
281 case VT_NULL:
282 break;
283 default:
284 WARN("opts[1] = %s\n", debugstr_variant(opts+1));
285 }
286 }
287
288 if(opts_cnt >= 3)
289 FIXME("Unsupported opts_cnt %d\n", opts_cnt);
290
292 break;
293 }
294 default:
295 FIXME("unsupported arg %s\n", debugstr_variant(pvaIn));
296 }
297 }
298
299 nsres = nsIWebBrowserPrint_Print(nsprint, settings, NULL);
300 if(NS_FAILED(nsres))
301 ERR("Print failed: %08x\n", nsres);
302
303 nsIWebBrowserPrint_Release(nsprint);
304
305 return S_OK;
306}
struct mke2fs_defaults settings[]
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ VT_BSTR
Definition: compat.h:2303
@ VT_NULL
Definition: compat.h:2296
@ VT_BYREF
Definition: compat.h:2342
@ VT_ARRAY
Definition: compat.h:2341
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
unsigned long DWORD
Definition: ntddk_ex.h:95
#define debugstr_w
Definition: kernel32.h:32
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_BSTR(A)
Definition: oleauto.h:226
static void set_print_template(nsIPrintSettings *settings, LPCWSTR template, BOOL head)
Definition: olecmd.c:133
static void set_default_templates(nsIPrintSettings *settings)
Definition: olecmd.c:199

◆ exec_print_preview()

static HRESULT exec_print_preview ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 308 of file olecmd.c.

309{
310 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
311 return E_NOTIMPL;
312}

◆ exec_properties()

static HRESULT exec_properties ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 326 of file olecmd.c.

327{
328 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
329 return E_NOTIMPL;
330}

◆ exec_refresh()

static HRESULT exec_refresh ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 435 of file olecmd.c.

436{
437 refresh_task_t *task;
439
440 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
441
442 if(This->doc_obj->client) {
443 IOleCommandTarget *olecmd;
444
445 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
446 if(SUCCEEDED(hres)) {
447 hres = IOleCommandTarget_Exec(olecmd, &CGID_DocHostCommandHandler, 2300, nCmdexecopt, pvaIn, pvaOut);
448 IOleCommandTarget_Release(olecmd);
449 if(SUCCEEDED(hres))
450 return S_OK;
451 }
452 }
453
454 if(!This->window)
455 return E_UNEXPECTED;
456
457 task = heap_alloc(sizeof(*task));
458 if(!task)
459 return E_OUTOFMEMORY;
460
461 IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
462 task->window = This->window;
463
464 return push_task(&task->header, refresh_proc, refresh_destr, This->window->task_magic);
465}
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
HRESULT push_task(task_t *, task_proc_t, task_proc_t, LONG) DECLSPEC_HIDDEN
Definition: task.c:39
static void refresh_proc(task_t *_task)
Definition: olecmd.c:407
static void refresh_destr(task_t *_task)
Definition: olecmd.c:427
HTMLOuterWindow * window
Definition: olecmd.c:404
task_t header
Definition: olecmd.c:403

◆ exec_rendo()

static HRESULT exec_rendo ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 364 of file olecmd.c.

365{
366 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
367 return E_NOTIMPL;
368}

◆ exec_respectvisibility_indesign()

static HRESULT exec_respectvisibility_indesign ( HTMLDocument This,
DWORD  cmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 676 of file olecmd.c.

678{
679 TRACE("(%p)->(%x %s %p)\n", This, cmdexecopt, debugstr_variant(in), out);
680
681 /* This is turned on by default in Gecko. */
682 if(!in || V_VT(in) != VT_BOOL || !V_BOOL(in))
683 FIXME("Unsupported argument %s\n", debugstr_variant(in));
684
685 return S_OK;
686}

◆ exec_save()

static HRESULT exec_save ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 90 of file olecmd.c.

91{
92 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
93 return E_NOTIMPL;
94}

◆ exec_save_as()

static HRESULT exec_save_as ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 96 of file olecmd.c.

97{
98 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
99 return E_NOTIMPL;
100}

◆ exec_save_copy_as()

static HRESULT exec_save_copy_as ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 102 of file olecmd.c.

103{
104 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
105 return E_NOTIMPL;
106}

◆ exec_select_all()

static HRESULT exec_select_all ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT in,
VARIANT out 
)
static

Definition at line 370 of file olecmd.c.

371{
372 TRACE("(%p)\n", This);
373
374 if(in || out)
375 FIXME("unsupported args\n");
376
377 if(This->doc_obj->nscontainer)
379
381 return S_OK;
382}
#define UPDATE_UI
void update_doc(HTMLDocument *, DWORD) DECLSPEC_HIDDEN
Definition: view.c:62
#define NSCMD_SELECTALL
Definition: olecmd.c:22

◆ exec_set_print_template()

static HRESULT exec_set_print_template ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 529 of file olecmd.c.

530{
531 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
532 return E_NOTIMPL;
533}

◆ exec_show_page_setup()

static HRESULT exec_show_page_setup ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 511 of file olecmd.c.

512{
513 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
514 return E_NOTIMPL;
515}

◆ exec_show_print()

static HRESULT exec_show_print ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 517 of file olecmd.c.

518{
519 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
520 return E_NOTIMPL;
521}

◆ exec_spell()

static HRESULT exec_spell ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 320 of file olecmd.c.

321{
322 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
323 return E_NOTIMPL;
324}

◆ exec_stop()

static HRESULT exec_stop ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 467 of file olecmd.c.

468{
469 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
470 return E_NOTIMPL;
471}

◆ exec_stop_download()

static HRESULT exec_stop_download ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 473 of file olecmd.c.

474{
475 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
476 return E_NOTIMPL;
477}

◆ exec_undo()

static HRESULT exec_undo ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 358 of file olecmd.c.

359{
360 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
361 return E_NOTIMPL;
362}

◆ exec_zoom()

static HRESULT exec_zoom ( HTMLDocument This,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 390 of file olecmd.c.

391{
392 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
393 return E_NOTIMPL;
394}

◆ get_clipboard_commands()

static nsIClipboardCommands * get_clipboard_commands ( HTMLDocument doc)
static

Definition at line 47 of file olecmd.c.

48{
49 nsIClipboardCommands *clipboard_commands;
50 nsIDocShell *doc_shell;
51 nsresult nsres;
52
53 nsres = get_nsinterface((nsISupports*)doc->window->nswindow, &IID_nsIDocShell, (void**)&doc_shell);
54 if(NS_FAILED(nsres)) {
55 ERR("Could not get nsIDocShell interface\n");
56 return NULL;
57 }
58
59 nsres = nsIDocShell_QueryInterface(doc_shell, &IID_nsIClipboardCommands, (void**)&clipboard_commands);
60 nsIDocShell_Release(doc_shell);
61 if(NS_FAILED(nsres)) {
62 ERR("Could not get nsIClipboardCommands interface\n");
63 return NULL;
64 }
65
66 return clipboard_commands;
67}
HTMLOuterWindow * window
nsIDOMWindow * nswindow

Referenced by exec_mshtml_cut(), and exec_mshtml_paste().

◆ HTMLDocument_OleCmd_Init()

void HTMLDocument_OleCmd_Init ( HTMLDocument This)

Definition at line 950 of file olecmd.c.

951{
952 This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
953}
static const IOleCommandTargetVtbl OleCommandTargetVtbl
Definition: olecmd.c:921

Referenced by init_doc().

◆ impl_from_IOleCommandTarget()

static HTMLDocument * impl_from_IOleCommandTarget ( IOleCommandTarget iface)
inlinestatic

Definition at line 73 of file olecmd.c.

74{
75 return CONTAINING_RECORD(iface, HTMLDocument, IOleCommandTarget_iface);
76}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by OleCommandTarget_AddRef(), OleCommandTarget_Exec(), OleCommandTarget_QueryInterface(), OleCommandTarget_QueryStatus(), and OleCommandTarget_Release().

◆ OleCommandTarget_AddRef()

static ULONG WINAPI OleCommandTarget_AddRef ( IOleCommandTarget iface)
static

Definition at line 778 of file olecmd.c.

779{
781 return htmldoc_addref(This);
782}
static ULONG htmldoc_addref(HTMLDocument *This)
static HTMLDocument * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: olecmd.c:73

◆ OleCommandTarget_Exec()

static HRESULT WINAPI OleCommandTarget_Exec ( IOleCommandTarget iface,
const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 887 of file olecmd.c.

889{
891
892 if(!pguidCmdGroup) {
893 if(nCmdID < OLECMDID_OPEN || nCmdID >= sizeof(exec_table)/sizeof(*exec_table) || !exec_table[nCmdID].func) {
894 WARN("Unsupported cmdID = %d\n", nCmdID);
895 return OLECMDERR_E_NOTSUPPORTED;
896 }
897
898 return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut);
899 }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) {
900 FIXME("unsupported nCmdID %d of CGID_Explorer group\n", nCmdID);
901 TRACE("%p %p\n", pvaIn, pvaOut);
902 return OLECMDERR_E_NOTSUPPORTED;
903 }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) {
904 FIXME("unsupported nCmdID %d of CGID_ShellDocView group\n", nCmdID);
905 return OLECMDERR_E_NOTSUPPORTED;
906 }else if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
907 HRESULT hres = exec_from_table(This, base_cmds, nCmdID, nCmdexecopt, pvaIn, pvaOut);
908 if(hres == OLECMDERR_E_NOTSUPPORTED)
910 nCmdexecopt, pvaIn, pvaOut);
911 if(hres == OLECMDERR_E_NOTSUPPORTED)
912 FIXME("unsupported nCmdID %d of CGID_MSHTML group\n", nCmdID);
913
914 return hres;
915 }
916
917 FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
918 return OLECMDERR_E_UNKNOWNGROUP;
919}
const cmdtable_t editmode_cmds[]
Definition: editor.c:1179
GLenum func
Definition: glext.h:6028
#define debugstr_guid
Definition: kernel32.h:35
static const struct @486 exec_table[]
static const cmdtable_t base_cmds[]
Definition: olecmd.c:756
static HRESULT exec_from_table(HTMLDocument *This, const cmdtable_t *cmdtable, DWORD cmdid, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:873
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ OleCommandTarget_QueryInterface()

static HRESULT WINAPI OleCommandTarget_QueryInterface ( IOleCommandTarget iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 772 of file olecmd.c.

773{
776}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)

◆ OleCommandTarget_QueryStatus()

static HRESULT WINAPI OleCommandTarget_QueryStatus ( IOleCommandTarget iface,
const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT *  pCmdText 
)
static

Definition at line 805 of file olecmd.c.

807{
810
811 TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText);
812
813 if(pCmdText)
814 FIXME("Unsupported pCmdText\n");
815 if(!cCmds)
816 return S_OK;
817
818 if(!pguidCmdGroup) {
819 ULONG i;
820
821 for(i=0; i<cCmds; i++) {
822 if(prgCmds[i].cmdID < OLECMDID_OPEN || prgCmds[i].cmdID >= sizeof(exec_table)/sizeof(*exec_table)) {
823 WARN("Unsupported cmdID = %d\n", prgCmds[i].cmdID);
824 prgCmds[i].cmdf = 0;
825 }else {
826 if(prgCmds[i].cmdID == OLECMDID_OPEN || prgCmds[i].cmdID == OLECMDID_NEW) {
827 IOleCommandTarget *cmdtrg = NULL;
828 OLECMD olecmd;
829
830 prgCmds[i].cmdf = OLECMDF_SUPPORTED;
831 if(This->doc_obj->client) {
832 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
833 (void**)&cmdtrg);
834 if(SUCCEEDED(hres)) {
835 olecmd.cmdID = prgCmds[i].cmdID;
836 olecmd.cmdf = 0;
837
838 hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &olecmd, NULL);
839 if(SUCCEEDED(hres) && olecmd.cmdf)
840 prgCmds[i].cmdf = olecmd.cmdf;
841 }
842 }else {
843 ERR("This->client == NULL, native would crash\n");
844 }
845 }else {
846 prgCmds[i].cmdf = exec_table[prgCmds[i].cmdID].cmdf;
847 TRACE("cmdID = %d returning %x\n", prgCmds[i].cmdID, prgCmds[i].cmdf);
848 }
849 }
850 }
851
852 return (prgCmds[cCmds-1].cmdf & OLECMDF_SUPPORTED) ? S_OK : OLECMDERR_E_NOTSUPPORTED;
853 }
854
855 if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
856 ULONG i;
857
858 for(i=0; i<cCmds; i++) {
859 hres = query_from_table(This, base_cmds, prgCmds+i);
860 if(hres == OLECMDERR_E_NOTSUPPORTED)
862 if(hres == OLECMDERR_E_NOTSUPPORTED)
863 FIXME("CGID_MSHTML: unsupported cmdID %d\n", prgCmds[i].cmdID);
864 }
865
866 return (prgCmds[cCmds-1].cmdf & OLECMDF_SUPPORTED) ? S_OK : OLECMDERR_E_NOTSUPPORTED;
867 }
868
869 FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
870 return OLECMDERR_E_UNKNOWNGROUP;
871}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HRESULT query_from_table(HTMLDocument *This, const cmdtable_t *cmdtable, OLECMD *cmd)
Definition: olecmd.c:790
OLECMDF cmdf
Definition: olecmd.c:709
uint32_t ULONG
Definition: typedefs.h:59

◆ OleCommandTarget_Release()

static ULONG WINAPI OleCommandTarget_Release ( IOleCommandTarget iface)
static

Definition at line 784 of file olecmd.c.

785{
787 return htmldoc_release(This);
788}
static ULONG htmldoc_release(HTMLDocument *This)

◆ query_enabled_stub()

static HRESULT query_enabled_stub ( HTMLDocument This,
OLECMD *  cmd 
)
static

Definition at line 688 of file olecmd.c.

689{
690 switch(cmd->cmdID) {
691 case IDM_PRINT:
692 FIXME("CGID_MSHTML: IDM_PRINT\n");
693 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
694 break;
695 case IDM_BLOCKDIRLTR:
696 FIXME("CGID_MSHTML: IDM_BLOCKDIRLTR\n");
697 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
698 break;
699 case IDM_BLOCKDIRRTL:
700 FIXME("CGID_MSHTML: IDM_BLOCKDIRRTL\n");
701 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
702 break;
703 }
704
705 return S_OK;
706}
#define IDM_BLOCKDIRLTR
Definition: mshtmcid.h:343
#define IDM_BLOCKDIRRTL
Definition: mshtmcid.h:344
#define IDM_PRINT
Definition: mshtmcid.h:49

◆ query_from_table()

static HRESULT query_from_table ( HTMLDocument This,
const cmdtable_t cmdtable,
OLECMD *  cmd 
)
static

Definition at line 790 of file olecmd.c.

791{
792 const cmdtable_t *iter = cmdtable;
793
794 cmd->cmdf = 0;
795
796 while(iter->id && iter->id != cmd->cmdID)
797 iter++;
798
799 if(!iter->id || !iter->query)
800 return OLECMDERR_E_NOTSUPPORTED;
801
802 return iter->query(This, cmd);
803}
HRESULT(* query)(HTMLDocument *, OLECMD *)

Referenced by OleCommandTarget_QueryStatus().

◆ query_mshtml_copy()

static HRESULT query_mshtml_copy ( HTMLDocument This,
OLECMD *  cmd 
)
static

Definition at line 554 of file olecmd.c.

555{
556 FIXME("(%p)\n", This);
557 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
558 return S_OK;
559}

◆ query_mshtml_cut()

static HRESULT query_mshtml_cut ( HTMLDocument This,
OLECMD *  cmd 
)
static

Definition at line 572 of file olecmd.c.

573{
574 FIXME("(%p)\n", This);
575 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
576 return S_OK;
577}

◆ query_mshtml_paste()

static HRESULT query_mshtml_paste ( HTMLDocument This,
OLECMD *  cmd 
)
static

Definition at line 603 of file olecmd.c.

604{
605 FIXME("(%p)\n", This);
606 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
607 return S_OK;
608}

◆ query_selall_status()

static HRESULT query_selall_status ( HTMLDocument This,
OLECMD *  cmd 
)
static

Definition at line 634 of file olecmd.c.

635{
636 TRACE("(%p)->(%p)\n", This, cmd);
637
638 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
639 return S_OK;
640}

◆ refresh_destr()

static void refresh_destr ( task_t _task)
static

Definition at line 427 of file olecmd.c.

428{
429 refresh_task_t *task = (refresh_task_t*)_task;
430
431 IHTMLWindow2_Release(&task->window->base.IHTMLWindow2_iface);
432 heap_free(task);
433}
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
IHTMLWindow2 IHTMLWindow2_iface

Referenced by exec_refresh().

◆ refresh_proc()

static void refresh_proc ( task_t _task)
static

Definition at line 407 of file olecmd.c.

408{
409 refresh_task_t *task = (refresh_task_t*)_task;
411
412 TRACE("%p\n", window);
413
414 window->readystate = READYSTATE_UNINITIALIZED;
415
416 if(window->doc_obj && window->doc_obj->client_cmdtrg) {
417 VARIANT var;
418
419 V_VT(&var) = VT_I4;
420 V_I4(&var) = 0;
421 IOleCommandTarget_Exec(window->doc_obj->client_cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
422 }
423
425}
#define BINDING_NOFRAG
Definition: binding.h:132
HRESULT load_uri(HTMLOuterWindow *, IUri *, DWORD) DECLSPEC_HIDDEN
Definition: navigate.c:2306
#define BINDING_REFRESH
Definition: binding.h:130
const char * var
Definition: shader.c:5666
static IHTMLWindow2 * window
Definition: events.c:77

Referenced by exec_refresh().

◆ set_default_templates()

static void set_default_templates ( nsIPrintSettings settings)
static

Definition at line 199 of file olecmd.c.

200{
201 WCHAR buf[64];
202
203 static const PRUnichar empty[] = {0};
204
205 nsIPrintSettings_SetHeaderStrLeft(settings, empty);
206 nsIPrintSettings_SetHeaderStrRight(settings, empty);
207 nsIPrintSettings_SetHeaderStrCenter(settings, empty);
208 nsIPrintSettings_SetFooterStrLeft(settings, empty);
209 nsIPrintSettings_SetFooterStrRight(settings, empty);
210 nsIPrintSettings_SetFooterStrCenter(settings, empty);
211
213 sizeof(buf)/sizeof(WCHAR)))
215
216
218 sizeof(buf)/sizeof(WCHAR)))
220
221}
static const WCHAR empty[]
Definition: main.c:47
HINSTANCE get_shdoclc(void)
Definition: main.c:162
#define IDS_PRINT_HEADER_TEMPLATE
Definition: resource.h:34
#define IDS_PRINT_FOOTER_TEMPLATE
Definition: resource.h:35
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
WCHAR PRUnichar
Definition: nsiface.idl:48
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by exec_print().

◆ set_head_text()

static nsresult set_head_text ( nsIPrintSettings settings,
LPCWSTR  template,
BOOL  head,
int  pos 
)
static

Definition at line 108 of file olecmd.c.

109{
110 if(head) {
111 switch(pos) {
112 case 0:
113 return nsIPrintSettings_SetHeaderStrLeft(settings, template);
114 case 1:
115 return nsIPrintSettings_SetHeaderStrRight(settings, template);
116 case 2:
117 return nsIPrintSettings_SetHeaderStrCenter(settings, template);
118 }
119 }else {
120 switch(pos) {
121 case 0:
122 return nsIPrintSettings_SetFooterStrLeft(settings, template);
123 case 1:
124 return nsIPrintSettings_SetFooterStrRight(settings, template);
125 case 2:
126 return nsIPrintSettings_SetFooterStrCenter(settings, template);
127 }
128 }
129
130 return NS_OK;
131}
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define NS_OK

Referenced by set_print_template().

◆ set_print_template()

static void set_print_template ( nsIPrintSettings settings,
LPCWSTR  template,
BOOL  head 
)
static

Definition at line 133 of file olecmd.c.

134{
135 PRUnichar nstemplate[200]; /* FIXME: Use dynamic allocation */
136 PRUnichar *p = nstemplate;
137 LPCWSTR ptr=template;
138 int pos=0;
139
140 while(*ptr) {
141 if(*ptr != '&') {
142 *p++ = *ptr++;
143 continue;
144 }
145
146 switch(*++ptr) {
147 case '&':
148 *p++ = '&';
149 *p++ = '&';
150 ptr++;
151 break;
152 case 'b': /* change align */
153 ptr++;
154 *p = 0;
155 set_head_text(settings, nstemplate, head, pos);
156 p = nstemplate;
157 pos++;
158 break;
159 case 'd': { /* short date */
160 SYSTEMTIME systime;
161 GetLocalTime(&systime);
163 sizeof(nstemplate)-(p-nstemplate)*sizeof(WCHAR));
164 p += strlenW(p);
165 ptr++;
166 break;
167 }
168 case 'p': /* page number */
169 *p++ = '&';
170 *p++ = 'P';
171 ptr++;
172 break;
173 case 'P': /* page count */
174 *p++ = '?'; /* FIXME */
175 ptr++;
176 break;
177 case 'u':
178 *p++ = '&';
179 *p++ = 'U';
180 ptr++;
181 break;
182 case 'w':
183 /* FIXME: set window title */
184 ptr++;
185 break;
186 default:
187 *p++ = '&';
188 *p++ = *ptr++;
189 }
190 }
191
192 *p = 0;
193 set_head_text(settings, nstemplate, head, pos);
194
195 while(++pos < 3)
197}
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
GLfloat GLfloat p
Definition: glext.h:8902
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
static PVOID ptr
Definition: dispmode.c:27
#define LOCALE_SYSTEM_DEFAULT
static nsresult set_head_text(nsIPrintSettings *settings, LPCWSTR template, BOOL head, int pos)
Definition: olecmd.c:108
#define strlenW(s)
Definition: unicode.h:28
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by exec_print(), and set_default_templates().

◆ show_context_menu()

void show_context_menu ( HTMLDocumentObj This,
DWORD  dwID,
POINT ppt,
IDispatch elem 
)

Definition at line 929 of file olecmd.c.

930{
931 HMENU menu_res, menu;
932 DWORD cmdid;
933
934 if(This->hostui && S_OK == IDocHostUIHandler_ShowContextMenu(This->hostui,
935 dwID, ppt, (IUnknown*)&This->basedoc.IOleCommandTarget_iface, elem))
936 return;
937
939 menu = GetSubMenu(menu_res, dwID);
940
942 ppt->x, ppt->y, 0, This->hwnd, NULL);
943 DestroyMenu(menu_res);
944
945 if(cmdid)
946 IOleCommandTarget_Exec(&This->basedoc.IOleCommandTarget_iface, &CGID_MSHTML, cmdid, 0,
947 NULL, NULL);
948}
#define IDR_BROWSE_CONTEXT_MENU
Definition: resource.h:37
static size_t elem
Definition: string.c:68
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TPM_RIGHTBUTTON
Definition: winuser.h:2370
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define TPM_LEFTALIGN
Definition: winuser.h:2367
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define TPM_RETURNCMD
Definition: winuser.h:2377

Referenced by nsContextMenuListener_OnShowContextMenu().

Variable Documentation

◆ base_cmds

const cmdtable_t base_cmds[]
static
Initial value:
= {
{0,NULL,NULL}
}
#define IDM_BROWSEMODE
Definition: mshtmcid.h:150
#define IDM_HTMLEDITMODE
Definition: mshtmcid.h:306
#define IDM_PASTE
Definition: mshtmcid.h:48
#define IDM_EDITMODE
Definition: mshtmcid.h:151
#define IDM_BASELINEFONT3
Definition: mshtmcid.h:167
#define IDM_RESPECTVISIBILITY_INDESIGN
Definition: mshtmcid.h:379
#define IDM_SELECTALL
Definition: mshtmcid.h:53
static HRESULT exec_htmleditmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:664
static HRESULT exec_mshtml_cut(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:579
static HRESULT exec_mshtml_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:610
static HRESULT exec_select_all(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:370
static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:654
static HRESULT exec_baselinefont3(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:670
static HRESULT exec_print(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: olecmd.c:223
static HRESULT query_enabled_stub(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:688
static HRESULT query_mshtml_copy(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:554
static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:572
static HRESULT exec_browsemode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:642
static HRESULT exec_respectvisibility_indesign(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:676
static HRESULT query_selall_status(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:634
static HRESULT query_mshtml_paste(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:603
static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:561
#define IDM_COPY
Definition: shresdef.h:838
#define IDM_CUT
Definition: shresdef.h:837

Definition at line 756 of file olecmd.c.

Referenced by OleCommandTarget_Exec(), and OleCommandTarget_QueryStatus().

◆ cmdf

◆ 

const struct { ... } exec_table[]

◆ func

HRESULT(* func) (HTMLDocument *, DWORD, VARIANT *, VARIANT *) ( HTMLDocument ,
DWORD  ,
VARIANT ,
VARIANT  
)

Definition at line 710 of file olecmd.c.

◆ OleCommandTargetVtbl

const IOleCommandTargetVtbl OleCommandTargetVtbl
static
Initial value:
= {
}
static ULONG WINAPI OleCommandTarget_AddRef(IOleCommandTarget *iface)
Definition: olecmd.c:778
static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
Definition: olecmd.c:805
static HRESULT WINAPI OleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv)
Definition: olecmd.c:772
static ULONG WINAPI OleCommandTarget_Release(IOleCommandTarget *iface)
Definition: olecmd.c:784
static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: olecmd.c:887

Definition at line 921 of file olecmd.c.

Referenced by HTMLDocument_OleCmd_Init().