Package com.github.axet.desktop.os.mac
Class AppleHandlers
- java.lang.Object
-
- com.sun.jna.Pointer
-
- com.github.axet.desktop.os.mac.cocoa.NSObject
-
- com.github.axet.desktop.os.mac.cocoa.NSApplicationDelegate
-
- com.github.axet.desktop.os.mac.AppleHandlers
-
public class AppleHandlers extends NSApplicationDelegate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAppleHandlers.AboutHandlerstatic interfaceAppleHandlers.AboutMenuImpstatic interfaceAppleHandlers.ApplicationOpenFileImpstatic interfaceAppleHandlers.ApplicationOpenFileNoImpstatic interfaceAppleHandlers.ApplicationOpenFilesImpstatic interfaceAppleHandlers.ApplicationReOpenstatic interfaceAppleHandlers.AppReOpenedListenerstatic interfaceAppleHandlers.GetURLActionstatic interfaceAppleHandlers.NSApplicationTerminateReplystatic interfaceAppleHandlers.OpenFileHandlerstatic classAppleHandlers.OpenFilesHandlerClassHandlerstatic interfaceAppleHandlers.OpenURIHandlerstatic classAppleHandlers.OpenURIHandlerHandlerstatic interfaceAppleHandlers.QuitHandlerstatic interfaceAppleHandlers.RegisterApplicationShouldTerminateActionstatic interfaceAppleHandlers.SettingsHandlerstatic interfaceAppleHandlers.SettingsMenuImp
-
Field Summary
-
Fields inherited from class com.github.axet.desktop.os.mac.cocoa.NSApplicationDelegate
protocol
-
-
Method Summary
-
Methods inherited from class com.sun.jna.Pointer
clear, createConstant, createConstant, equals, getByte, getByteArray, getByteBuffer, getChar, getCharArray, getDouble, getDoubleArray, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getNativeLong, getPointer, getPointerArray, getPointerArray, getShort, getShortArray, getString, getString, getStringArray, getStringArray, getStringArray, getStringArray, hashCode, indexOf, nativeValue, nativeValue, read, read, read, read, read, read, read, read, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemory, setNativeLong, setPointer, setShort, setString, setString, share, share, toString, write, write, write, write, write, write, write, write
-
-
-
-
Method Detail
-
setUrlType
public static void setUrlType(String s, String bundleId)
Sets the user’s preferred default handler for the specified URL scheme. URL handling capability is determined according to the value of the CFBundleURLTypes key in an application’s Info.plist. For information on the CFBundleURLTypes key, see the section “CFBundleURLTypes” in OS X Runtime Configuration Guidelines. Browser will open your app, when uses clicks on the web page url (magnet url for example).- Parameters:
s- - URL scheme, ex: "magnet" for "magnet://some_magnet_link"bundleId- - bundle id
-
setFileType
public static void setFileType(String s, String bundleId)
Sets the user’s preferred default handler for the specified content type in the specified roles. Call LSCopyDefaultRoleHandlerForContentType to get the current setting of the user’s preferred default handler for a specified content type. It helps browser to show proper download dialog which asks user which App to use to open this file you are downloading.- Parameters:
s- contenet handler. ex: "org.bittorrent.torrent", "torrent"bundleId- - bundle ID
-
isAvailable
public static boolean isAvailable()
-
addOpenFileListener
public void addOpenFileListener(AppleHandlers.OpenFileHandler e)
-
removeOpenFileListener
public void removeOpenFileListener(AppleHandlers.OpenFileHandler e)
-
addQuitHandlerListener
public void addQuitHandlerListener(AppleHandlers.QuitHandler q)
-
removeQuitHandlerListener
public void removeQuitHandlerListener(AppleHandlers.QuitHandler q)
-
addOpenURIListener
public void addOpenURIListener(AppleHandlers.OpenURIHandler e)
-
removeOpenURIListener
public void removeOpenURIListener(AppleHandlers.OpenURIHandler e)
-
addAppReOpenedListener
public void addAppReOpenedListener(AppleHandlers.AppReOpenedListener e)
-
removeAppReOpenedListener
public void removeAppReOpenedListener(AppleHandlers.AppReOpenedListener e)
-
addAboutListener
public void addAboutListener(AppleHandlers.AboutHandler e)
-
removeAboutListener
public void removeAboutListener(AppleHandlers.AboutHandler e)
-
addSettingsListener
public void addSettingsListener(AppleHandlers.SettingsHandler e)
-
removeSettingsListener
public void removeSettingsListener(AppleHandlers.SettingsHandler e)
-
getAppleHandlers
public static AppleHandlers getAppleHandlers()
-
-