Mac Developer Library

Developer

InputMethodKit Framework Reference IMKServer Class Reference

Options
Deployment Target:

On This Page
Language:

IMKServer

Inheritance


Conforms To


Import Statement


Swift

import InputMethodKit

Objective-C

@import InputMethodKit;

Availability


Available in OS X v10.5 and later.

The IMKServer class manages client connections to your input method. When you write the main function for your input method, you create an IMKServer object. You should never need to override this class.

  • Creates and returns a server object from property list information contained in the provided bundle.

    Declaration

    Swift

    init!(name name: String!, bundleIdentifier bundleIdentifier: String!)

    Objective-C

    - (id)initWithName:(NSString *)name bundleIdentifier:(NSString *)bundleIdentifier

    Parameters

    name

    The name to initialize the server object with.

    bundleIdentifier

    The bundle identifier.

    Return Value

    An initialized server object.

    Discussion

    This method examines the Info.plist file for the entries shown in Table 1. The class names are loaded, but no classes are instantiated. Additionally, an NSConnection object is allocated and registered using the input method connection name supplied in the Info.plist file.

    Table 1Required entries in the Info.plist file

    Key

    Value

    LSBackgroundOnly

    The associated value is 1, because input methods are background-only applications.

    InputMethodConnectionName

    A string that specifies an input method connection name that names the connection through which your input method services are published. The Input Method Kit uses this name to create an NSConnection object through which clients deliver text input.

    InputMethodServerControllerClass

    An input controller class.

    tsInputMethodIconFileKey

    An icon file name. The icon is used to display your input method in the International pane of System Preferences.

    tsInputMethodCharacterRepertoireKey

    An array of one or more ISO language codes that specify the character repertoire of your input method. The codes help categorize your input method to the user.

    Import Statement

    Objective-C

    @import InputMethodKit;

    Swift

    import InputMethodKit

    Availability

    Available in OS X v10.5 and later.

  • Creates and returns a server object initialized with the provided parameters.

    Declaration

    Swift

    init!(name name: String!, controllerClass controllerClassID: AnyClass!, delegateClass delegateClassID: AnyClass!)

    Objective-C

    - (id)initWithName:(NSString *)name controllerClass:(Class)controllerClassID delegateClass:(Class)delegateClassID

    Parameters

    name

    The name to initialize the server object with.

    controllerClassID

    The id for the input controller class.

    delegateClassID

    The id for the delegate class.

    Return Value

    An initialized server object.

    Import Statement

    Objective-C

    @import InputMethodKit;

    Swift

    import InputMethodKit

    Availability

    Available in OS X v10.5 and later.

  • Returns an NSBundle object for the input method.

    Declaration

    Swift

    func bundle() -> NSBundle!

    Objective-C

    - (NSBundle *)bundle

    Return Value

    An NSBundle object that is either created from the bundle identifier contained in the server object, or from the main bundle.

    Import Statement

    Objective-C

    @import InputMethodKit;

    Swift

    import InputMethodKit

    Availability

    Available in OS X v10.5 and later.

  • The input method mode dictionary key.

    Declaration

    Swift

    let IMKModeDictionary: String

    Objective-C

    extern const *NSString IMKModeDictionary;

    Constants

    • IMKModeDictionary

      IMKModeDictionary

      The key used to obtain an input method mode dictionary from the input method bundle.

      Available in OS X v10.5 and later.

    Discussion

    For details on the contents of the input mode dictionary, see Technical Note TN2128 Frequently Asked Text Services Manager (TSM) Questions located in Technical Notes > Carbon > Events & Other Input.

  • The input method controller class key.

    Declaration

    Swift

    let IMKControllerClass: String

    Objective-C

    extern const *NSString IMKControllerClass;

    Constants

    • IMKControllerClass

      IMKControllerClass

      The key used to find an input method input controller class name from the input method bundle.

      Available in OS X v10.5 and later.

  • The input method delegate class key.

    Declaration

    Swift

    let IMKDelegateClass: String

    Objective-C

    extern const *NSString IMKDelegateClass;

    Constants

    • IMKDelegateClass

      IMKDelegateClass

      The key used to find an input method delegate class name from the input method bundle.

      Available in OS X v10.5 and later.