0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.awt.peer;
0N/A
0N/A
0N/Aimport java.io.File;
0N/Aimport java.io.IOException;
0N/Aimport java.net.URI;
0N/Aimport java.awt.Desktop.Action;
0N/A
0N/A/**
883N/A * The {@code DesktopPeer} interface provides methods for the operation
0N/A * of open, edit, print, browse and mail with the given URL or file, by
0N/A * launching the associated application.
0N/A * <p>
0N/A * Each platform has an implementation class for this interface.
0N/A *
0N/A */
0N/Apublic interface DesktopPeer {
883N/A
0N/A /**
0N/A * Returns whether the given action is supported on the current platform.
0N/A * @param action the action type to be tested if it's supported on the
0N/A * current platform.
883N/A * @return {@code true} if the given action is supported on
883N/A * the current platform; {@code false} otherwise.
0N/A */
883N/A boolean isSupported(Action action);
0N/A
0N/A /**
0N/A * Launches the associated application to open the given file. The
0N/A * associated application is registered to be the default file viewer for
0N/A * the file type of the given file.
0N/A *
0N/A * @param file the given file.
0N/A * @throws IOException If the given file has no associated application,
0N/A * or the associated application fails to be launched.
0N/A */
883N/A void open(File file) throws IOException;
0N/A
0N/A /**
0N/A * Launches the associated editor and opens the given file for editing. The
0N/A * associated editor is registered to be the default editor for the file
0N/A * type of the given file.
0N/A *
0N/A * @param file the given file.
0N/A * @throws IOException If the given file has no associated editor, or
0N/A * the associated application fails to be launched.
0N/A */
883N/A void edit(File file) throws IOException;
0N/A
0N/A /**
0N/A * Prints the given file with the native desktop printing facility, using
0N/A * the associated application's print command.
0N/A *
0N/A * @param file the given file.
0N/A * @throws IOException If the given file has no associated application
0N/A * that can be used to print it.
0N/A */
883N/A void print(File file) throws IOException;
0N/A
0N/A /**
0N/A * Launches the mail composing window of the user default mail client,
0N/A * filling the message fields including to, cc, etc, with the values
0N/A * specified by the given mailto URL.
0N/A *
0N/A * @param uri represents a mailto URL with specified values of the message.
0N/A * The syntax of mailto URL is defined by
0N/A * <a href="http://www.ietf.org/rfc/rfc2368.txt">RFC2368: The mailto
0N/A * URL scheme</a>
0N/A * @throws IOException If the user default mail client is not found,
0N/A * or it fails to be launched.
0N/A */
883N/A void mail(URI mailtoURL) throws IOException;
0N/A
0N/A /**
0N/A * Launches the user default browser to display the given URI.
0N/A *
0N/A * @param uri the given URI.
0N/A * @throws IOException If the user default browser is not found,
0N/A * or it fails to be launched.
0N/A */
883N/A void browse(URI url) throws IOException;
0N/A}