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

  1. /*
  2.     NSDataLink.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 <AppKit/AppKitDefines.h>
  12.  
  13. @class NSDataLinkManager;
  14. @class NSPasteboard;
  15. @class NSSelection;
  16. @class NSArray;
  17. @class NSDate;
  18.  
  19. typedef enum _NSDataLinkUpdateMode {
  20.     NSUpdateContinuously = 1,
  21.     NSUpdateWhenSourceSaved = 2,
  22.     NSUpdateManually = 3,
  23.     NSUpdateNever = 4
  24. } NSDataLinkUpdateMode;
  25.  
  26. typedef enum _NSDataLinkDisposition {
  27.     NSLinkInDestination = 1,
  28.     NSLinkInSource = 2,
  29.     NSLinkBroken = 3
  30. } NSDataLinkDisposition;
  31.  
  32. APPKIT_EXTERN NSString *NSDataLinkPboardType;
  33.  
  34. /* A persistent identifier of links on the destination side. Never 0. */
  35. typedef int NSDataLinkNumber;
  36.  
  37. /* filename suffix used for saved links */
  38. APPKIT_EXTERN NSString *NSDataLinkFilenameExtension;
  39.  
  40. @interface NSDataLink : NSObject <NSCopying, NSCoding>
  41. {
  42.   @private
  43.     NSSelection *srcSelection;
  44.     id srcFile;
  45.     NSString *srcAppName;
  46.     id srcMgr;
  47.     NSSelection *destSelection;
  48.     NSString *destFileName;
  49.     NSString *destAppName;
  50.     id destMgr;
  51.     long lastUpdateTime;
  52.     NSDataLinkNumber linkNum;
  53.     struct _dlFlags {
  54.     unsigned int dirty:1;
  55.     unsigned int memorable:1;
  56.     unsigned int mode:2;
  57.     unsigned int canUpdateContinuously:1;
  58.     unsigned int updateMode:4;
  59.     unsigned int appVerifiesLinks:1;
  60.     unsigned int willOpenSource:1;
  61.     unsigned int willUpdate:1;
  62.     unsigned int dead:1;
  63.     unsigned int cyclical:1;
  64.     unsigned int reserved:18;
  65.     } dlFlags;
  66.     NSArray *types;
  67.     unsigned int _reservedDataLink1;
  68. }
  69.  
  70. - (id)initLinkedToSourceSelection:(NSSelection *)selection managedBy:(NSDataLinkManager *)linkManager supportingTypes:(NSArray *)newTypes;
  71. - (id)initLinkedToFile:(NSString *)filename;
  72. - (id)initWithPasteboard:(NSPasteboard *)pasteboard;
  73. - (id)initWithContentsOfFile:(NSString *)filename;
  74.  
  75. - (void)writeToPasteboard:(NSPasteboard *)pasteboard;
  76. - (BOOL)writeToFile:(NSString *)filename;
  77.  
  78. - (BOOL)saveLinkIn:(NSString *)directoryName;
  79.  
  80. - (NSArray *)types;
  81. - (NSSelection *)sourceSelection;
  82. - (NSSelection *)destinationSelection;
  83. - (NSString *)sourceFilename;
  84. - (NSString *)currentSourceFilename;
  85. - (NSString *)destinationFilename;
  86. - (NSString *)sourceApplicationName;
  87. - (NSString *)destinationApplicationName;
  88. - (NSDataLinkManager *)manager;
  89. - (NSDate *)lastUpdateTime;
  90. - (NSDataLinkNumber)linkNumber;
  91. - (NSDataLinkDisposition)disposition;
  92.  
  93. - (BOOL)updateDestination;
  94. - (BOOL)openSource;
  95. - (BOOL)break;
  96. - (void)setUpdateMode:(NSDataLinkUpdateMode)mode;
  97. - (NSDataLinkUpdateMode)updateMode;
  98. - (void)noteSourceEdited;
  99.  
  100. @end
  101.  
  102. #endif STRICT_OPENSTEP
  103.