(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSWorkspace

Inherits From:	NSObject 

Declared In:	appkit/NSWorkspace.h

Creating a Workspace

+ (NSWorkspace *)sharedWorkspace	Returns a shared workspace.

Notification Center

- (NSNotificationCenter *)notificationCenter	Returns the notification center for WorkSpace notifications.

Opening Files

- (BOOL)openFile:(NSString *)fullPath	Instructs Workspace Manager to open the file specified by fullPath using the default application for its type; returns success of open.
- (BOOL)openFile:(NSString *)fullPath	Instructs Workspace Manager to open the file specified by
fromImage:(NSImage *)anImage		fullPath using the default application for its type
at:(NSPoint *)point		displaying the anImage icon at point specified in
inView:(NSView *)aView		aView's coordinates; returns success of open.
- (BOOL)openFile:(NSString *)fullPath	Instructs Workspace Manager to open the file specified by
withApplication:(NSString *)appName		fullPath using the appName application; returns success of open.
- (BOOL)openFile:(NSString *)fullPath	Instructs Workspace Manager to open the file specified by
withApplication:(NSString *)appName		fullPath using the appName application where flag
andDeactivate:(BOOL)flag		indicates if sending application is deactivated before the request is sent or not; returns success of open.
- (BOOL)openTempFile:(NSString *)fullPath	Instructs Workspace Manager to open the temporary file specified by fullPath using the default application for its type; returns success of open.

Manipulating Files	

- (BOOL)performFileOperation:(NSString *)operation 
source:(NSString *)source	Requests the Workspace Manager to perform a file
destination:(NSString *)destination		operation on a set of files in the source directory
files:(NSArray *)files		specifying the destination directory if needed using tag
tag:(int *)tag		as an identifier for asynchronous operations; returns success for synchronous operations.
- (BOOL)selectFile:(NSString *)fullPath 
inFileViewerRootedAtPath:(NSString *)rootFullpath
	Instructs Workspace Manager to select the file specified by fullPath opening a new file viewer if a path is specified by rootFullpath; returns success of selection.

Requesting Information about Files

- (NSString *)fullPathForApplication:(NSString *)appName
	Returns the full path for the application appName.
- (BOOL)getInfoForFile:(NSString *)fullPath	Retrieves information about the file specified by fullPath,
application:(NSString **)appName		sets appName to the application the Workspace
type:(NSString **)type		Manager would use to open fullPath, sets  type to a value or file name extension indicating the file's type, and returns success of access.
- (BOOL)getFileSystemInfoForPath:(NSString *)fullPath 
isRemovable:(BOOL *)removableFlag	Describes the file system at fullPath in description and
isWritable:(BOOL *)writableFlag		fileSystemType, sets the Flags appropriately, and returns
isUnmountable:(BOOL *)unmountableFlag		YES if fullPath is a file system mount point, or NO if it
description:(NSString **)description		isn't.
type:(NSString **)fileSystemType
- (NSImage *)iconForFile:(NSString *)fullPath	Returns an NSImage object with the icon for the single file specified by fullPath.
- (NSImage *)iconForFileType:(NSString *)fileType	Returns an NSImage object with the icon for the  file type specified by fileType.

Manipulating Applications	

- (void)hideOtherApplications	Hides all applications other than the sender.
- (BOOL)launchApplication:(NSString *)appName	Instructs Workspace Manager to launch the application appName and returns success of launch.
- (BOOL)launchApplication:(NSString *)appName	Instructs Workspace Manager to launch the application
showIcon:(BOOL)showIcon		appName displaying the application's icon if showIcon
autolaunch:(BOOL)autolaunch		is YES and using the dock autolaunching defaults if  autolaunch is YES; returns success of launch.

Requesting Additional Time before Power Off or Logout

- (int)extendPowerOffBy:(int)requested	Requests more time before the power goes off or the user logs out; returns the granted number of additional milliseconds.

Tracking Changes to the File System

- (BOOL)fileSystemChanged	Returns whether a change to the file system has been registered with a noteFileSystemChanged message since the last fileSystemChanged message.
- (void)noteFileSystemChanged	Informs Workspace Manager that the file system has changed.

Updating Registered Services and File Types

- (void)findApplications	Instructs Workspace Manager to examine all applications in the normal places and update its records of registered services and file types.

Tracking Changes to the User Defaults Database

- (void)noteUserDefaultsChanged	Informs Workspace Manager that the defaults database has changed.
- (BOOL)userDefaultsChanged	Returns whether a change to the defaults database has been registered with a noteUserDefaultsChanged message since the last userDefaultsChanged message.

Tracking Status Changes for Applications and Devices

- (NSArray *)mountedRemovableMedia	Returns a list of the pathnames of all currently mounted removable disks.
- (NSArray *)mountNewRemovableMedia	Causes the Workspace Manager to poll the system's drives for any disks that have been inserted but not yet mounted, waits until the new disks have been mounted, and returns a list of full pathnames to all newly mounted disks.

Animating an Image	

- (void)slideImage:(NSImage *)image	Instructs Workspace Manager to animate a sliding image of
from:(NSPoint *)fromPoint		image from fromPoint to toPoint, specified in screen
to:(NSPoint *)toPoint		coordinates.

Unmounting a Device	

- (BOOL)unmountAndEjectDeviceAtPath:(NSString *)path
	Unmounts and ejects the device at path and returns success of unmount.