home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / MiscKit1.2.6 / Projects / MiscFindPanel / SearchBench / SearchableText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-21  |  1.3 KB  |  46 lines

  1. /*
  2.  *  Copyright (c) 1993 Christopher J. Kane.  All rights reserved.
  3.  *
  4.  *  This software is subject to the terms of the MiscKit license
  5.  *  agreement.  Refer to the license document included with the
  6.  *  MiscKit distribution for these terms.
  7.  *
  8.  *  Version: 1.1 (22 October 1993)
  9.  */
  10.  
  11. typedef enum
  12.   {
  13.     TextEdgeToSelStart,
  14.     TextEdgeToSelEnd,
  15.     TextEdgeToTextEdge,
  16.     SelStartToSelEnd,
  17.     SelStartToTextEdge,
  18.     SelStartToSelStart,
  19.     SelEndToTextEdge,
  20.     SelEndToSelStart,
  21.     SelEndToSelEnd
  22.   } SearchMode;
  23.  
  24. typedef enum
  25.   {
  26.     SEARCH_INVALID_OPERATION = -1,
  27.     SEARCH_INVALID_ARGUMENT = -2,
  28.     SEARCH_INVALID_REGEXPR = -3,
  29.     SEARCH_NO_SELECTION = -4,
  30.     SEARCH_CANNOT_WRITE = -5,
  31.     SEARCH_UNIMPLEMENTED = -6,
  32.     SEARCH_ABORTED = -7,
  33.     SEARCH_INTERNAL_ERROR = -8
  34.   } SearchErr;
  35.  
  36. @protocol SearchableText
  37.  
  38. - (oneway void)makeSelectionVisible;
  39. - (int)replaceAll:(const char *)pattern with:(const char *)replacement mode:(SearchMode)mode regexpr:(BOOL)regexpr cases:(BOOL)cases;
  40. - (oneway void)replaceSelection:(const char *)replacement;
  41. - (int)searchFor:(const char *)pattern mode:(SearchMode)mode reverse:(BOOL)rev regexpr:(BOOL)regexpr cases:(BOOL)cases position:(out int *)pos size:(out int *)size;
  42. - (oneway void)selectTextFrom:(int)start to:(int)end;
  43. - (void)writeSelectionToPasteboard:(in Pasteboard *)pboard asType:(in NXAtom)type;
  44.  
  45. @end
  46.