1/*
2 * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package java.awt.peer;
27
28import java.awt.SystemTray;
29import java.awt.TrayIcon;
30
31/**
32 * The peer interface for the {@link TrayIcon}. This doesn't need to be
33 * implemented if {@link SystemTray#isSupported()} returns false.
34 */
35public interface TrayIconPeer {
36
37    /**
38     * Disposes the tray icon and releases and resources held by it.
39     *
40     * @see TrayIcon#removeNotify()
41     */
42    void dispose();
43
44    /**
45     * Sets the tool tip for the tray icon.
46     *
47     * @param tooltip the tooltip to set
48     *
49     * @see TrayIcon#setToolTip(String)
50     */
51    void setToolTip(String tooltip);
52
53    /**
54     * Updates the icon image. This is supposed to display the current icon
55     * from the TrayIcon component in the actual tray icon.
56     *
57     * @see TrayIcon#setImage(java.awt.Image)
58     * @see TrayIcon#setImageAutoSize(boolean)
59     */
60    void updateImage();
61
62    /**
63     * Displays a message at the tray icon.
64     *
65     * @param caption the message caption
66     * @param text the actual message text
67     * @param messageType the message type
68     *
69     * @see TrayIcon#displayMessage(String, String, java.awt.TrayIcon.MessageType)
70     */
71    void displayMessage(String caption, String text, String messageType);
72
73    /**
74     * Shows the popup menu of this tray icon at the specified position.
75     *
76     * @param x the X location for the popup menu
77     * @param y the Y location for the popup menu
78     */
79    void showPopupMenu(int x, int y);
80}
81