KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > internal > ole > win32 > IDataObject


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.internal.ole.win32;
12
13 public class IDataObject extends IUnknown {
14 public IDataObject(int /*long*/ address) {
15     super(address);
16 }
17 public int EnumFormatEtc(int dwDirection, int /*long*/[] ppenumFormatetc) {
18     return COM.VtblCall(8, address, dwDirection, ppenumFormatetc);
19 }
20 public int GetData(FORMATETC pFormatetc, STGMEDIUM pmedium) {
21     //Called by a data consumer to obtain data from a source data object.
22
//The GetData method renders the data described in the specified FORMATETC
23
//structure and transfers it through the specified STGMEDIUM structure.
24
//The caller then assumes responsibility for releasing the STGMEDIUM structure.
25
return COM.VtblCall(3, address, pFormatetc, pmedium);
26 }
27 public int GetDataHere(FORMATETC pFormatetc, STGMEDIUM pmedium) {
28     //Called by a data consumer to obtain data from a source data object.
29
//This method differs from the GetData method in that the caller must
30
//allocate and free the specified storage medium.
31
return COM.VtblCall(4, address, pFormatetc, pmedium);
32 }
33 public int QueryGetData(FORMATETC pFormatetc) {
34     return COM.VtblCall(5, address, pFormatetc);
35 }
36 public int SetData(
37     FORMATETC pFormatetc, // Pointer to the FORMATETC structure
38
STGMEDIUM pmedium, // Pointer to STGMEDIUM structure
39
boolean fRelease // Indicates which object owns the storage medium after the call is completed
40
){
41     return COM.VtblCall(7, address, pFormatetc, pmedium, fRelease);
42 }
43 }
44
Popular Tags