01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Pavel Dolgov
19: * @version $Revision$
20: */package org.apache.harmony.awt.datatransfer;
21:
22: import java.awt.datatransfer.DataFlavor;
23:
24: /**
25: * Unified representation of transferable data,
26: * either obtained from or prepared for native clipboard and/or drag&drop
27: */
28: public interface DataProvider {
29: /**
30: * More information about MIME types and Drag&Drop can be found at
31: * http://java.sun.com/j2se/1.5.0/docs/api/java/awt/datatransfer/DataFlavor.html
32: * http://java.sun.com/j2se/1.5.0/docs/guide/dragndrop/spec/dnd1.html
33: */
34:
35: public static final String FORMAT_TEXT = "text/plain"; //$NON-NLS-1$
36: public static final String FORMAT_FILE_LIST = "application/x-java-file-list"; //$NON-NLS-1$
37: public static final String FORMAT_URL = "application/x-java-url"; //$NON-NLS-1$
38: public static final String FORMAT_HTML = "text/html"; //$NON-NLS-1$
39: public static final String FORMAT_IMAGE = "image/x-java-image"; //$NON-NLS-1$
40:
41: public static final String TYPE_IMAGE = "image/x-java-image"; //$NON-NLS-1$
42: public static final String TYPE_SERIALIZED = "application/x-java-serialized-object"; //$NON-NLS-1$
43: public static final String TYPE_PLAINTEXT = "text/plain"; //$NON-NLS-1$
44: public static final String TYPE_HTML = "text/html"; //$NON-NLS-1$
45: public static final String TYPE_URL = "application/x-java-url"; //$NON-NLS-1$
46: public static final String TYPE_TEXTENCODING = "application/x-java-text-encoding"; //$NON-NLS-1$
47: public static final String TYPE_FILELIST = "application/x-java-file-list"; //$NON-NLS-1$
48: public static final String TYPE_URILIST = "text/uri-list"; //$NON-NLS-1$
49:
50: public static final DataFlavor urlFlavor = new DataFlavor(
51: "application/x-java-url;class=java.net.URL", "URL"); //$NON-NLS-1$ //$NON-NLS-2$
52:
53: public static final DataFlavor uriFlavor = new DataFlavor(
54: "text/uri-list", "URI"); //$NON-NLS-1$ //$NON-NLS-2$
55:
56: public String[] getNativeFormats();
57:
58: public boolean isNativeFormatAvailable(String nativeFormat);
59:
60: public String getText();
61:
62: public String[] getFileList();
63:
64: public String getURL();
65:
66: public String getHTML();
67:
68: public RawBitmap getRawBitmap();
69:
70: public byte[] getSerializedObject(Class<?> clazz);
71: }
|