01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package org.eclipse.swt.internal.ole.win32;
17:
18: /**
19: * Provide the interface IObjectWithSite, a lighter-weight siting mechanism
20: * than IOleObject.
21: *
22: * This interface is used by IE Browser Helper Objects, such as Google Gears.
23: * See http://msdn2.microsoft.com/en-us/library/aa768220.aspx
24: */
25: public class IObjectWithSite extends IUnknown {
26: public IObjectWithSite(int address) {
27: super (address);
28: }
29:
30: /**
31: * Return the last site set with SetSite.
32: *
33: * @param riid IID of the interface to be returned
34: * @param ppvObject return value of the IObjectWithSite interface
35: * @return COM.S_OK on success, COM.E_FAIL if no site has been set, or
36: * COM.E_NOINTERFACE if the requested interface is not supported
37: */
38: public int GetSite(GUID riid, int ppvObject[]) {
39: return COM.VtblCall(4, address, riid, ppvObject);
40: }
41:
42: /**
43: * Sets the IUnknown interface of the site managing this object.
44: *
45: * @param site an IUnknown interface to the browser object
46: * @return COM.S_OK always
47: */
48: public int SetSite(IUnknown site) {
49: return COM.VtblCall(3, address, site.getAddress());
50: }
51: }
|