com.github.axet.desktop.os.mac
Class AppleHandlers

java.lang.Object
  extended by com.sun.jna.Pointer
      extended by com.github.axet.desktop.os.mac.cocoa.NSObject
          extended by com.github.axet.desktop.os.mac.cocoa.NSApplicationDelegate
              extended by com.github.axet.desktop.os.mac.AppleHandlers

public class AppleHandlers
extends NSApplicationDelegate


Nested Class Summary
static interface AppleHandlers.AboutHandler
           
static interface AppleHandlers.AboutMenuImp
           
static interface AppleHandlers.ApplicationOpenFileImp
           
static interface AppleHandlers.ApplicationOpenFileNoImp
           
static interface AppleHandlers.ApplicationOpenFilesImp
           
static interface AppleHandlers.ApplicationReOpen
           
static interface AppleHandlers.AppReOpenedListener
           
static interface AppleHandlers.GetURLAction
           
static interface AppleHandlers.NSApplicationTerminateReply
           
static interface AppleHandlers.OpenFileHandler
           
static class AppleHandlers.OpenFilesHandlerClassHandler
           
static interface AppleHandlers.OpenURIHandler
           
static class AppleHandlers.OpenURIHandlerHandler
           
static interface AppleHandlers.QuitHandler
           
static interface AppleHandlers.RegisterApplicationShouldTerminateAction
           
static interface AppleHandlers.SettingsHandler
           
static interface AppleHandlers.SettingsMenuImp
           
 
Field Summary
 
Fields inherited from class com.github.axet.desktop.os.mac.cocoa.NSApplicationDelegate
protocol
 
Fields inherited from class com.sun.jna.Pointer
NULL, peer, SIZE
 
Method Summary
 void addAboutListener(AppleHandlers.AboutHandler e)
           
 void addAppReOpenedListener(AppleHandlers.AppReOpenedListener e)
           
 void addOpenFileListener(AppleHandlers.OpenFileHandler e)
           
 void addOpenURIListener(AppleHandlers.OpenURIHandler e)
           
 void addQuitHandlerListener(AppleHandlers.QuitHandler q)
           
 void addSettingsListener(AppleHandlers.SettingsHandler e)
           
protected  void finalize()
           
static AppleHandlers getAppleHandlers()
           
static boolean isAvailable()
           
 void removeAboutListener(AppleHandlers.AboutHandler e)
           
 void removeAppReOpenedListener(AppleHandlers.AppReOpenedListener e)
           
 void removeOpenFileListener(AppleHandlers.OpenFileHandler e)
           
 void removeOpenURIListener(AppleHandlers.OpenURIHandler e)
           
 void removeQuitHandlerListener(AppleHandlers.QuitHandler q)
           
 void removeSettingsListener(AppleHandlers.SettingsHandler e)
           
static void setFileType(String s, String bundleId)
          Sets the user’s preferred default handler for the specified content type in the specified roles.
static void setUrlType(String s, String bundleId)
          Sets the user’s preferred default handler for the specified URL scheme.
 
Methods inherited from class com.github.axet.desktop.os.mac.cocoa.NSObject
release, retain
 
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
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

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()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class NSObject
Throws:
Throwable


Copyright © 2013. All Rights Reserved.