Menu

[r3207]: / trunk / Src / UOleClientSite.pas  Maximize  Restore  History

Download this file

147 lines (126 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2013, Peter Johnson (www.delphidabbler.com).
*
* $Rev$
* $Date$
*
* Contains a class that provides a do-nothing implementation of the
* IOleClientSite interface that is sufficient to record the application as a
* host for the IE web browser control.
}
unit UOleClientSite;
interface
uses
// Delphi
Windows, ActiveX,
// Project
UBaseObjects;
type
{
TOleClientSite:
Minimal implementation of the IOleClientSite interface that provides a host
container for the web browser control. This implementation is needed so that
the web browser control can call QueryInterface on it to get hold of our
IDocHostUIHandler implementation.
}
TOleClientSite = class(TAggregatedOrLoneObject,
IUnknown, IOleClientSite)
public
{ IOleClientSite methods }
function SaveObject: HResult; stdcall;
{Saves the object associated with the client site. No action taken.
@return S_OK to inform we have responded.
}
function GetMoniker(dwAssign: Longint; dwWhichMoniker: Longint;
out mk: IMoniker): HResult; stdcall;
{Returns a moniker to an object's client site. We don't implement
monikers.
@param dwAssign [in] Not used.
@param dwWhichMoniker [in] Not used.
@param mk [out] Set to nil.
@return E_NOTIMPL to indicate method is not implemented.
}
function GetContainer(out container: IOleContainer): HResult; stdcall;
{Returns a pointer to the container's IOleContainer interface if
supported. We don't support the interface.
@param container [out] Set to nil.
@return E_NOINTERFACE to indicate we don't support IOleContainer.
}
function ShowObject: HResult; stdcall;
{Tells the container to position the object so it is visible to the user.
No action taken.
@return S_OK to inform we have responded.
}
function OnShowWindow(fShow: BOOL): HResult; stdcall;
{Notifies a container when an embedded object's window is about to become
visible or invisible. No action taken.
@param fShow [in] Not used.
@return S_OK to inform we have responded.
}
function RequestNewObjectLayout: HResult; stdcall;
{Asks container to allocate more or less space for displaying an embedded
object. We don't support layout requests.
@return E_NOTIMPL to indicate layout requests not implemented.
}
end;
implementation
{ TOleClientSite }
function TOleClientSite.GetContainer(out container: IOleContainer): HResult;
{Returns a pointer to the container's IOleContainer interface if supported. We
don't support the interface.
@param container [out] Set to nil.
@return E_NOINTERFACE to indicate we don't support IOleContainer.
}
begin
container := nil;
Result := E_NOINTERFACE;
end;
function TOleClientSite.GetMoniker(dwAssign, dwWhichMoniker: Integer;
out mk: IMoniker): HResult;
{Returns a moniker to an object's client site. We don't implement monikers.
@param dwAssign [in] Not used.
@param dwWhichMoniker [in] Not used.
@param mk [out] Set to nil.
@return E_NOTIMPL to indicate method is not implemented.
}
begin
mk := nil;
Result := E_NOTIMPL;
end;
function TOleClientSite.OnShowWindow(fShow: BOOL): HResult;
{Notifies a container when an embedded object's window is about to become
visible or invisible. No action taken.
@param fShow [in] Not used.
@return S_OK to inform we have responded.
}
begin
Result := S_OK;
end;
function TOleClientSite.RequestNewObjectLayout: HResult;
{Asks container to allocate more or less space for displaying an embedded
object. We don't support layout requests.
@return E_NOTIMPL to indicate layout requests not implemented.
}
begin
Result := E_NOTIMPL;
end;
function TOleClientSite.SaveObject: HResult;
{Saves the object associated with the client site. No action taken.
@return S_OK to inform we have responded.
}
begin
Result := S_OK;
end;
function TOleClientSite.ShowObject: HResult;
{Tells the container to position the object so it is visible to the user. No
action taken.
@return S_OK to inform we have responded.
}
begin
Result := S_OK;
end;
end.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.