package org.simplericity.macify.eawt; /* * Copyright 2007 Eirik Bjorsnos. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.awt.*; import java.awt.image.BufferedImage; /** * The Macify Library API interface provides integration with the OS X platform for Java Applications. * The API includes a facade to the * * Apple Java Extensions API * . * Additionally, it provides access to several useful methods in the Cocoa NSApplication API. * * The default implementation of this interface is {@link org.simplericity.macify.eawt.DefaultApplication}. */ public interface Application { static int REQUEST_USER_ATTENTION_TYPE_CRITICAL = 1 ; static int REQUEST_USER_ATTENTION_TYPE_INFORMATIONAL = 2 ; /** * See * * Apple's API * . */ void addAboutMenuItem(); /** * See * * Apple's API * . */ void addApplicationListener(ApplicationListener applicationListener); /** * See * * Apple's API * . */ void addPreferencesMenuItem(); /** * See * * Apple's API * . */ boolean getEnabledAboutMenu(); /** * See * * Apple's API * . */ boolean getEnabledPreferencesMenu(); /** * See * * Apple's API * . */ boolean isAboutMenuItemPresent(); /** * See * * Apple's API * . */ boolean isPreferencesMenuItemPresent(); /** * See * * Apple's API * . */ void removeAboutMenuItem(); /** * See * * Apple's API * . */ void removeApplicationListener(ApplicationListener applicationListener); /** * See * * Apple's API * . */ void removePreferencesMenuItem(); /** * See * * Apple's API * . */ void setEnabledAboutMenu(boolean enabled); /** * See * * Apple's API * . */ void setEnabledPreferencesMenu(boolean enabled); /** * See * * Apple's API * . */ Point getMouseLocationOnScreen(); /** * See * * Apple's NSApplication Class Reference * . * @param type on of {@link #REQUEST_USER_ATTENTION_TYPE_CRITICAL} or {@link #REQUEST_USER_ATTENTION_TYPE_INFORMATIONAL}. */ int requestUserAttention(int type); /** * See * * Apple's NSApplication Class Reference * */ void cancelUserAttentionRequest(int request); /** * Update the application's icon image * @param image */ void setApplicationIconImage(BufferedImage image); /** * Get the application's icon image. */ BufferedImage getApplicationIconImage(); /** * Determines whether the application is running on a Mac AND the Apple Extensions API classes are available. * @return */ boolean isMac(); }