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
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dhtmled
);
30 IDHTMLEdit IDHTMLEdit_iface
;
31 IOleObject IOleObject_iface
;
32 IPersistStreamInit IPersistStreamInit_iface
;
33 IOleControl IOleControl_iface
;
34 IOleClientSite
*client_site
;
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
);
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
;
80 else if (IsEqualGUID(iid
, &IID_IOleObject
))
82 dhtml_edit_addref(This
);
83 *out
= &This
->IOleObject_iface
;
86 else if (IsEqualGUID(iid
, &IID_IPersistStreamInit
))
88 dhtml_edit_addref(This
);
89 *out
= &This
->IPersistStreamInit_iface
;
92 else if(IsEqualGUID(iid
, &IID_IOleControl
))
94 dhtml_edit_addref(This
);
95 *out
= &This
->IOleControl_iface
;
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
);
112 if (This
->client_site
)
113 IOleClientSite_Release(This
->client_site
);
115 HeapFree(GetProcessHeap(), 0, This
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
190 static HRESULT WINAPI
DHTMLEdit_NewDocument(IDHTMLEdit
*iface
)
192 DHTMLEditImpl
*This
= impl_from_IDHTMLEdit(iface
);
193 FIXME("(%p)->() stub\n", This
);
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
));
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
);
211 static HRESULT WINAPI
DHTMLEdit_Refresh(IDHTMLEdit
*iface
)
213 DHTMLEditImpl
*This
= impl_from_IDHTMLEdit(iface
);
214 FIXME("(%p)->() stub\n", This
);
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
);
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
);
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
));
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
));
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
);
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
);
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
);
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
);
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
));
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
));
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
));
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
);
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
);
512 static const IDHTMLEditVtbl DHTMLEditVtbl
= {
513 DHTMLEdit_QueryInterface
,
516 DHTMLEdit_GetTypeInfoCount
,
517 DHTMLEdit_GetTypeInfo
,
518 DHTMLEdit_GetIDsOfNames
,
520 DHTMLEdit_ExecCommand
,
521 DHTMLEdit_QueryStatus
,
522 DHTMLEdit_SetContextMenu
,
523 DHTMLEdit_NewDocument
,
525 DHTMLEdit_FilterSourceCode
,
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
,
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
);
596 IOleClientSite_AddRef(value
);
598 This
->client_site
= value
;
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
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
685 static HRESULT WINAPI
OleObject_Update(IOleObject
*iface
)
687 DHTMLEditImpl
*This
= impl_from_IOleObject(iface
);
688 FIXME("(%p) stub\n", This
);
692 static HRESULT WINAPI
OleObject_IsUpToDate(IOleObject
*iface
)
694 DHTMLEditImpl
*This
= impl_from_IOleObject(iface
);
695 FIXME("(%p) stub\n", This
);
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
);
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
);
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
;
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
)
734 *size_limit
= This
->extent
;
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
);
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
);
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
);
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
);
776 static const IOleObjectVtbl OleObjectVtbl
= {
777 OleObject_QueryInterface
,
780 OleObject_SetClientSite
,
781 OleObject_GetClientSite
,
782 OleObject_SetHostNames
,
784 OleObject_SetMoniker
,
785 OleObject_GetMoniker
,
786 OleObject_InitFromData
,
787 OleObject_GetClipboardData
,
791 OleObject_IsUpToDate
,
792 OleObject_GetUserClassID
,
793 OleObject_GetUserType
,
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
);
825 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
827 DHTMLEditImpl
*This
= impl_from_IPersistStreamInit(iface
);
828 FIXME("(%p) stub\n", This
);
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
);
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
);
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
);
854 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
856 DHTMLEditImpl
*This
= impl_from_IPersistStreamInit(iface
);
857 FIXME("(%p) stub\n", This
);
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
);
895 static HRESULT WINAPI
OleControl_OnMnemonic(IOleControl
*iface
, MSG
*msg
)
897 DHTMLEditImpl
*This
= impl_from_IOleControl(iface
);
898 FIXME("(%p)->(%p)\n", This
, msg
);
902 static HRESULT WINAPI
OleControl_OnAmbientPropertyChange(IOleControl
*iface
, DISPID dispID
)
904 DHTMLEditImpl
*This
= impl_from_IOleControl(iface
);
905 FIXME("(%p)->(%d)\n", This
, dispID
);
909 static HRESULT WINAPI
OleControl_FreezeEvents(IOleControl
*iface
, BOOL freeze
)
911 DHTMLEditImpl
*This
= impl_from_IOleControl(iface
);
912 FIXME("(%p)->(%x)\n", This
, freeze
);
916 static const IOleControlVtbl OleControlVtbl
= {
917 OleControl_QueryInterface
,
920 OleControl_GetControlInfo
,
921 OleControl_OnMnemonic
,
922 OleControl_OnAmbientPropertyChange
,
923 OleControl_FreezeEvents
926 HRESULT
dhtml_edit_create(REFIID iid
, void **out
)
933 TRACE("(%s, %p)\n", debugstr_guid(iid
), out
);
935 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(*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
;
947 dpi_x
= GetDeviceCaps(hdc
, LOGPIXELSX
);
948 dpi_y
= GetDeviceCaps(hdc
, LOGPIXELSY
);
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
);