home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSInputManager.h < prev    next >
Text File  |  1996-10-16  |  3KB  |  66 lines

  1. /*
  2.     NSInputManager.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6.  */
  7.  
  8. #ifndef STRICT_OPENSTEP
  9.  
  10. #import <Foundation/NSObject.h>
  11. #import <Foundation/NSString.h>
  12. #import <AppKit/NSEvent.h>
  13.  
  14. @protocol NSTextInput
  15.  
  16. - (void) insertText:(NSString *)aString; // instead of keyDown:
  17. - (void) doCommandBySelector:(SEL)aSelector;
  18.     // setMarkedText: cannot take nil
  19. - (void) setMarkedText:(NSString *)aString selectedRange:(NSRange)selRange;
  20.     // getMarkedText: will never return nil
  21. - (void) getMarkedText:(out NSString **)aString selectedRange:(out NSRange *)aRange;
  22. - (void) unmarkText;
  23. - (BOOL) hasMarkedText;
  24. - (long) conversationIdentifier;
  25.  
  26. @end
  27.  
  28. @interface NSInputManager : NSObject <NSTextInput> {
  29. @private
  30.     id _lastClient;
  31.     id _server;            // an NSInputServer obj, usually
  32.     id _bundleObj;        // principal obj instance of bundle, if any
  33.     id _keybindings;        // optional extra bindings, if any
  34.     NSString *_trueName;    // name passed to "init"
  35.     NSString *_connectionName;    // the connection banner
  36.     NSString *_hostName;    // host to run on or nil if own host
  37.     NSString *_procToExec;    // process path, if any
  38.     NSString *_visibleName;    // localized user-visible name
  39.     NSString *_bundleName;    // path to bundle, if any
  40.     unsigned int _flags;
  41.     NSString *_keyBindingsName;    // path to the default bindings, if any
  42.     int _reservedInputManager2;
  43. }
  44.  
  45. /* The "current input manager" is the one that is receiving input events at the time this method is called.  It may change out from under you, so don't cache the return value.
  46. */
  47. + (NSInputManager *) currentInputManager;
  48.  
  49. - (NSInputManager *) initWithName:(NSString *)inputServerName host:(NSString *)hostName;
  50.  
  51. - (NSString *) localizedInputManagerName;
  52.  
  53. /* These messages are sent by Views that conform to the NSTextInput protocol TO the Current Input Manager when things happen via user or programmatic action.  E.g., when the mouse moves outside the marked range, send markedTextWillBeAbandoned:.  If the user selects some new text or moves the mouse within the marked region, send markedTextSelectionChanged:.  Not all input manager/server combinations will allow all changes, but abandoning of the marked region cannot be aborted.
  54. */ 
  55.  
  56. - (void) markedTextWillBeAbandoned:(id)cli; /* send before abandoning */
  57. - (void) markedTextSelectionChanged:(NSRange)newSel client:(id)cli; /* send after changing */
  58.  
  59. /* This corresponds to a server method for input managers that demand to do their own interepretation of command keys as long as they're active.  This will typically be called by a key binder to find out whether it shouldn't just pass along strings.
  60. */
  61. - (BOOL) wantsToInterpretAllKeystrokes;
  62.  
  63. @end
  64.  
  65. #endif
  66.