home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / Pasteboard.h < prev    next >
Text File  |  1992-02-21  |  4KB  |  112 lines

  1. /*
  2.     Pasteboard.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <objc/Object.h>
  8. #import <objc/hashtable.h>
  9. #import <machkit/NXData.h>
  10.  
  11. /* standard Pasteboard types */
  12.  
  13. extern NXAtom NXAsciiPboardType;
  14. extern NXAtom NXPostScriptPboardType;
  15. extern NXAtom NXTIFFPboardType;
  16. extern NXAtom NXRTFPboardType;
  17. extern NXAtom NXFilenamePboardType;
  18. extern NXAtom NXTabularTextPboardType;
  19. extern NXAtom NXFontPboardType;
  20. extern NXAtom NXRulerPboardType;
  21. extern NXAtom NXFileContentsPboardType;
  22. extern NXAtom NXColorPboardType;
  23.  
  24. /* historical type names - please change to new ones */
  25. #define NXAsciiPboard        NXAsciiPboardType
  26. #define NXPostScriptPboard    NXPostScriptPboardType
  27. #define NXTIFFPboard        NXTIFFPboardType
  28. #define NXRTFPboard        NXRTFPboardType
  29. #define NXFilenamePboard    NXFilenamePboardType
  30. #define NXTabularTextPboard    NXTabularTextPboardType
  31. #define NXFindInfoPboard    NXFindPboardType
  32.  
  33. /* standard Pasteboard names */
  34.  
  35. extern NXAtom NXGeneralPboard;
  36. extern NXAtom NXFontPboard;
  37. extern NXAtom NXRulerPboard;
  38. extern NXAtom NXFindPboard;
  39. extern NXAtom NXDragPboard;
  40.  
  41. /* historical names - please change to new ones */
  42. #define NXSelectionPBName    ((Object *)NXGeneralPboard)
  43. #define NXRulerPBName        ((Object *)NXRulerPboard)
  44. #define NXFontPBName        ((Object *)NXFontPboard)
  45. #define NXFindInfoPBName    ((Object *)NXFindPboard)
  46. #define NXSelectionPboard    ((Object *)NXGeneralPboard)
  47.  
  48. extern NXAtom NXCreateFilenamePboardType(const char *fileType);
  49. extern NXAtom NXCreateFileContentsPboardTyUE2onst char *fileType);
  50. extern const char *NXGetFileType(const char *pboardType);
  51. extern const char **NXGetFileTypes(const char *const *pboardTypes);
  52.  
  53. @interface Pasteboard : Object
  54. {
  55.     id                  owner;
  56.     int                 _realChangeCount;
  57.     int                 _ourChangeCount;
  58.     port_t              _server;
  59.     id                 *_ownerArray;
  60.     int            _numTypes;
  61.     NXAtom             *_typesArray;
  62.     port_t              _client;
  63.     BOOL               *_typesProvided;
  64.     NXAtom        _name;
  65.     NXAtom        _host;
  66.     int            _serverVersion;
  67.     unsigned int        _reservedPasteboard4;
  68. }
  69.  
  70. + new;
  71. + newName:(const char *)name;
  72. + newUnique;
  73.  
  74. + (NXAtom *)typesFilterableTo:(const char *)type;
  75.  
  76. + newByFilteringFile:(const char *)filename;
  77. + newByFilteringData:(NXData *)data ofType:(const char *)type;
  78. + newByFilteringTypesInPasteboard:(Pasteboard *)pboard;
  79.  
  80. + allocFromZone:(NXZone *)zone;
  81. + alloc;
  82.  
  83. - (NXAtom)name;
  84. - free;
  85. - freeGlobally;
  86.  
  87. - (int)declareTypes:(const char *const *)newTypes num:(int)numTypes owner:newOwner;
  88. - (int)addTypes:(const char *const *)newTypes num:(int)numTypes owner:newOwner;
  89. - (int)changeCount;
  90.  
  91. - writeType:(const char *)dataType data:(const char *)theData length:(int)numBytes;
  92. - writeType:(const char *)dataType fromStream:(NXStream *)stream;
  93.  
  94. - (const NXAtom *)types;
  95. - (const char *)findAvailableTypeFrom:(const char *const *)types num:(int)numTypes;
  96. - readType:(const char *)dataType data:(char **)theData length:(int *)numBytes;
  97. - (NXStream *)readTypeToStream:(const char *)dataType;
  98.     /* deallocate stream with NXCloseMemory(stream, NX_FREEBUFFER) */
  99. - deallocatePasteboardData:(char *)data length:(int)numBytes;
  100.  
  101. @end
  102.  
  103. @interface Pasteboard(FileContents)
  104. - (BOOL)writeFileContents:(const char *)filename;
  105. - (char *)readFileContentsType:(const char *)type toFile:(const char *)filename;
  106. @end
  107.  
  108. @interface Object(PasteboardOwner)
  109. - pasteboard:sender provideData:(NXAtom)type;
  110. - pasteboardChangedOwner:sender;
  111. @end
  112.