ReactOS 0.4.15-dev-8428-g6910fa6
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: precomp.h:57
#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 677 of file olecmd.c.

678{
679 FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
680 return S_OK;
681}
#define FIXME(fmt,...)
Definition: precomp.h:53
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 649 of file olecmd.c.

650{
651 WARN("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
652
653 if(in || out)
654 FIXME("unsupported args\n");
655
656 This->doc_obj->usermode = BROWSEMODE;
657
658 return S_OK;
659}
#define WARN(fmt,...)
Definition: precomp.h:61
@ BROWSEMODE

◆ exec_clear_selection()

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

Definition at line 391 of file olecmd.c.

392{
393 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
394 return E_NOTIMPL;
395}
#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 530 of file olecmd.c.

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

◆ exec_copy()

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

Definition at line 345 of file olecmd.c.

346{
347 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
348
350 return S_OK;
351}
#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 339 of file olecmd.c.

340{
341 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
342 return E_NOTIMPL;
343}

◆ exec_delete()

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

Definition at line 492 of file olecmd.c.

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

◆ exec_editmode()

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

Definition at line 661 of file olecmd.c.

662{
663 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
664
665 if(in || out)
666 FIXME("unsupported args\n");
667
668 return setup_edit_mode(This->doc_obj);
669}
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 498 of file olecmd.c.

499{
500 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
501 return E_NOTIMPL;
502}

◆ exec_find()

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

Definition at line 486 of file olecmd.c.

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

◆ 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 880 of file olecmd.c.

882{
883 const cmdtable_t *iter = cmdtable;
884
885 while(iter->id && iter->id != cmdid)
886 iter++;
887
888 if(!iter->id || !iter->exec)
889 return OLECMDERR_E_NOTSUPPORTED;
890
891 return iter->exec(This, cmdexecopt, in, out);
892}
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 542 of file olecmd.c.

543{
544 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
545 return E_NOTIMPL;
546}

◆ exec_get_zoom_range()

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

Definition at line 403 of file olecmd.c.

404{
405 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
406 return E_NOTIMPL;
407}

◆ exec_htmleditmode()

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

Definition at line 671 of file olecmd.c.

672{
673 FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
674 return S_OK;
675}

◆ exec_mshtml_copy()

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

Definition at line 568 of file olecmd.c.

569{
570 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
571
572 if(This->doc_obj->usermode == EDITMODE)
573 return editor_exec_copy(This, cmdexecopt, in, out);
574
576 return S_OK;
577}
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 586 of file olecmd.c.

587{
588 nsIClipboardCommands *clipboard_commands;
589 nsresult nsres;
590
591 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
592
593 if(This->doc_obj->usermode == EDITMODE)
594 return editor_exec_cut(This, cmdexecopt, in, out);
595
596 clipboard_commands = get_clipboard_commands(This);
597 if(!clipboard_commands)
598 return E_UNEXPECTED;
599
600 nsres = nsIClipboardCommands_CutSelection(clipboard_commands);
601 nsIClipboardCommands_Release(clipboard_commands);
602 if(NS_FAILED(nsres)) {
603 ERR("Paste failed: %08x\n", nsres);
604 return E_FAIL;
605 }
606
607 return S_OK;
608}
#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 617 of file olecmd.c.

618{
619 nsIClipboardCommands *clipboard_commands;
620 nsresult nsres;
621
622 TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
623
624 if(This->doc_obj->usermode == EDITMODE)
625 return editor_exec_paste(This, cmdexecopt, in, out);
626
627 clipboard_commands = get_clipboard_commands(This);
628 if(!clipboard_commands)
629 return E_UNEXPECTED;
630
631 nsres = nsIClipboardCommands_Paste(clipboard_commands);
632 nsIClipboardCommands_Release(clipboard_commands);
633 if(NS_FAILED(nsres)) {
634 ERR("Paste failed: %08x\n", nsres);
635 return E_FAIL;
636 }
637
638 return S_OK;
639}
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 504 of file olecmd.c.

505{
506 TRACE("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
507
508 /* Tests show that we have nothing more to do here */
509
510 if(pvaOut) {
511 V_VT(pvaOut) = VT_BOOL;
512 V_BOOL(pvaOut) = VARIANT_TRUE;
513 }
514
515 return S_OK;
516}
@ 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 548 of file olecmd.c.

549{
550 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
551
552 if(!pvaIn || V_VT(pvaIn) != VT_I4) {
553 FIXME("Unsupported argument %s\n", debugstr_variant(pvaIn));
554 return E_NOTIMPL;
555 }
556
557 set_viewer_zoom(This->doc_obj->nscontainer, (float)V_I4(pvaIn)/100);
558 return S_OK;
559}
@ 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 321 of file olecmd.c.

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

◆ exec_paste()

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

Definition at line 353 of file olecmd.c.

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

◆ exec_paste_special()

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

Definition at line 359 of file olecmd.c.

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

◆ 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#ifdef __REACTOS__
245 // returning here fixes CORE-16884. Maybe use this until printing works.
246 ERR("Aborting print, to work around CORE-16884\n");
247 nsIWebBrowserPrint_Release(nsprint);
248 return S_OK;
249#endif
250
251 nsres = nsIWebBrowserPrint_GetGlobalPrintSettings(nsprint, &settings);
252 if(NS_FAILED(nsres))
253 ERR("GetCurrentPrintSettings failed: %08x\n", nsres);
254
256
257 if(pvaIn) {
258 switch(V_VT(pvaIn)) {
259 case VT_BYREF|VT_ARRAY: {
260 VARIANT *opts;
261 DWORD opts_cnt;
262
263 if(V_ARRAY(pvaIn)->cDims != 1)
264 WARN("cDims = %d\n", V_ARRAY(pvaIn)->cDims);
265
266 SafeArrayAccessData(V_ARRAY(pvaIn), (void**)&opts);
267 opts_cnt = V_ARRAY(pvaIn)->rgsabound[0].cElements;
268
269 if(opts_cnt >= 1) {
270 switch(V_VT(opts)) {
271 case VT_BSTR:
272 TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts)));
274 break;
275 case VT_NULL:
276 break;
277 default:
278 WARN("opts = %s\n", debugstr_variant(opts));
279 }
280 }
281
282 if(opts_cnt >= 2) {
283 switch(V_VT(opts+1)) {
284 case VT_BSTR:
285 TRACE("setting footer %s\n", debugstr_w(V_BSTR(opts+1)));
287 break;
288 case VT_NULL:
289 break;
290 default:
291 WARN("opts[1] = %s\n", debugstr_variant(opts+1));
292 }
293 }
294
295 if(opts_cnt >= 3)
296 FIXME("Unsupported opts_cnt %d\n", opts_cnt);
297
299 break;
300 }
301 default:
302 FIXME("unsupported arg %s\n", debugstr_variant(pvaIn));
303 }
304 }
305
306 nsres = nsIWebBrowserPrint_Print(nsprint, settings, NULL);
307 if(NS_FAILED(nsres))
308 ERR("Print failed: %08x\n", nsres);
309
310 nsIWebBrowserPrint_Release(nsprint);
311
312 return S_OK;
313}
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 315 of file olecmd.c.

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

◆ exec_properties()

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

Definition at line 333 of file olecmd.c.

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

◆ exec_refresh()

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

Definition at line 442 of file olecmd.c.

443{
444 refresh_task_t *task;
446
447 TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
448
449 if(This->doc_obj->client) {
450 IOleCommandTarget *olecmd;
451
452 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
453 if(SUCCEEDED(hres)) {
454 hres = IOleCommandTarget_Exec(olecmd, &CGID_DocHostCommandHandler, 2300, nCmdexecopt, pvaIn, pvaOut);
455 IOleCommandTarget_Release(olecmd);
456 if(SUCCEEDED(hres))
457 return S_OK;
458 }
459 }
460
461 if(!This->window)
462 return E_UNEXPECTED;
463
464 task = heap_alloc(sizeof(*task));
465 if(!task)
466 return E_OUTOFMEMORY;
467
468 IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
469 task->window = This->window;
470
471 return push_task(&task->header, refresh_proc, refresh_destr, This->window->task_magic);
472}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#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:414
static void refresh_destr(task_t *_task)
Definition: olecmd.c:434
HTMLOuterWindow * window
Definition: olecmd.c:411
task_t header
Definition: olecmd.c:410

◆ exec_rendo()

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

Definition at line 371 of file olecmd.c.

372{
373 FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
374 return E_NOTIMPL;
375}

◆ exec_respectvisibility_indesign()

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

Definition at line 683 of file olecmd.c.

685{
686 TRACE("(%p)->(%x %s %p)\n", This, cmdexecopt, debugstr_variant(in), out);
687
688 /* This is turned on by default in Gecko. */
689 if(!in || V_VT(in) != VT_BOOL || !V_BOOL(in))
690 FIXME("Unsupported argument %s\n", debugstr_variant(in));
691
692 return S_OK;
693}

◆ 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 377 of file olecmd.c.

378{
379 TRACE("(%p)\n", This);
380
381 if(in || out)
382 FIXME("unsupported args\n");
383
384 if(This->doc_obj->nscontainer)
386
388 return S_OK;
389}
#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 536 of file olecmd.c.

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

◆ exec_show_page_setup()

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

Definition at line 518 of file olecmd.c.

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

◆ exec_show_print()

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

Definition at line 524 of file olecmd.c.

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

◆ exec_spell()

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

Definition at line 327 of file olecmd.c.

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

◆ exec_stop()

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

Definition at line 474 of file olecmd.c.

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

◆ exec_stop_download()

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

Definition at line 480 of file olecmd.c.

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

◆ exec_undo()

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

Definition at line 365 of file olecmd.c.

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

◆ exec_zoom()

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

Definition at line 397 of file olecmd.c.

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

◆ 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 957 of file olecmd.c.

958{
959 This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
960}
static const IOleCommandTargetVtbl OleCommandTargetVtbl
Definition: olecmd.c:928

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 785 of file olecmd.c.

786{
788 return htmldoc_addref(This);
789}
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 894 of file olecmd.c.

896{
898
899 if(!pguidCmdGroup) {
900 if(nCmdID < OLECMDID_OPEN || nCmdID >= sizeof(exec_table)/sizeof(*exec_table) || !exec_table[nCmdID].func) {
901 WARN("Unsupported cmdID = %d\n", nCmdID);
902 return OLECMDERR_E_NOTSUPPORTED;
903 }
904
905 return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut);
906 }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) {
907 FIXME("unsupported nCmdID %d of CGID_Explorer group\n", nCmdID);
908 TRACE("%p %p\n", pvaIn, pvaOut);
909 return OLECMDERR_E_NOTSUPPORTED;
910 }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) {
911 FIXME("unsupported nCmdID %d of CGID_ShellDocView group\n", nCmdID);
912 return OLECMDERR_E_NOTSUPPORTED;
913 }else if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
914 HRESULT hres = exec_from_table(This, base_cmds, nCmdID, nCmdexecopt, pvaIn, pvaOut);
915 if(hres == OLECMDERR_E_NOTSUPPORTED)
917 nCmdexecopt, pvaIn, pvaOut);
918 if(hres == OLECMDERR_E_NOTSUPPORTED)
919 FIXME("unsupported nCmdID %d of CGID_MSHTML group\n", nCmdID);
920
921 return hres;
922 }
923
924 FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
925 return OLECMDERR_E_UNKNOWNGROUP;
926}
const cmdtable_t editmode_cmds[]
Definition: editor.c:1179
GLenum func
Definition: glext.h:6028
#define debugstr_guid
Definition: kernel32.h:35
static const cmdtable_t base_cmds[]
Definition: olecmd.c:763
static const struct @495 exec_table[]
static HRESULT exec_from_table(HTMLDocument *This, const cmdtable_t *cmdtable, DWORD cmdid, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:880
#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 779 of file olecmd.c.

780{
783}
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 812 of file olecmd.c.

814{
817
818 TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText);
819
820 if(pCmdText)
821 FIXME("Unsupported pCmdText\n");
822 if(!cCmds)
823 return S_OK;
824
825 if(!pguidCmdGroup) {
826 ULONG i;
827
828 for(i=0; i<cCmds; i++) {
829 if(prgCmds[i].cmdID < OLECMDID_OPEN || prgCmds[i].cmdID >= sizeof(exec_table)/sizeof(*exec_table)) {
830 WARN("Unsupported cmdID = %d\n", prgCmds[i].cmdID);
831 prgCmds[i].cmdf = 0;
832 }else {
833 if(prgCmds[i].cmdID == OLECMDID_OPEN || prgCmds[i].cmdID == OLECMDID_NEW) {
834 IOleCommandTarget *cmdtrg = NULL;
835 OLECMD olecmd;
836
837 prgCmds[i].cmdf = OLECMDF_SUPPORTED;
838 if(This->doc_obj->client) {
839 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
840 (void**)&cmdtrg);
841 if(SUCCEEDED(hres)) {
842 olecmd.cmdID = prgCmds[i].cmdID;
843 olecmd.cmdf = 0;
844
845 hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &olecmd, NULL);
846 if(SUCCEEDED(hres) && olecmd.cmdf)
847 prgCmds[i].cmdf = olecmd.cmdf;
848 }
849 }else {
850 ERR("This->client == NULL, native would crash\n");
851 }
852 }else {
853 prgCmds[i].cmdf = exec_table[prgCmds[i].cmdID].cmdf;
854 TRACE("cmdID = %d returning %x\n", prgCmds[i].cmdID, prgCmds[i].cmdf);
855 }
856 }
857 }
858
859 return (prgCmds[cCmds-1].cmdf & OLECMDF_SUPPORTED) ? S_OK : OLECMDERR_E_NOTSUPPORTED;
860 }
861
862 if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
863 ULONG i;
864
865 for(i=0; i<cCmds; i++) {
866 hres = query_from_table(This, base_cmds, prgCmds+i);
867 if(hres == OLECMDERR_E_NOTSUPPORTED)
869 if(hres == OLECMDERR_E_NOTSUPPORTED)
870 FIXME("CGID_MSHTML: unsupported cmdID %d\n", prgCmds[i].cmdID);
871 }
872
873 return (prgCmds[cCmds-1].cmdf & OLECMDF_SUPPORTED) ? S_OK : OLECMDERR_E_NOTSUPPORTED;
874 }
875
876 FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
877 return OLECMDERR_E_UNKNOWNGROUP;
878}
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:797
OLECMDF cmdf
Definition: olecmd.c:716
uint32_t ULONG
Definition: typedefs.h:59

◆ OleCommandTarget_Release()

static ULONG WINAPI OleCommandTarget_Release ( IOleCommandTarget iface)
static

Definition at line 791 of file olecmd.c.

792{
794 return htmldoc_release(This);
795}
static ULONG htmldoc_release(HTMLDocument *This)

◆ query_enabled_stub()

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

Definition at line 695 of file olecmd.c.

696{
697 switch(cmd->cmdID) {
698 case IDM_PRINT:
699 FIXME("CGID_MSHTML: IDM_PRINT\n");
700 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
701 break;
702 case IDM_BLOCKDIRLTR:
703 FIXME("CGID_MSHTML: IDM_BLOCKDIRLTR\n");
704 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
705 break;
706 case IDM_BLOCKDIRRTL:
707 FIXME("CGID_MSHTML: IDM_BLOCKDIRRTL\n");
708 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
709 break;
710 }
711
712 return S_OK;
713}
#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 797 of file olecmd.c.

798{
799 const cmdtable_t *iter = cmdtable;
800
801 cmd->cmdf = 0;
802
803 while(iter->id && iter->id != cmd->cmdID)
804 iter++;
805
806 if(!iter->id || !iter->query)
807 return OLECMDERR_E_NOTSUPPORTED;
808
809 return iter->query(This, cmd);
810}
HRESULT(* query)(HTMLDocument *, OLECMD *)

Referenced by OleCommandTarget_QueryStatus().

◆ query_mshtml_copy()

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

Definition at line 561 of file olecmd.c.

562{
563 FIXME("(%p)\n", This);
564 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
565 return S_OK;
566}

◆ query_mshtml_cut()

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

Definition at line 579 of file olecmd.c.

580{
581 FIXME("(%p)\n", This);
582 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
583 return S_OK;
584}

◆ query_mshtml_paste()

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

Definition at line 610 of file olecmd.c.

611{
612 FIXME("(%p)\n", This);
613 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
614 return S_OK;
615}

◆ query_selall_status()

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

Definition at line 641 of file olecmd.c.

642{
643 TRACE("(%p)->(%p)\n", This, cmd);
644
645 cmd->cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
646 return S_OK;
647}

◆ refresh_destr()

static void refresh_destr ( task_t _task)
static

Definition at line 434 of file olecmd.c.

435{
436 refresh_task_t *task = (refresh_task_t*)_task;
437
438 IHTMLWindow2_Release(&task->window->base.IHTMLWindow2_iface);
439 heap_free(task);
440}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
IHTMLWindow2 IHTMLWindow2_iface

Referenced by exec_refresh().

◆ refresh_proc()

static void refresh_proc ( task_t _task)
static

Definition at line 414 of file olecmd.c.

415{
416 refresh_task_t *task = (refresh_task_t*)_task;
418
419 TRACE("%p\n", window);
420
421 window->readystate = READYSTATE_UNINITIALIZED;
422
423 if(window->doc_obj && window->doc_obj->client_cmdtrg) {
424 VARIANT var;
425
426 V_VT(&var) = VT_I4;
427 V_I4(&var) = 0;
428 IOleCommandTarget_Exec(window->doc_obj->client_cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
429 }
430
432}
#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:993
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:34
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 936 of file olecmd.c.

937{
938 HMENU menu_res, menu;
939 DWORD cmdid;
940
941 if(This->hostui && S_OK == IDocHostUIHandler_ShowContextMenu(This->hostui,
942 dwID, ppt, (IUnknown*)&This->basedoc.IOleCommandTarget_iface, elem))
943 return;
944
946 menu = GetSubMenu(menu_res, dwID);
947
949 ppt->x, ppt->y, 0, This->hwnd, NULL);
950 DestroyMenu(menu_res);
951
952 if(cmdid)
953 IOleCommandTarget_Exec(&This->basedoc.IOleCommandTarget_iface, &CGID_MSHTML, cmdid, 0,
954 NULL, NULL);
955}
#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:63
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TPM_RIGHTBUTTON
Definition: winuser.h:2380
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define TPM_LEFTALIGN
Definition: winuser.h:2377
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:2387

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:671
static HRESULT exec_mshtml_cut(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:586
static HRESULT exec_mshtml_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:617
static HRESULT exec_select_all(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:377
static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:661
static HRESULT exec_baselinefont3(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:677
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:695
static HRESULT query_mshtml_copy(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:561
static HRESULT query_mshtml_cut(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:579
static HRESULT exec_browsemode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:649
static HRESULT exec_respectvisibility_indesign(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:683
static HRESULT query_selall_status(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:641
static HRESULT query_mshtml_paste(HTMLDocument *This, OLECMD *cmd)
Definition: olecmd.c:610
static HRESULT exec_mshtml_copy(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
Definition: olecmd.c:568
#define IDM_COPY
Definition: shresdef.h:868
#define IDM_CUT
Definition: shresdef.h:867

Definition at line 763 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 717 of file olecmd.c.

◆ OleCommandTargetVtbl

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

Definition at line 928 of file olecmd.c.

Referenced by HTMLDocument_OleCmd_Init().