ntdll: Make sure we don't try to attach the main exe a second time.
[wine/zf.git] / dlls / dhtmled.ocx / edit.c
blob874b6554e590e463ec064608fa1a23b0935a1e90
1 /*
2 * Copyright 2017 Alex Henrie
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
21 #include "dhtmled.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(dhtmled);
27 typedef struct
29 IDHTMLEdit IDHTMLEdit_iface;
30 IOleObject IOleObject_iface;
31 IPersistStreamInit IPersistStreamInit_iface;
32 IOleClientSite *client_site;
33 LONG ref;
34 } DHTMLEditImpl;
36 static inline DHTMLEditImpl *impl_from_IDHTMLEdit(IDHTMLEdit *iface)
38 return CONTAINING_RECORD(iface, DHTMLEditImpl, IDHTMLEdit_iface);
41 static inline DHTMLEditImpl *impl_from_IOleObject(IOleObject *iface)
43 return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleObject_iface);
46 static inline DHTMLEditImpl *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
48 return CONTAINING_RECORD(iface, DHTMLEditImpl, IPersistStreamInit_iface);
51 static ULONG dhtml_edit_addref(DHTMLEditImpl *This)
53 LONG ref = InterlockedIncrement(&This->ref);
55 TRACE("(%p) ref=%d\n", This, ref);
57 return ref;
60 static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
62 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), out);
64 if (IsEqualGUID(iid, &IID_IUnknown) ||
65 IsEqualGUID(iid, &IID_IDispatch) ||
66 IsEqualGUID(iid, &IID_IDHTMLEdit))
68 dhtml_edit_addref(This);
69 *out = &This->IDHTMLEdit_iface;
70 return S_OK;
72 else if (IsEqualGUID(iid, &IID_IOleObject))
74 dhtml_edit_addref(This);
75 *out = &This->IOleObject_iface;
76 return S_OK;
78 else if (IsEqualGUID(iid, &IID_IPersistStreamInit))
80 dhtml_edit_addref(This);
81 *out = &This->IPersistStreamInit_iface;
82 return S_OK;
85 *out = NULL;
86 ERR("no interface for %s\n", debugstr_guid(iid));
87 return E_NOINTERFACE;
90 static ULONG dhtml_edit_release(DHTMLEditImpl *This)
92 LONG ref = InterlockedDecrement(&This->ref);
94 TRACE("(%p) ref=%d\n", This, ref);
96 if (!ref)
98 if (This->client_site)
99 IOleClientSite_Release(This->client_site);
101 HeapFree(GetProcessHeap(), 0, This);
104 return ref;
107 static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, void **out)
109 return dhtml_edit_qi(impl_from_IDHTMLEdit(iface), iid, out);
112 static ULONG WINAPI DHTMLEdit_AddRef(IDHTMLEdit *iface)
114 return dhtml_edit_addref(impl_from_IDHTMLEdit(iface));
117 static ULONG WINAPI DHTMLEdit_Release(IDHTMLEdit *iface)
119 return dhtml_edit_release(impl_from_IDHTMLEdit(iface));
122 static HRESULT WINAPI DHTMLEdit_GetTypeInfoCount(IDHTMLEdit *iface, UINT *count)
124 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
125 FIXME("(%p)->(%p) stub\n", This, count);
126 *count = 0;
127 return E_NOTIMPL;
130 static HRESULT WINAPI DHTMLEdit_GetTypeInfo(IDHTMLEdit *iface, UINT type_index, LCID lcid, ITypeInfo **type_info)
132 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
133 FIXME("(%p)->(%u, %08x, %p) stub\n", This, type_index, lcid, type_info);
134 return E_NOTIMPL;
137 static HRESULT WINAPI DHTMLEdit_GetIDsOfNames(IDHTMLEdit *iface, REFIID iid, OLECHAR **names, UINT name_count,
138 LCID lcid, DISPID *disp_ids)
140 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
141 FIXME("(%p)->(%s, %p, %u, %08x, %p) stub\n", This, debugstr_guid(iid), names, name_count, lcid, disp_ids);
142 return E_NOTIMPL;
145 static HRESULT WINAPI DHTMLEdit_Invoke(IDHTMLEdit *iface, DISPID member, REFIID iid, LCID lcid, WORD flags,
146 DISPPARAMS *params, VARIANT *ret, EXCEPINFO *exception_info, UINT *error_index)
148 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
149 FIXME("(%p)->(%d, %s, %08x, 0x%x, %p, %p, %p, %p) stub\n",
150 This, member, debugstr_guid(iid), lcid, flags, params, ret, exception_info, error_index);
151 return E_NOTIMPL;
154 static HRESULT WINAPI DHTMLEdit_ExecCommand(IDHTMLEdit *iface, DHTMLEDITCMDID cmd_id, OLECMDEXECOPT options,
155 VARIANT *code_in, VARIANT *code_out)
157 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
158 FIXME("(%p)->(%u, %u, %s, %p) stub\n", This, cmd_id, options, debugstr_variant(code_in), code_out);
159 return E_NOTIMPL;
162 static HRESULT WINAPI DHTMLEdit_QueryStatus(IDHTMLEdit *iface, DHTMLEDITCMDID cmd_id, DHTMLEDITCMDF *status)
164 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
165 FIXME("(%p)->(%u, %p) stub\n", This, cmd_id, status);
166 return E_NOTIMPL;
169 static HRESULT WINAPI DHTMLEdit_SetContextMenu(IDHTMLEdit *iface, VARIANT *strings, VARIANT *states)
171 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
172 FIXME("(%p)->(%p, %p) stub\n", This, strings, states);
173 return E_NOTIMPL;
176 static HRESULT WINAPI DHTMLEdit_NewDocument(IDHTMLEdit *iface)
178 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
179 FIXME("(%p)->() stub\n", This);
180 return E_NOTIMPL;
183 static HRESULT WINAPI DHTMLEdit_LoadURL(IDHTMLEdit *iface, BSTR url)
185 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
186 FIXME("(%p)->(%s)\n", This, debugstr_w(url));
187 return E_NOTIMPL;
190 static HRESULT WINAPI DHTMLEdit_FilterSourceCode(IDHTMLEdit *iface, BSTR in, BSTR *out)
192 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
193 FIXME("(%p)->(%s, %p)\n", This, debugstr_w(in), out);
194 return E_NOTIMPL;
197 static HRESULT WINAPI DHTMLEdit_Refresh(IDHTMLEdit *iface)
199 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
200 FIXME("(%p)->() stub\n", This);
201 return E_NOTIMPL;
204 static HRESULT WINAPI DHTMLEdit_get_DOM(IDHTMLEdit *iface, IHTMLDocument2 **value)
206 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
207 FIXME("(%p)->(%p) stub\n", This, value);
208 return E_NOTIMPL;
211 static HRESULT WINAPI DHTMLEdit_get_DocumentHTML(IDHTMLEdit *iface, BSTR *value)
213 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
214 FIXME("(%p)->(%p) stub\n", This, value);
215 return E_NOTIMPL;
218 static HRESULT WINAPI DHTMLEdit_put_DocumentHTML(IDHTMLEdit *iface, BSTR html)
220 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
221 FIXME("(%p)->(%s) stub\n", This, debugstr_w(html));
222 return E_NOTIMPL;
225 static HRESULT WINAPI DHTMLEdit_get_ActivateApplets(IDHTMLEdit *iface, VARIANT_BOOL *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_ActivateApplets(IDHTMLEdit *iface, VARIANT_BOOL value)
234 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
235 FIXME("(%p)->(%04x) stub\n", This, value);
236 return E_NOTIMPL;
239 static HRESULT WINAPI DHTMLEdit_get_ActivateActiveXControls(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_ActivateActiveXControls(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_ActivateDTCs(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_ActivateDTCs(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_ShowDetails(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_ShowDetails(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_ShowBorders(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_ShowBorders(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_Appearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE *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_Appearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE value)
304 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
305 FIXME("(%p)->(%u) stub\n", This, value);
306 return E_NOTIMPL;
309 static HRESULT WINAPI DHTMLEdit_get_Scrollbars(IDHTMLEdit *iface, VARIANT_BOOL *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_Scrollbars(IDHTMLEdit *iface, VARIANT_BOOL value)
318 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
319 FIXME("(%p)->(%04x) stub\n", This, value);
320 return E_NOTIMPL;
323 static HRESULT WINAPI DHTMLEdit_get_ScrollbarAppearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE *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_ScrollbarAppearance(IDHTMLEdit *iface, DHTMLEDITAPPEARANCE value)
332 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
333 FIXME("(%p)->(%u) stub\n", This, value);
334 return E_NOTIMPL;
337 static HRESULT WINAPI DHTMLEdit_get_SourceCodePreservation(IDHTMLEdit *iface, VARIANT_BOOL *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_SourceCodePreservation(IDHTMLEdit *iface, VARIANT_BOOL value)
346 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
347 FIXME("(%p)->(%04x) stub\n", This, value);
348 return E_NOTIMPL;
351 static HRESULT WINAPI DHTMLEdit_get_AbsoluteDropMode(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_AbsoluteDropMode(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_SnapToGridX(IDHTMLEdit *iface, LONG *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_SnapToGridX(IDHTMLEdit *iface, LONG value)
374 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
375 FIXME("(%p)->(%d) stub\n", This, value);
376 return E_NOTIMPL;
379 static HRESULT WINAPI DHTMLEdit_get_SnapToGridY(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_SnapToGridY(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_SnapToGrid(IDHTMLEdit *iface, VARIANT_BOOL *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_SnapToGrid(IDHTMLEdit *iface, VARIANT_BOOL value)
402 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
403 FIXME("(%p)->(%04x) stub\n", This, value);
404 return E_NOTIMPL;
407 static HRESULT WINAPI DHTMLEdit_get_IsDirty(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_get_CurrentDocumentPath(IDHTMLEdit *iface, BSTR *value)
416 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
417 FIXME("(%p)->(%p) stub\n", This, value);
418 return E_NOTIMPL;
421 static HRESULT WINAPI DHTMLEdit_get_BaseURL(IDHTMLEdit *iface, BSTR *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_put_BaseURL(IDHTMLEdit *iface, BSTR value)
430 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
431 FIXME("(%p)->(%s) stub\n", This, debugstr_w(value));
432 return E_NOTIMPL;
435 static HRESULT WINAPI DHTMLEdit_get_DocumentTitle(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_get_UseDivOnCarriageReturn(IDHTMLEdit *iface, VARIANT_BOOL *value)
444 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
445 FIXME("(%p)->(%p) stub\n", This, value);
446 return E_NOTIMPL;
449 static HRESULT WINAPI DHTMLEdit_put_UseDivOnCarriageReturn(IDHTMLEdit *iface, VARIANT_BOOL value)
451 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
452 FIXME("(%p)->(%04x) stub\n", This, value);
453 return E_NOTIMPL;
456 static HRESULT WINAPI DHTMLEdit_get_Busy(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_LoadDocument(IDHTMLEdit *iface, VARIANT *path, VARIANT *prompt)
465 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
466 FIXME("(%p)->(%s, %s) stub\n", This, debugstr_variant(path), debugstr_variant(prompt));
467 return E_NOTIMPL;
470 static HRESULT WINAPI DHTMLEdit_SaveDocument(IDHTMLEdit *iface, VARIANT *path, VARIANT *prompt)
472 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
473 FIXME("(%p)->(%s, %s) stub\n", This, debugstr_variant(path), debugstr_variant(prompt));
474 return E_NOTIMPL;
477 static HRESULT WINAPI DHTMLEdit_PrintDocument(IDHTMLEdit *iface, VARIANT *prompt)
479 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
480 FIXME("(%p)->(%s) stub\n", This, debugstr_variant(prompt));
481 return E_NOTIMPL;
484 static HRESULT WINAPI DHTMLEdit_get_BrowseMode(IDHTMLEdit *iface, VARIANT_BOOL *value)
486 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
487 FIXME("(%p)->(%p) stub\n", This, value);
488 return E_NOTIMPL;
491 static HRESULT WINAPI DHTMLEdit_put_BrowseMode(IDHTMLEdit *iface, VARIANT_BOOL value)
493 DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface);
494 FIXME("(%p)->(%04x) stub\n", This, value);
495 return E_NOTIMPL;
498 static const IDHTMLEditVtbl DHTMLEditVtbl = {
499 DHTMLEdit_QueryInterface,
500 DHTMLEdit_AddRef,
501 DHTMLEdit_Release,
502 DHTMLEdit_GetTypeInfoCount,
503 DHTMLEdit_GetTypeInfo,
504 DHTMLEdit_GetIDsOfNames,
505 DHTMLEdit_Invoke,
506 DHTMLEdit_ExecCommand,
507 DHTMLEdit_QueryStatus,
508 DHTMLEdit_SetContextMenu,
509 DHTMLEdit_NewDocument,
510 DHTMLEdit_LoadURL,
511 DHTMLEdit_FilterSourceCode,
512 DHTMLEdit_Refresh,
513 DHTMLEdit_get_DOM,
514 DHTMLEdit_get_DocumentHTML,
515 DHTMLEdit_put_DocumentHTML,
516 DHTMLEdit_get_ActivateApplets,
517 DHTMLEdit_put_ActivateApplets,
518 DHTMLEdit_get_ActivateActiveXControls,
519 DHTMLEdit_put_ActivateActiveXControls,
520 DHTMLEdit_get_ActivateDTCs,
521 DHTMLEdit_put_ActivateDTCs,
522 DHTMLEdit_get_ShowDetails,
523 DHTMLEdit_put_ShowDetails,
524 DHTMLEdit_get_ShowBorders,
525 DHTMLEdit_put_ShowBorders,
526 DHTMLEdit_get_Appearance,
527 DHTMLEdit_put_Appearance,
528 DHTMLEdit_get_Scrollbars,
529 DHTMLEdit_put_Scrollbars,
530 DHTMLEdit_get_ScrollbarAppearance,
531 DHTMLEdit_put_ScrollbarAppearance,
532 DHTMLEdit_get_SourceCodePreservation,
533 DHTMLEdit_put_SourceCodePreservation,
534 DHTMLEdit_get_AbsoluteDropMode,
535 DHTMLEdit_put_AbsoluteDropMode,
536 DHTMLEdit_get_SnapToGridX,
537 DHTMLEdit_put_SnapToGridX,
538 DHTMLEdit_get_SnapToGridY,
539 DHTMLEdit_put_SnapToGridY,
540 DHTMLEdit_get_SnapToGrid,
541 DHTMLEdit_put_SnapToGrid,
542 DHTMLEdit_get_IsDirty,
543 DHTMLEdit_get_CurrentDocumentPath,
544 DHTMLEdit_get_BaseURL,
545 DHTMLEdit_put_BaseURL,
546 DHTMLEdit_get_DocumentTitle,
547 DHTMLEdit_get_UseDivOnCarriageReturn,
548 DHTMLEdit_put_UseDivOnCarriageReturn,
549 DHTMLEdit_get_Busy,
550 DHTMLEdit_LoadDocument,
551 DHTMLEdit_SaveDocument,
552 DHTMLEdit_PrintDocument,
553 DHTMLEdit_get_BrowseMode,
554 DHTMLEdit_put_BrowseMode
557 static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID iid, void **out)
559 return dhtml_edit_qi(impl_from_IOleObject(iface), iid, out);
562 static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
564 return dhtml_edit_addref(impl_from_IOleObject(iface));
567 static ULONG WINAPI OleObject_Release(IOleObject *iface)
569 return dhtml_edit_release(impl_from_IOleObject(iface));
572 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *value)
574 DHTMLEditImpl *This = impl_from_IOleObject(iface);
576 TRACE("(%p)->(%p)\n", This, value);
578 if (This->client_site)
579 IOleClientSite_Release(This->client_site);
581 if (value)
582 IOleClientSite_AddRef(value);
584 This->client_site = value;
586 return S_OK;
589 static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **value)
591 DHTMLEditImpl *This = impl_from_IOleObject(iface);
593 TRACE("(%p)->(%p)\n", This, value);
595 if (This->client_site)
596 IOleClientSite_AddRef(This->client_site);
598 *value = This->client_site;
600 return S_OK;
603 static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface,
604 const OLECHAR *container_app, const OLECHAR *container_obj)
606 DHTMLEditImpl *This = impl_from_IOleObject(iface);
607 FIXME("(%p)->(%p, %p) stub\n", This, container_app, container_obj);
608 return E_NOTIMPL;
611 static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD save)
613 DHTMLEditImpl *This = impl_from_IOleObject(iface);
614 FIXME("(%p)->(%u) stub\n", This, save);
615 return S_OK;
618 static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD moniker_id, IMoniker *value)
620 DHTMLEditImpl *This = impl_from_IOleObject(iface);
621 FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
622 return E_NOTIMPL;
625 static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD assign, DWORD moniker_id, IMoniker **value)
627 DHTMLEditImpl *This = impl_from_IOleObject(iface);
628 FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
629 *value = NULL;
630 return E_NOTIMPL;
633 static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *data_obj, BOOL creation, DWORD reserved)
635 DHTMLEditImpl *This = impl_from_IOleObject(iface);
636 FIXME("(%p)->(%p, %u, %u) stub\n", This, data_obj, creation, reserved);
637 return E_NOTIMPL;
640 static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD reserved, IDataObject **value)
642 DHTMLEditImpl *This = impl_from_IOleObject(iface);
643 FIXME("(%p)->(%u, %p) stub\n", This, reserved, value);
644 *value = NULL;
645 return E_NOTIMPL;
648 static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG verb, MSG *msg, IOleClientSite *active_site,
649 LONG index, HWND parent, const RECT *pos)
651 DHTMLEditImpl *This = impl_from_IOleObject(iface);
652 TRACE("(%p)->(%d, %p, %p, %d, %p, %p) stub\n", This, verb, msg, active_site, index, parent, pos);
654 if (verb == OLEIVERB_INPLACEACTIVATE)
656 IOleClientSite_OnShowWindow(This->client_site, TRUE);
657 return S_OK;
660 return E_NOTIMPL;
663 static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **verb)
665 DHTMLEditImpl *This = impl_from_IOleObject(iface);
666 FIXME("(%p)->(%p) stub\n", This, verb);
667 *verb = NULL;
668 return E_NOTIMPL;
671 static HRESULT WINAPI OleObject_Update(IOleObject *iface)
673 DHTMLEditImpl *This = impl_from_IOleObject(iface);
674 FIXME("(%p) stub\n", This);
675 return E_NOTIMPL;
678 static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
680 DHTMLEditImpl *This = impl_from_IOleObject(iface);
681 FIXME("(%p) stub\n", This);
682 return E_NOTIMPL;
685 static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *clsid)
687 DHTMLEditImpl *This = impl_from_IOleObject(iface);
688 FIXME("(%p)->(%p) stub\n", This, clsid);
689 return E_NOTIMPL;
692 static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD type_type, OLECHAR **type)
694 DHTMLEditImpl *This = impl_from_IOleObject(iface);
695 FIXME("(%p)->(%u, %p) stub\n", This, type_type, type);
696 *type = NULL;
697 return E_NOTIMPL;
700 static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
702 DHTMLEditImpl *This = impl_from_IOleObject(iface);
703 FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
704 return E_NOTIMPL;
707 static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
709 DHTMLEditImpl *This = impl_from_IOleObject(iface);
710 FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
711 return E_NOTIMPL;
714 static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *conn)
716 DHTMLEditImpl *This = impl_from_IOleObject(iface);
717 FIXME("(%p)->(%p, %p) stub\n", This, sink, conn);
718 *conn = 0;
719 return E_NOTIMPL;
722 static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD conn)
724 DHTMLEditImpl *This = impl_from_IOleObject(iface);
725 FIXME("(%p)->(%u) stub\n", This, conn);
726 return E_NOTIMPL;
729 static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **advise)
731 DHTMLEditImpl *This = impl_from_IOleObject(iface);
732 FIXME("(%p)->(%p) stub\n", This, advise);
733 *advise = NULL;
734 return E_NOTIMPL;
737 static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD aspect, DWORD *status)
739 DHTMLEditImpl *This = impl_from_IOleObject(iface);
740 FIXME("(%p)->(%u, %p) stub\n", This, aspect, status);
741 *status = 0;
742 return E_NOTIMPL;
745 static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *palette)
747 DHTMLEditImpl *This = impl_from_IOleObject(iface);
748 FIXME("(%p)->(%p) stub\n", This, palette);
749 return E_NOTIMPL;
752 static const IOleObjectVtbl OleObjectVtbl = {
753 OleObject_QueryInterface,
754 OleObject_AddRef,
755 OleObject_Release,
756 OleObject_SetClientSite,
757 OleObject_GetClientSite,
758 OleObject_SetHostNames,
759 OleObject_Close,
760 OleObject_SetMoniker,
761 OleObject_GetMoniker,
762 OleObject_InitFromData,
763 OleObject_GetClipboardData,
764 OleObject_DoVerb,
765 OleObject_EnumVerbs,
766 OleObject_Update,
767 OleObject_IsUpToDate,
768 OleObject_GetUserClassID,
769 OleObject_GetUserType,
770 OleObject_SetExtent,
771 OleObject_GetExtent,
772 OleObject_Advise,
773 OleObject_Unadvise,
774 OleObject_EnumAdvise,
775 OleObject_GetMiscStatus,
776 OleObject_SetColorScheme
779 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID iid, void **out)
781 return dhtml_edit_qi(impl_from_IPersistStreamInit(iface), iid, out);
784 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
786 return dhtml_edit_addref(impl_from_IPersistStreamInit(iface));
789 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
791 return dhtml_edit_release(impl_from_IPersistStreamInit(iface));
794 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *clsid)
796 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
797 FIXME("(%p)->(%p) stub\n", This, clsid);
798 return E_NOTIMPL;
801 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
803 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
804 FIXME("(%p) stub\n", This);
805 return E_NOTIMPL;
808 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream)
810 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
811 FIXME("(%p)->(%p) stub\n", This, stream);
812 return S_OK;
815 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *stream, BOOL clear_dirty)
817 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
818 FIXME("(%p)->(%p, %u) stub\n", This, stream, clear_dirty);
819 return E_NOTIMPL;
822 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *value)
824 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
825 FIXME("(%p)->(%p) stub\n", This, value);
826 value->QuadPart = 0;
827 return E_NOTIMPL;
830 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
832 DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface);
833 FIXME("(%p) stub\n", This);
834 return E_NOTIMPL;
837 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
838 PersistStreamInit_QueryInterface,
839 PersistStreamInit_AddRef,
840 PersistStreamInit_Release,
841 PersistStreamInit_GetClassID,
842 PersistStreamInit_IsDirty,
843 PersistStreamInit_Load,
844 PersistStreamInit_Save,
845 PersistStreamInit_GetSizeMax,
846 PersistStreamInit_InitNew
849 HRESULT dhtml_edit_create(REFIID iid, void **out)
851 DHTMLEditImpl *This;
852 HRESULT ret;
854 TRACE("(%s, %p)\n", debugstr_guid(iid), out);
856 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
857 if (!This)
858 return E_OUTOFMEMORY;
860 This->IDHTMLEdit_iface.lpVtbl = &DHTMLEditVtbl;
861 This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
862 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
863 This->client_site = NULL;
864 This->ref = 1;
866 ret = IDHTMLEdit_QueryInterface(&This->IDHTMLEdit_iface, iid, out);
867 IDHTMLEdit_Release(&This->IDHTMLEdit_iface);
868 return ret;