1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.capability;
1819importorg.apache.jetspeed.util.*;
20import java.util.*;
2122/***23 * This interface provides lookup features on the capabilities supported24 * by a client user agent.25 *26 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>27 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>28 * @version $Id: CapabilityMap.java,v 1.8 2004/02/23 02:46:39 jford Exp $29 */30publicinterfaceCapabilityMap31 {
3233/*** Handle HTML Table */34publicstaticfinalint HTML_TABLE = 0;
3536/*** Handle inline image display */37publicstaticfinalint HTML_IMAGE = 1;
3839/*** Handle form handling */40publicstaticfinalint HTML_FORM = 2;
4142/*** Handle frames */43publicstaticfinalint HTML_FRAME = 3;
4445/*** Handle client-side applet */46publicstaticfinalint HTML_JAVA = 17;
47publicstaticfinalint HTML_JAVA1_0 = 4;
48publicstaticfinalint HTML_JAVA1_1 = 5;
49publicstaticfinalint HTML_JAVA1_2 = 6;
5051/*** Handle client-side javascript */52publicstaticfinalint HTML_JSCRIPT = 18;
53publicstaticfinalint HTML_JSCRIPT1_0 = 7;
54publicstaticfinalint HTML_JSCRIPT1_1 = 8;
55publicstaticfinalint HTML_JSCRIPT1_2 = 9;
5657/*** Handle activex controls */58publicstaticfinalint HTML_ACTIVEX = 10;
5960/*** Handle CSS1 */61publicstaticfinalint HTML_CSS1 = 11;
6263/*** Handle CSS2 */64publicstaticfinalint HTML_CSS2 = 12;
6566/*** Handle CSSP */67publicstaticfinalint HTML_CSSP = 13;
6869/*** Handle XML */70publicstaticfinalint HTML_XML = 14;
7172/*** Handle XSL */73publicstaticfinalint HTML_XSL = 15;
7475/*** Handle DOM */76publicstaticfinalint HTML_DOM = 16;
7778/***79 Returns the preferred MIME type for the current user-agent80 */81publicMimeType getPreferredType();
8283/***84 Returns the preferred media type for the current user-agent85 */86public String getPreferredMediaType();
8788/***89 * Returns an ordered list of supported media-types, from most preferred90 * to least preferred91 */92public Iterator listMediaTypes();
9394/***95 Returns the user-agent string96 */97public String getAgent();
9899/***100 Checks to see if the current agent has the specified capability101 */102publicboolean hasCapability( int cap );
103104/***105 Checks to see if the current agent has the specified capability106 */107publicboolean hasCapability( String capability );
108109/***110 Get the mime types that this CapabilityMap supports.111 */112publicMimeType[] getMimeTypes();
113114/***115 Return true if this CapabilityMap supports the given MimeType116 */117publicboolean supportsMimeType( MimeType mimeType );
118119/***120 * Return true if this CapabilityMap supports the given media type121 *122 * @param media the name of a media type registered in the123 * MediaType regsitry124 *125 * @return true is the capabilities of this agent at least match those126 * required by the media type127 */128publicboolean supportsMediaType( String media );
129130/***131 Create a map -> string representation132 */133public String toString();
134135 }
136