NSWorkspace.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. { Parsed from AppKit.framework NSWorkspace.h }
  2. {$ifdef TYPES}
  3. type
  4. NSWorkspacePtr = ^NSWorkspace;
  5. {$endif}
  6. {$ifdef TYPES}
  7. type
  8. NSWorkspaceLaunchOptions = NSUInteger;
  9. NSWorkspaceLaunchOptionsPtr = ^NSWorkspaceLaunchOptions;
  10. const
  11. NSWorkspaceLaunchAndPrint = $00000002;
  12. NSWorkspaceLaunchWithErrorPresentation = $00000040;
  13. NSWorkspaceLaunchInhibitingBackgroundOnly = $00000080;
  14. NSWorkspaceLaunchWithoutAddingToRecents = $00000100;
  15. NSWorkspaceLaunchWithoutActivation = $00000200;
  16. NSWorkspaceLaunchAsync = $00010000;
  17. NSWorkspaceLaunchAllowingClassicStartup = $00020000;
  18. NSWorkspaceLaunchPreferringClassic = $00040000;
  19. NSWorkspaceLaunchNewInstance = $00080000;
  20. NSWorkspaceLaunchAndHide = $00100000;
  21. NSWorkspaceLaunchAndHideOthers = $00200000;
  22. NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync + NSWorkspaceLaunchAllowingClassicStartup;
  23. type
  24. NSWorkspaceIconCreationOptions = NSUInteger;
  25. NSWorkspaceIconCreationOptionsPtr = ^NSWorkspaceIconCreationOptions;
  26. const
  27. NSExcludeQuickDrawElementsIconCreationOption = 1 shl 1;
  28. NSExclude10_4ElementsIconCreationOption = 1 shl 2;
  29. {$endif}
  30. {$ifdef CLASSES}
  31. type
  32. NSWorkspace = objcclass external (NSObject)
  33. private
  34. _notificationCenter: NSNotificationCenter;
  35. {$if not defined(__LP64__)}
  36. deviceStatusCount: cint;
  37. applicationStatusCount: cint;
  38. _reservedWorkspace1: id;
  39. {$endif}
  40. public
  41. class function sharedWorkspace: NSWorkspace; message 'sharedWorkspace';
  42. function notificationCenter: NSNotificationCenter; message 'notificationCenter';
  43. function openFile (fullPath: NSString): ObjCBOOL; message 'openFile:';
  44. function openFile_withApplication (fullPath: NSString; appName: NSString): ObjCBOOL; message 'openFile:withApplication:';
  45. function openFile_withApplication_andDeactivate (fullPath: NSString; appName: NSString; flag: ObjCBOOL): ObjCBOOL; message 'openFile:withApplication:andDeactivate:';
  46. function openFile_fromImage_at_inView (fullPath: NSString; anImage: NSImage; point: NSPoint; aView: NSView): ObjCBOOL; message 'openFile:fromImage:at:inView:';
  47. function openURL (url: NSURL): ObjCBOOL; message 'openURL:';
  48. function launchApplication (appName: NSString): ObjCBOOL; message 'launchApplication:';
  49. function launchApplicationAtURL_options_configuration_error (url: NSURL; options: NSWorkspaceLaunchOptions; configuration: NSDictionary; error: NSErrorPtr): NSRunningApplication; message 'launchApplicationAtURL:options:configuration:error:'; { available in 10_6 }
  50. function openURL_options_configuration_error (url: NSURL; options: NSWorkspaceLaunchOptions; configuration: NSDictionary; error: NSErrorPtr): NSRunningApplication; message 'openURL:options:configuration:error:'; { available in 10_10 }
  51. function openURLs_withApplicationAtURL_options_configuration_error (urls: NSArray; applicationURL: NSURL; options: NSWorkspaceLaunchOptions; configuration: NSDictionary; error: NSErrorPtr): NSRunningApplication; message 'openURLs:withApplicationAtURL:options:configuration:error:'; { available in 10_10 }
  52. function launchApplication_showIcon_autolaunch (appName: NSString; showIcon: ObjCBOOL; autolaunch: ObjCBOOL): ObjCBOOL; message 'launchApplication:showIcon:autolaunch:';
  53. function fullPathForApplication (appName: NSString): NSString; message 'fullPathForApplication:';
  54. function selectFile_inFileViewerRootedAtPath (fullPath: NSString; rootFullPath: NSString): ObjCBOOL; message 'selectFile:inFileViewerRootedAtPath:';
  55. procedure activateFileViewerSelectingURLs (fileURLs: NSArray); message 'activateFileViewerSelectingURLs:'; { available in 10_6 }
  56. function showSearchResultsForQueryString (queryString: NSString): ObjCBOOL; message 'showSearchResultsForQueryString:'; { available in 10_6 }
  57. procedure noteFileSystemChanged (path: NSString); message 'noteFileSystemChanged:';
  58. function getInfoForFile_application_type (fullPath: NSString; appName: NSStringPtr; type_: NSStringPtr): ObjCBOOL; message 'getInfoForFile:application:type:';
  59. function isFilePackageAtPath (fullPath: NSString): ObjCBOOL; message 'isFilePackageAtPath:';
  60. function iconForFile (fullPath: NSString): NSImage; message 'iconForFile:';
  61. function iconForFiles (fullPaths: NSArray): NSImage; message 'iconForFiles:';
  62. function iconForFileType (fileType: NSString): NSImage; message 'iconForFileType:';
  63. function setIcon_forFile_options (image: NSImage; fullPath: NSString; options: NSWorkspaceIconCreationOptions): ObjCBOOL; message 'setIcon:forFile:options:';
  64. function fileLabels: NSArray; message 'fileLabels';
  65. function fileLabelColors: NSArray; message 'fileLabelColors';
  66. procedure recycleURLs_completionHandler (URLs: NSArray; handler: OpaqueCBlock); message 'recycleURLs:completionHandler:'; { available in 10_6 }
  67. procedure duplicateURLs_completionHandler (URLs: NSArray; handler: OpaqueCBlock); message 'duplicateURLs:completionHandler:'; { available in 10_6 }
  68. function getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type (fullPath: NSString; removableFlag: pObjCBOOL; writableFlag: pObjCBOOL; unmountableFlag: pObjCBOOL; description: NSStringPtr; fileSystemType: NSStringPtr): ObjCBOOL; message 'getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:';
  69. function performFileOperation_source_destination_files_tag (operation: NSString; source: NSString; destination: NSString; files: NSArray; tag: NSIntegerPtr): ObjCBOOL; message 'performFileOperation:source:destination:files:tag:';
  70. function unmountAndEjectDeviceAtPath (path: NSString): ObjCBOOL; message 'unmountAndEjectDeviceAtPath:';
  71. function unmountAndEjectDeviceAtURL_error (url: NSURL; error: NSErrorPtr): ObjCBOOL; message 'unmountAndEjectDeviceAtURL:error:'; { available in 10_6 }
  72. function extendPowerOffBy (requested: NSInteger): NSInteger; message 'extendPowerOffBy:';
  73. procedure hideOtherApplications; message 'hideOtherApplications';
  74. function URLForApplicationWithBundleIdentifier (bundleIdentifier: NSString): NSURL; message 'URLForApplicationWithBundleIdentifier:'; { available in 10_6 }
  75. function URLForApplicationToOpenURL (url: NSURL): NSURL; message 'URLForApplicationToOpenURL:'; { available in 10_6 }
  76. function absolutePathForAppBundleWithIdentifier (bundleIdentifier: NSString): NSString; message 'absolutePathForAppBundleWithIdentifier:';
  77. function launchAppWithBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifier (bundleIdentifier: NSString; options: NSWorkspaceLaunchOptions; descriptor: NSAppleEventDescriptor; identifier: NSNumberPtr): ObjCBOOL; message 'launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:';
  78. function openURLs_withAppBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifiers (urls: NSArray; bundleIdentifier: NSString; options: NSWorkspaceLaunchOptions; descriptor: NSAppleEventDescriptor; identifiers: NSArrayPtr): ObjCBOOL; message 'openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:';
  79. function frontmostApplication: NSRunningApplication; message 'frontmostApplication';
  80. function menuBarOwningApplication: NSRunningApplication; message 'menuBarOwningApplication';
  81. function typeOfFile_error (absoluteFilePath: NSString; outError: NSErrorPtr): NSString; message 'typeOfFile:error:'; { available in 10_5 }
  82. function localizedDescriptionForType (typeName: NSString): NSString; message 'localizedDescriptionForType:'; { available in 10_5 }
  83. function preferredFilenameExtensionForType (typeName: NSString): NSString; message 'preferredFilenameExtensionForType:'; { available in 10_5 }
  84. function filenameExtension_isValidForType (filenameExtension: NSString; typeName: NSString): ObjCBOOL; message 'filenameExtension:isValidForType:'; { available in 10_5 }
  85. function type_conformsToType (firstTypeName: NSString; secondTypeName: NSString): ObjCBOOL; message 'type:conformsToType:'; { available in 10_5 }
  86. end;
  87. type
  88. NSDesktopImages = objccategory external (NSWorkspace)
  89. function setDesktopImageURL_forScreen_options_error (url: NSURL; screen: NSScreen; options: NSDictionary; error: NSErrorPtr): ObjCBOOL; message 'setDesktopImageURL:forScreen:options:error:'; { available in 10_6 }
  90. function desktopImageURLForScreen (screen: NSScreen): NSURL; message 'desktopImageURLForScreen:'; { available in 10_6 }
  91. function desktopImageOptionsForScreen (screen: NSScreen): NSDictionary; message 'desktopImageOptionsForScreen:'; { available in 10_6 }
  92. end;
  93. {$endif}
  94. {$ifdef EXTERNAL_SYMBOLS}
  95. var
  96. NSWorkspaceDesktopImageScalingKey: NSString { available in 10_6 }; cvar; external;
  97. NSWorkspaceDesktopImageAllowClippingKey: NSString { available in 10_6 }; cvar; external;
  98. NSWorkspaceDesktopImageFillColorKey: NSString { available in 10_6 }; cvar; external;
  99. NSWorkspaceApplicationKey: NSString { available in 10_6 }; cvar; external;
  100. NSWorkspaceWillLaunchApplicationNotification: NSString; cvar; external;
  101. NSWorkspaceDidLaunchApplicationNotification: NSString; cvar; external;
  102. NSWorkspaceDidTerminateApplicationNotification: NSString; cvar; external;
  103. NSWorkspaceDidHideApplicationNotification: NSString { available in 10_6 }; cvar; external;
  104. NSWorkspaceDidUnhideApplicationNotification: NSString { available in 10_6 }; cvar; external;
  105. NSWorkspaceDidActivateApplicationNotification: NSString { available in 10_6 }; cvar; external;
  106. NSWorkspaceDidDeactivateApplicationNotification: NSString { available in 10_6 }; cvar; external;
  107. NSWorkspaceVolumeLocalizedNameKey: NSString { available in 10_6 }; cvar; external;
  108. NSWorkspaceVolumeURLKey: NSString { available in 10_6 }; cvar; external;
  109. NSWorkspaceVolumeOldLocalizedNameKey: NSString { available in 10_6 }; cvar; external;
  110. NSWorkspaceVolumeOldURLKey: NSString { available in 10_6 }; cvar; external;
  111. NSWorkspaceDidMountNotification: NSString; cvar; external;
  112. NSWorkspaceDidUnmountNotification: NSString; cvar; external;
  113. NSWorkspaceWillUnmountNotification: NSString; cvar; external;
  114. NSWorkspaceDidRenameVolumeNotification: NSString { available in 10_6 }; cvar; external;
  115. NSWorkspaceWillPowerOffNotification: NSString; cvar; external;
  116. NSWorkspaceWillSleepNotification: NSString; cvar; external;
  117. NSWorkspaceDidWakeNotification: NSString; cvar; external;
  118. NSWorkspaceScreensDidSleepNotification: NSString { available in 10_6 }; cvar; external;
  119. NSWorkspaceScreensDidWakeNotification: NSString { available in 10_6 }; cvar; external;
  120. NSWorkspaceSessionDidBecomeActiveNotification: NSString; cvar; external;
  121. NSWorkspaceSessionDidResignActiveNotification: NSString; cvar; external;
  122. NSWorkspaceDidPerformFileOperationNotification: NSString; cvar; external;
  123. NSWorkspaceDidChangeFileLabelsNotification: NSString { available in 10_6 }; cvar; external;
  124. NSWorkspaceActiveSpaceDidChangeNotification: NSString { available in 10_6 }; cvar; external;
  125. NSWorkspaceLaunchConfigurationAppleEvent: NSString { available in 10_6 }; cvar; external;
  126. NSWorkspaceLaunchConfigurationArguments: NSString { available in 10_6 }; cvar; external;
  127. NSWorkspaceLaunchConfigurationEnvironment: NSString { available in 10_6 }; cvar; external;
  128. NSWorkspaceLaunchConfigurationArchitecture: NSString { available in 10_6 }; cvar; external;
  129. NSWorkspaceMoveOperation: NSString; cvar; external;
  130. NSWorkspaceCopyOperation: NSString; cvar; external;
  131. NSWorkspaceLinkOperation: NSString; cvar; external;
  132. NSWorkspaceCompressOperation: NSString; cvar; external;
  133. NSWorkspaceDecompressOperation: NSString; cvar; external;
  134. NSWorkspaceEncryptOperation: NSString; cvar; external;
  135. NSWorkspaceDecryptOperation: NSString; cvar; external;
  136. NSWorkspaceDestroyOperation: NSString; cvar; external;
  137. NSWorkspaceRecycleOperation: NSString; cvar; external;
  138. NSWorkspaceDuplicateOperation: NSString; cvar; external;
  139. {$endif}
  140. {$ifdef CLASSES}
  141. type
  142. NSWorkspace_NSDeprecated = objccategory external name 'NSDeprecated' (NSWorkspace)
  143. function openTempFile (fullPath: NSString): ObjCBOOL; message 'openTempFile:'; deprecated 'in 10_0, 10_6';
  144. procedure findApplications; message 'findApplications'; deprecated 'in 10_0, 10_6';
  145. procedure noteUserDefaultsChanged; message 'noteUserDefaultsChanged'; deprecated 'in 10_0, 10_6';
  146. procedure slideImage_from_to (image: NSImage; fromPoint: NSPoint; toPoint: NSPoint); message 'slideImage:from:to:'; deprecated 'in 10_0, 10_6';
  147. procedure checkForRemovableMedia; message 'checkForRemovableMedia'; deprecated 'in 10_0, 10_6';
  148. procedure noteFileSystemChanged_; message 'noteFileSystemChanged'; deprecated 'in 10_0, 10_6';
  149. function fileSystemChanged: ObjCBOOL; message 'fileSystemChanged'; deprecated 'in 10_0, 10_6';
  150. function userDefaultsChanged: ObjCBOOL; message 'userDefaultsChanged'; deprecated 'in 10_0, 10_6';
  151. function mountNewRemovableMedia: NSArray; message 'mountNewRemovableMedia'; deprecated 'in 10_0, 10_6';
  152. function activeApplication: NSDictionary; message 'activeApplication';
  153. function mountedLocalVolumePaths: NSArray; message 'mountedLocalVolumePaths';
  154. function mountedRemovableMedia: NSArray; message 'mountedRemovableMedia';
  155. function launchedApplications: NSArray; message 'launchedApplications'; deprecated 'in 10_0, 10_7';
  156. end;
  157. {$endif}
  158. {$ifdef EXTERNAL_SYMBOLS}
  159. var
  160. NSPlainFileType: NSString deprecated 'in 10_0, 10_6'; cvar; external;
  161. NSDirectoryFileType: NSString deprecated 'in 10_0, 10_6'; cvar; external;
  162. NSApplicationFileType: NSString deprecated 'in 10_0, 10_6'; cvar; external;
  163. NSFilesystemFileType: NSString deprecated 'in 10_0, 10_6'; cvar; external;
  164. NSShellCommandFileType: NSString deprecated 'in 10_0, 10_6'; cvar; external;
  165. {$endif}