winex11.drv: Map coordinates before calling send_mouse_input.
[wine/zf.git] / dlls / dhtmled.ocx / edit.c
blobfc518de7323de9897d35b0f4dbee3aa34a5777b1
1 /*
2 * Copyright 2017 Alex Henrie
3 * Copyright 2021 Vijay Kiran Kamuju
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #define COBJMACROS
22 #include "dhtmled.h"
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dhtmled);
28 typedef struct
30 IDHTMLEdit IDHTMLEdit_iface;
31 IOleObject IOleObject_iface;
32 IPersistStreamInit IPersistStreamInit_iface;
33 IOleControl IOleControl_iface;
34 IOleClientSite *client_site;
35 SIZEL extent;
36 LONG ref;
37 } DHTMLEditImpl;
39 static inline DHTMLEditImpl *impl_from_IDHTMLEdit(IDHTMLEdit *iface)
41 return CONTAINING_RECORD(iface, DHTMLEditImpl, IDHTMLEdit_iface);
44 static inline DHTMLEditImpl *impl_from_IOleObject(IOleObject *iface)
46 return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleObject_iface);
49 static inline DHTMLEditImpl *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
51 return CONTAINING_RECORD(iface, DHTMLEditImpl, IPersistStreamInit_iface);
54 static inline DHTMLEditImpl *impl_from_IOleControl(IOleControl *iface)
56 return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleControl_iface);
59 static ULONG dhtml_edit_addref(DHTMLEditImpl *This)
61 LONG ref = InterlockedIncrement(&This->ref);
63 TRACE("(%p) ref=%d\n", This, ref);
65 return ref;
68 static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
70 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), out);
72 if (IsEqualGUID(iid, &IID_IUnknown) ||
73 IsEqualGUID(iid, &IID_IDispatch) ||
74 IsEqualGUID(iid, &IID_IDHTMLEdit))
76 dhtml_edit_addref(This);
77 *out = &This->IDHTMLEdit_iface;
78 return S_OK;
80 else if (IsEqualGUID(iid, &IID_IOleObject))
82 dhtml_edit_addref(This);
83 *out = &This->IOleObject_iface;
84 return S_OK;
86 else if (IsEqualGUID(iid, &IID_IPersistStreamInit))
88 dhtml_edit_addref(This);
89 *out = &This->IPersistStreamInit_iface;
90 return S_OK;
92 else if(IsEqualGUID(iid, &IID_IOleControl))
94 dhtml_edit_addref(This);
95 *out = &This->IOleControl_iface;
96 return S_OK;
99 *out = NULL;
100 ERR("no interface for %s\n", debugstr_guid(iid));
101 return E_NOINTERFACE;
104 static ULONG dhtml_edit_release(DHTMLEditImpl *This)
106 LONG ref = InterlockedDecrement(&This->ref);
108 TRACE("(%p) ref=%d\n", This, ref);
110 if (!ref)
112 if (This->client_site)
113 IOleClientSite_Release(This->client_site);
115 HeapFree(GetProcessHeap(), 0, This);
118 return ref;
121 static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, void **out)
123 return dhtml_edit_qi(impl_from_IDHTMLEdit(iface), iid, out);
126 static ULONG WINAPI DHTMLEdit_AddRef(IDHTMLEdit *iface)
128 return dhtml_edit_addref(impl_from_IDHTMLEdit(iface));
131 static ULONG WINAPI DHTMLEdit_Release(IDHTMLEdit *iface)
133 return dhtml_edit_release(impl_from_IDHTMLEdit(iface));
136 static HRESULT WINAPI DHTMLEdit_GetTypeInfoCount(IDHTMLEdit *iface, UINT *count)
138 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
139 FIXME("(%p)->(%p) stub\n", This, count);
140 *count = 0;
141 return E_NOTIMPL;
144 static HRESULT WINAPI DHTMLEdit_GetTypeInfo(IDHTMLEdit *iface, UINT type_index, LCID lcid, ITypeInfo **type_info)
146 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
147 FIXME("(%p)->(%u, %08x, %p) stub\n", This, type_index, lcid, type_info);
148 return E_NOTIMPL;
151 static HRESULT WINAPI DHTMLEdit_GetIDsOfNames(IDHTMLEdit *iface, REFIID iid, OLECHAR **names, UINT name_count,
152 LCID lcid, DISPID *disp_ids)
154 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
155 FIXME("(%p)->(%s, %p, %u, %08x, %p) stub\n", This, debugstr_guid(iid), names, name_count, lcid, disp_ids);
156 return E_NOTIMPL;
159 static HRESULT WINAPI DHTMLEdit_Invoke(IDHTMLEdit *iface, DISPID member, REFIID iid, LCID lcid, WORD flags,
160 DISPPARAMS *params, VARIANT *ret, EXCEPINFO *exception_info, UINT *error_index)
162 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
163 FIXME("(%p)->(%d, %s, %08x, 0x%x, %p, %p, %p, %p) stub\n",
164 This, member, debugstr_guid(iid), lcid, flags, params, ret, exception_info, error_index);
165 return E_NOTIMPL;
168 static HRESULT WINAPI DHTMLEdit_ExecCommand(IDHTMLEdit *iface, DHTMLEDITCMDID cmd_id, OLECMDEXECOPT options,
169 VARIANT *code_in, VARIANT *code_out)
171 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
172 FIXME("(%p)->(%u, %u, %s, %p) stub\n", This, cmd_id, options, debugstr_variant(code_in), code_out);
173 return E_NOTIMPL;
176 static HRESULT WINAPI DHTMLEdit_QueryStatus(IDHTMLEdit *iface, DHTMLEDITCMDID cmd_id, DHTMLEDITCMDF *status)
178 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
179 FIXME("(%p)->(%u, %p) stub\n", This, cmd_id, status);
180 return E_NOTIMPL;
183 static HRESULT WINAPI DHTMLEdit_SetContextMenu(IDHTMLEdit *iface, VARIANT *strings, VARIANT *states)
185 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
186 FIXME("(%p)->(%p, %p) stub\n", This, strings, states);
187 return E_NOTIMPL;
190 static HRESULT WINAPI DHTMLEdit_NewDocument(IDHTMLEdit *iface)
192 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
193 FIXME("(%p)->() stub\n", This);
194 return S_OK;
197 static HRESULT WINAPI DHTMLEdit_LoadURL(IDHTMLEdit *iface, BSTR url)
199 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
200 FIXME("(%p)->(%s)\n", This, debugstr_w(url));
201 return E_NOTIMPL;
204 static HRESULT WINAPI DHTMLEdit_FilterSourceCode(IDHTMLEdit *iface, BSTR in, BSTR *out)
206 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
207 FIXME("(%p)->(%s, %p)\n", This, debugstr_w(in), out);
208 return E_NOTIMPL;
211 static HRESULT WINAPI DHTMLEdit_Refresh(IDHTMLEdit *iface)
213 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
214 FIXME("(%p)->() stub\n", This);
215 return E_NOTIMPL;
218 static HRESULT WINAPI DHTMLEdit_get_DOM(IDHTMLEdit *iface, IHTMLDocument2 **value)
220 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
221 FIXME("(%p)->(%p) stub\n", This, value);
222 return E_NOTIMPL;
225 static HRESULT WINAPI DHTMLEdit_get_DocumentHTML(IDHTMLEdit *iface, BSTR *value)
227 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
228 FIXME("(%p)->(%p) stub\n", This, value);
229 return E_NOTIMPL;
232 static HRESULT WINAPI DHTMLEdit_put_DocumentHTML(IDHTMLEdit *iface, BSTR html)
234 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
235 FIXME("(%p)->(%s) stub\n", This, debugstr_w(html));
236 return E_NOTIMPL;
239 static HRESULT WINAPI DHTMLEdit_get_ActivateApplets(IDHTMLEdit *iface, VARIANT_BOOL *value)
241 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
242 FIXME("(%p)->(%p) stub\n", This, value);
243 return E_NOTIMPL;
246 static HRESULT WINAPI DHTMLEdit_put_ActivateApplets(IDHTMLEdit *iface, VARIANT_BOOL value)
248 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
249 FIXME("(%p)->(%04x) stub\n", This, value);
250 return E_NOTIMPL;
253 static HRESULT WINAPI DHTMLEdit_get_ActivateActiveXControls(IDHTMLEdit *iface, VARIANT_BOOL *value)
255 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
256 FIXME("(%p)->(%p) stub\n", This, value);
257 return E_NOTIMPL;
260 static HRESULT WINAPI DHTMLEdit_put_ActivateActiveXControls(IDHTMLEdit *iface, VARIANT_BOOL value)
262 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
263 FIXME("(%p)->(%04x) stub\n", This, value);
264 return E_NOTIMPL;
267 static HRESULT WINAPI DHTMLEdit_get_ActivateDTCs(IDHTMLEdit *iface, VARIANT_BOOL *value)
269 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
270 FIXME("(%p)->(%p) stub\n", This, value);
271 return E_NOTIMPL;
274 static HRESULT WINAPI DHTMLEdit_put_ActivateDTCs(IDHTMLEdit *iface, VARIANT_BOOL value)
276 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
277 FIXME("(%p)->(%04x) stub\n", This, value);
278 return E_NOTIMPL;
281 static HRESULT WINAPI DHTMLEdit_get_ShowDetails(IDHTMLEdit *iface, VARIANT_BOOL *value)
283 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
284 FIXME("(%p)->(%p) stub\n", This, value);
285 return E_NOTIMPL;
288 static HRESULT WINAPI DHTMLEdit_put_ShowDetails(IDHTMLEdit *iface, VARIANT_BOOL value)
290 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
291 FIXME("(%p)->(%04x) stub\n", This, value);
292 return E_NOTIMPL;
295 static HRESULT WINAPI DHTMLEdit_get_ShowBorders(IDHTMLEdit *iface, VARIANT_BOOL *value)
297 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
298 FIXME("(%p)->(%p) stub\n", This, value);
299 return E_NOTIMPL;
302 static HRESULT WINAPI DHTMLEdit_put_ShowBorders(IDHTMLEdit *iface, VARIANT_BOOL value)
304 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
305 FIXME("(%p)->(%04x) stub\n", This, value);
306 return E_NOTIMPL;
309 static HRESULT WINAPI DHTMLEdit_get_Appearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE *value)
311 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
312 FIXME("(%p)->(%p) stub\n", This, value);
313 return E_NOTIMPL;
316 static HRESULT WINAPI DHTMLEdit_put_Appearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE value)
318 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
319 FIXME("(%p)->(%u) stub\n", This, value);
320 return E_NOTIMPL;
323 static HRESULT WINAPI DHTMLEdit_get_Scrollbars(IDHTMLEdit *iface, VARIANT_BOOL *value)
325 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
326 FIXME("(%p)->(%p) stub\n", This, value);
327 return E_NOTIMPL;
330 static HRESULT WINAPI DHTMLEdit_put_Scrollbars(IDHTMLEdit *iface, VARIANT_BOOL value)
332 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
333 FIXME("(%p)->(%04x) stub\n", This, value);
334 return E_NOTIMPL;
337 static HRESULT WINAPI DHTMLEdit_get_ScrollbarAppearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE *value)
339 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
340 FIXME("(%p)->(%p) stub\n", This, value);
341 return E_NOTIMPL;
344 static HRESULT WINAPI DHTMLEdit_put_ScrollbarAppearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE value)
346 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
347 FIXME("(%p)->(%u) stub\n", This, value);
348 return E_NOTIMPL;
351 static HRESULT WINAPI DHTMLEdit_get_SourceCodePreservation(IDHTMLEdit *iface, VARIANT_BOOL *value)
353 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
354 FIXME("(%p)->(%p) stub\n", This, value);
355 return E_NOTIMPL;
358 static HRESULT WINAPI DHTMLEdit_put_SourceCodePreservation(IDHTMLEdit *iface, VARIANT_BOOL value)
360 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
361 FIXME("(%p)->(%04x) stub\n", This, value);
362 return E_NOTIMPL;
365 static HRESULT WINAPI DHTMLEdit_get_AbsoluteDropMode(IDHTMLEdit *iface, VARIANT_BOOL *value)
367 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
368 FIXME("(%p)->(%p) stub\n", This, value);
369 return E_NOTIMPL;
372 static HRESULT WINAPI DHTMLEdit_put_AbsoluteDropMode(IDHTMLEdit *iface, VARIANT_BOOL value)
374 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
375 FIXME("(%p)->(%04x) stub\n", This, value);
376 return E_NOTIMPL;
379 static HRESULT WINAPI DHTMLEdit_get_SnapToGridX(IDHTMLEdit *iface, LONG *value)
381 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
382 FIXME("(%p)->(%p) stub\n", This, value);
383 return E_NOTIMPL;
386 static HRESULT WINAPI DHTMLEdit_put_SnapToGridX(IDHTMLEdit *iface, LONG value)
388 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
389 FIXME("(%p)->(%d) stub\n", This, value);
390 return E_NOTIMPL;
393 static HRESULT WINAPI DHTMLEdit_get_SnapToGridY(IDHTMLEdit *iface, LONG *value)
395 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
396 FIXME("(%p)->(%p) stub\n", This, value);
397 return E_NOTIMPL;
400 static HRESULT WINAPI DHTMLEdit_put_SnapToGridY(IDHTMLEdit *iface, LONG value)
402 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
403 FIXME("(%p)->(%d) stub\n", This, value);
404 return E_NOTIMPL;
407 static HRESULT WINAPI DHTMLEdit_get_SnapToGrid(IDHTMLEdit *iface, VARIANT_BOOL *value)
409 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
410 FIXME("(%p)->(%p) stub\n", This, value);
411 return E_NOTIMPL;
414 static HRESULT WINAPI DHTMLEdit_put_SnapToGrid(IDHTMLEdit *iface, VARIANT_BOOL value)
416 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
417 FIXME("(%p)->(%04x) stub\n", This, value);
418 return E_NOTIMPL;
421 static HRESULT WINAPI DHTMLEdit_get_IsDirty(IDHTMLEdit *iface, VARIANT_BOOL *value)
423 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
424 FIXME("(%p)->(%p) stub\n", This, value);
425 return E_NOTIMPL;
428 static HRESULT WINAPI DHTMLEdit_get_CurrentDocumentPath(IDHTMLEdit *iface, BSTR *value)
430 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
431 FIXME("(%p)->(%p) stub\n", This, value);
432 return E_NOTIMPL;
435 static HRESULT WINAPI DHTMLEdit_get_BaseURL(IDHTMLEdit *iface, BSTR *value)
437 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
438 FIXME("(%p)->(%p) stub\n", This, value);
439 return E_NOTIMPL;
442 static HRESULT WINAPI DHTMLEdit_put_BaseURL(IDHTMLEdit *iface, BSTR value)
444 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
445 FIXME("(%p)->(%s) stub\n", This, debugstr_w(value));
446 return E_NOTIMPL;
449 static HRESULT WINAPI DHTMLEdit_get_DocumentTitle(IDHTMLEdit *iface, BSTR *value)
451 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
452 FIXME("(%p)->(%p) stub\n", This, value);
453 return E_NOTIMPL;
456 static HRESULT WINAPI DHTMLEdit_get_UseDivOnCarriageReturn(IDHTMLEdit *iface, VARIANT_BOOL *value)
458 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
459 FIXME("(%p)->(%p) stub\n", This, value);
460 return E_NOTIMPL;
463 static HRESULT WINAPI DHTMLEdit_put_UseDivOnCarriageReturn(IDHTMLEdit *iface, VARIANT_BOOL value)
465 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
466 FIXME("(%p)->(%04x) stub\n", This, value);
467 return E_NOTIMPL;
470 static HRESULT WINAPI DHTMLEdit_get_Busy(IDHTMLEdit *iface, VARIANT_BOOL *value)
472 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
473 FIXME("(%p)->(%p) stub\n", This, value);
474 return E_NOTIMPL;
477 static HRESULT WINAPI DHTMLEdit_LoadDocument(IDHTMLEdit *iface, VARIANT *path, VARIANT *prompt)
479 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
480 FIXME("(%p)->(%s, %s) stub\n", This, debugstr_variant(path), debugstr_variant(prompt));
481 return E_NOTIMPL;
484 static HRESULT WINAPI DHTMLEdit_SaveDocument(IDHTMLEdit *iface, VARIANT *path, VARIANT *prompt)
486 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
487 FIXME("(%p)->(%s, %s) stub\n", This, debugstr_variant(path), debugstr_variant(prompt));
488 return E_NOTIMPL;
491 static HRESULT WINAPI DHTMLEdit_PrintDocument(IDHTMLEdit *iface, VARIANT *prompt)
493 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
494 FIXME("(%p)->(%s) stub\n", This, debugstr_variant(prompt));
495 return E_NOTIMPL;
498 static HRESULT WINAPI DHTMLEdit_get_BrowseMode(IDHTMLEdit *iface, VARIANT_BOOL *value)
500 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
501 FIXME("(%p)->(%p) stub\n", This, value);
502 return E_NOTIMPL;
505 static HRESULT WINAPI DHTMLEdit_put_BrowseMode(IDHTMLEdit *iface, VARIANT_BOOL value)
507 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
508 FIXME("(%p)->(%04x) stub\n", This, value);
509 return E_NOTIMPL;
512 static const IDHTMLEditVtbl DHTMLEditVtbl = {
513 DHTMLEdit_QueryInterface,
514 DHTMLEdit_AddRef,
515 DHTMLEdit_Release,
516 DHTMLEdit_GetTypeInfoCount,
517 DHTMLEdit_GetTypeInfo,
518 DHTMLEdit_GetIDsOfNames,
519 DHTMLEdit_Invoke,
520 DHTMLEdit_ExecCommand,
521 DHTMLEdit_QueryStatus,
522 DHTMLEdit_SetContextMenu,
523 DHTMLEdit_NewDocument,
524 DHTMLEdit_LoadURL,
525 DHTMLEdit_FilterSourceCode,
526 DHTMLEdit_Refresh,
527 DHTMLEdit_get_DOM,
528 DHTMLEdit_get_DocumentHTML,
529 DHTMLEdit_put_DocumentHTML,
530 DHTMLEdit_get_ActivateApplets,
531 DHTMLEdit_put_ActivateApplets,
532 DHTMLEdit_get_ActivateActiveXControls,
533 DHTMLEdit_put_ActivateActiveXControls,
534 DHTMLEdit_get_ActivateDTCs,
535 DHTMLEdit_put_ActivateDTCs,
536 DHTMLEdit_get_ShowDetails,
537 DHTMLEdit_put_ShowDetails,
538 DHTMLEdit_get_ShowBorders,
539 DHTMLEdit_put_ShowBorders,
540 DHTMLEdit_get_Appearance,
541 DHTMLEdit_put_Appearance,
542 DHTMLEdit_get_Scrollbars,
543 DHTMLEdit_put_Scrollbars,
544 DHTMLEdit_get_ScrollbarAppearance,
545 DHTMLEdit_put_ScrollbarAppearance,
546 DHTMLEdit_get_SourceCodePreservation,
547 DHTMLEdit_put_SourceCodePreservation,
548 DHTMLEdit_get_AbsoluteDropMode,
549 DHTMLEdit_put_AbsoluteDropMode,
550 DHTMLEdit_get_SnapToGridX,
551 DHTMLEdit_put_SnapToGridX,
552 DHTMLEdit_get_SnapToGridY,
553 DHTMLEdit_put_SnapToGridY,
554 DHTMLEdit_get_SnapToGrid,
555 DHTMLEdit_put_SnapToGrid,
556 DHTMLEdit_get_IsDirty,
557 DHTMLEdit_get_CurrentDocumentPath,
558 DHTMLEdit_get_BaseURL,
559 DHTMLEdit_put_BaseURL,
560 DHTMLEdit_get_DocumentTitle,
561 DHTMLEdit_get_UseDivOnCarriageReturn,
562 DHTMLEdit_put_UseDivOnCarriageReturn,
563 DHTMLEdit_get_Busy,
564 DHTMLEdit_LoadDocument,
565 DHTMLEdit_SaveDocument,
566 DHTMLEdit_PrintDocument,
567 DHTMLEdit_get_BrowseMode,
568 DHTMLEdit_put_BrowseMode
571 static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID iid, void **out)
573 return dhtml_edit_qi(impl_from_IOleObject(iface), iid, out);
576 static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
578 return dhtml_edit_addref(impl_from_IOleObject(iface));
581 static ULONG WINAPI OleObject_Release(IOleObject *iface)
583 return dhtml_edit_release(impl_from_IOleObject(iface));
586 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *value)
588 DHTMLEditImpl *This = impl_from_IOleObject(iface);
590 TRACE("(%p)->(%p)\n", This, value);
592 if (This->client_site)
593 IOleClientSite_Release(This->client_site);
595 if (value)
596 IOleClientSite_AddRef(value);
598 This->client_site = value;
600 return S_OK;
603 static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **value)
605 DHTMLEditImpl *This = impl_from_IOleObject(iface);
607 TRACE("(%p)->(%p)\n", This, value);
609 if (This->client_site)
610 IOleClientSite_AddRef(This->client_site);
612 *value = This->client_site;
614 return S_OK;
617 static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface,
618 const OLECHAR *container_app, const OLECHAR *container_obj)
620 DHTMLEditImpl *This = impl_from_IOleObject(iface);
621 FIXME("(%p)->(%p, %p) stub\n", This, container_app, container_obj);
622 return E_NOTIMPL;
625 static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD save)
627 DHTMLEditImpl *This = impl_from_IOleObject(iface);
628 FIXME("(%p)->(%u) stub\n", This, save);
629 return S_OK;
632 static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD moniker_id, IMoniker *value)
634 DHTMLEditImpl *This = impl_from_IOleObject(iface);
635 FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
636 return E_NOTIMPL;
639 static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD assign, DWORD moniker_id, IMoniker **value)
641 DHTMLEditImpl *This = impl_from_IOleObject(iface);
642 FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
643 *value = NULL;
644 return E_NOTIMPL;
647 static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *data_obj, BOOL creation, DWORD reserved)
649 DHTMLEditImpl *This = impl_from_IOleObject(iface);
650 FIXME("(%p)->(%p, %u, %u) stub\n", This, data_obj, creation, reserved);
651 return E_NOTIMPL;
654 static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD reserved, IDataObject **value)
656 DHTMLEditImpl *This = impl_from_IOleObject(iface);
657 FIXME("(%p)->(%u, %p) stub\n", This, reserved, value);
658 *value = NULL;
659 return E_NOTIMPL;
662 static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG verb, MSG *msg, IOleClientSite *active_site,
663 LONG index, HWND parent, const RECT *pos)
665 DHTMLEditImpl *This = impl_from_IOleObject(iface);
666 TRACE("(%p)->(%d, %p, %p, %d, %p, %p) stub\n", This, verb, msg, active_site, index, parent, pos);
668 if (verb == OLEIVERB_INPLACEACTIVATE)
670 IOleClientSite_OnShowWindow(This->client_site, TRUE);
671 return S_OK;
674 return E_NOTIMPL;
677 static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **verb)
679 DHTMLEditImpl *This = impl_from_IOleObject(iface);
680 FIXME("(%p)->(%p) stub\n", This, verb);
681 *verb = NULL;
682 return E_NOTIMPL;
685 static HRESULT WINAPI OleObject_Update(IOleObject *iface)
687 DHTMLEditImpl *This = impl_from_IOleObject(iface);
688 FIXME("(%p) stub\n", This);
689 return E_NOTIMPL;
692 static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
694 DHTMLEditImpl *This = impl_from_IOleObject(iface);
695 FIXME("(%p) stub\n", This);
696 return E_NOTIMPL;
699 static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *clsid)
701 DHTMLEditImpl *This = impl_from_IOleObject(iface);
702 FIXME("(%p)->(%p) stub\n", This, clsid);
703 return E_NOTIMPL;
706 static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD type_type, OLECHAR **type)
708 DHTMLEditImpl *This = impl_from_IOleObject(iface);
709 FIXME("(%p)->(%u, %p) stub\n", This, type_type, type);
710 *type = NULL;
711 return E_NOTIMPL;
714 static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
716 DHTMLEditImpl *This = impl_from_IOleObject(iface);
717 TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
719 if(aspect != DVASPECT_CONTENT)
720 return DV_E_DVASPECT;
722 This->extent = *size_limit;
723 return S_OK;
726 static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
728 DHTMLEditImpl *This = impl_from_IOleObject(iface);
729 TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
731 if(aspect != DVASPECT_CONTENT)
732 return E_FAIL;
734 *size_limit = This->extent;
735 return S_OK;
738 static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *conn)
740 DHTMLEditImpl *This = impl_from_IOleObject(iface);
741 FIXME("(%p)->(%p, %p) stub\n", This, sink, conn);
742 *conn = 0;
743 return E_NOTIMPL;
746 static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD conn)
748 DHTMLEditImpl *This = impl_from_IOleObject(iface);
749 FIXME("(%p)->(%u) stub\n", This, conn);
750 return E_NOTIMPL;
753 static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **advise)
755 DHTMLEditImpl *This = impl_from_IOleObject(iface);
756 FIXME("(%p)->(%p) stub\n", This, advise);
757 *advise = NULL;
758 return E_NOTIMPL;
761 static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD aspect, DWORD *status)
763 DHTMLEditImpl *This = impl_from_IOleObject(iface);
764 TRACE("(%p)->(%u, %p)\n", This, aspect, status);
766 return OleRegGetMiscStatus(&CLSID_DHTMLEdit, aspect, status);
769 static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *palette)
771 DHTMLEditImpl *This = impl_from_IOleObject(iface);
772 FIXME("(%p)->(%p) stub\n", This, palette);
773 return E_NOTIMPL;
776 static const IOleObjectVtbl OleObjectVtbl = {
777 OleObject_QueryInterface,
778 OleObject_AddRef,
779 OleObject_Release,
780 OleObject_SetClientSite,
781 OleObject_GetClientSite,
782 OleObject_SetHostNames,
783 OleObject_Close,
784 OleObject_SetMoniker,
785 OleObject_GetMoniker,
786 OleObject_InitFromData,
787 OleObject_GetClipboardData,
788 OleObject_DoVerb,
789 OleObject_EnumVerbs,
790 OleObject_Update,
791 OleObject_IsUpToDate,
792 OleObject_GetUserClassID,
793 OleObject_GetUserType,
794 OleObject_SetExtent,
795 OleObject_GetExtent,
796 OleObject_Advise,
797 OleObject_Unadvise,
798 OleObject_EnumAdvise,
799 OleObject_GetMiscStatus,
800 OleObject_SetColorScheme
803 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID iid, void **out)
805 return dhtml_edit_qi(impl_from_IPersistStreamInit(iface), iid, out);
808 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
810 return dhtml_edit_addref(impl_from_IPersistStreamInit(iface));
813 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
815 return dhtml_edit_release(impl_from_IPersistStreamInit(iface));
818 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *clsid)
820 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
821 FIXME("(%p)->(%p) stub\n", This, clsid);
822 return E_NOTIMPL;
825 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
827 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
828 FIXME("(%p) stub\n", This);
829 return E_NOTIMPL;
832 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream)
834 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
835 FIXME("(%p)->(%p) stub\n", This, stream);
836 return S_OK;
839 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *stream, BOOL clear_dirty)
841 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
842 FIXME("(%p)->(%p, %u) stub\n", This, stream, clear_dirty);
843 return E_NOTIMPL;
846 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *value)
848 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
849 FIXME("(%p)->(%p) stub\n", This, value);
850 value->QuadPart = 0;
851 return E_NOTIMPL;
854 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
856 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
857 FIXME("(%p) stub\n", This);
858 return E_NOTIMPL;
861 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
862 PersistStreamInit_QueryInterface,
863 PersistStreamInit_AddRef,
864 PersistStreamInit_Release,
865 PersistStreamInit_GetClassID,
866 PersistStreamInit_IsDirty,
867 PersistStreamInit_Load,
868 PersistStreamInit_Save,
869 PersistStreamInit_GetSizeMax,
870 PersistStreamInit_InitNew
873 static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID iid, void **out)
875 return dhtml_edit_qi(impl_from_IOleControl(iface), iid, out);
878 static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
880 return dhtml_edit_addref(impl_from_IOleControl(iface));
883 static ULONG WINAPI OleControl_Release(IOleControl *iface)
885 return dhtml_edit_release(impl_from_IOleControl(iface));
888 static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI)
890 DHTMLEditImpl *This = impl_from_IOleControl(iface);
891 FIXME("(%p)->(%p)\n", This, pCI);
892 return E_NOTIMPL;
895 static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *msg)
897 DHTMLEditImpl *This = impl_from_IOleControl(iface);
898 FIXME("(%p)->(%p)\n", This, msg);
899 return E_NOTIMPL;
902 static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
904 DHTMLEditImpl *This = impl_from_IOleControl(iface);
905 FIXME("(%p)->(%d)\n", This, dispID);
906 return E_NOTIMPL;
909 static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL freeze)
911 DHTMLEditImpl *This = impl_from_IOleControl(iface);
912 FIXME("(%p)->(%x)\n", This, freeze);
913 return E_NOTIMPL;
916 static const IOleControlVtbl OleControlVtbl = {
917 OleControl_QueryInterface,
918 OleControl_AddRef,
919 OleControl_Release,
920 OleControl_GetControlInfo,
921 OleControl_OnMnemonic,
922 OleControl_OnAmbientPropertyChange,
923 OleControl_FreezeEvents
926 HRESULT dhtml_edit_create(REFIID iid, void **out)
928 DHTMLEditImpl *This;
929 DWORD dpi_x, dpi_y;
930 HDC hdc;
931 HRESULT ret;
933 TRACE("(%s, %p)\n", debugstr_guid(iid), out);
935 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
936 if (!This)
937 return E_OUTOFMEMORY;
939 This->IDHTMLEdit_iface.lpVtbl = &DHTMLEditVtbl;
940 This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
941 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
942 This->IOleControl_iface.lpVtbl = &OleControlVtbl;
943 This->client_site = NULL;
944 This->ref = 1;
946 hdc = GetDC(0);
947 dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
948 dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
949 ReleaseDC(0, hdc);
951 This->extent.cx = MulDiv(192, 2540, dpi_x);
952 This->extent.cy = MulDiv(192, 2540, dpi_y);
954 ret = IDHTMLEdit_QueryInterface(&This->IDHTMLEdit_iface, iid, out);
955 IDHTMLEdit_Release(&This->IDHTMLEdit_iface);
956 return ret;