From ba310e8b58d686ee9897b26a7edab5b778a8d96f Mon Sep 17 00:00:00 2001 From: jnj Date: Thu, 13 Nov 2008 18:59:12 +0000 Subject: Add remaining plugins git-svn-id: https://blacktree-elements-public.googlecode.com/svn/trunk@41 57e2f9b5-c12c-0410-8e95-a1ee7272c91a --- .../Versions/A/PrivateHeaders/NDProcess.h | 333 +++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 QSFoundation.framework/Versions/A/PrivateHeaders/NDProcess.h (limited to 'QSFoundation.framework/Versions/A/PrivateHeaders/NDProcess.h') diff --git a/QSFoundation.framework/Versions/A/PrivateHeaders/NDProcess.h b/QSFoundation.framework/Versions/A/PrivateHeaders/NDProcess.h new file mode 100644 index 0000000..3048639 --- /dev/null +++ b/QSFoundation.framework/Versions/A/PrivateHeaders/NDProcess.h @@ -0,0 +1,333 @@ +/*! + @header NDProcess.h + @abstract Header file for the class NDProcess and categories of NDProcess + @discussion

NDProcess is a cocoa wrapper for Apples Process Manager

+ +

Created by Nathan Day on Mon May 27 2002.
+ Copyright © 2002 Nathan Day. All rights reserved.

+ */ + + +#import +#import + +/*! + @class NDProcess + @abstract Class to represent a process. + @discussion Provides a simplified Cocoa interface to Apples Pocess Manager API. Some of the methods will return instances that are reused if you do not retain them, methods that do so are identified in there documentation. + */ +@interface NDProcess : NSObject +{ +@private + ProcessSerialNumber processSerialNumber; + ProcessInfoRec infoRec; + NSString * name; + NSURL * url; +} + +/*! + @method initWithProcessSerialNumber: + @abstract Initialises a NDProcess. + @discussion Intializes a the recevier with a process serial number. + @param processSerialNumber The process serial number. + @result A initialised NDProcess + */ +- (id)initWithProcessSerialNumber:(ProcessSerialNumber)processSerialNumber; + +/*! + @method processSerialNumber + @abstract Get the Process Serial Number + @discussion Returns the process serial number for the recevier + @result A process serial number. + */ +- (ProcessSerialNumber)processSerialNumber; + +/*! + @method isFrontProcess + @abstract Is the process the front process. + @discussion Determines if the recevier is for a process that is currently front. + @result Returns YES if the process is front. + */ +- (BOOL)isFrontProcess; + +/*! + @method isCurrentProcess + @abstract Is the process the current process. + @discussion Determines if the recevier is for a process that is current. + @result Returns YES if the process is current. + */ +- (BOOL)isCurrentProcess; + +/*! + @method makeFrontProcess + @abstract Bring the process to front. + @discussion Attempts to bring the process to front. + @result Returns YES if the process did come to front. + */ +- (BOOL)makeFrontProcess; + +/*! + @method wakeUpProcess + @abstract Wake up the process. + @discussion Wakes up the process. + @result Returns YES if the process did wakr up.. + */ +- (BOOL)wakeUpProcess; + + +@end + +/*! + @category NDProcess(Construction) + @abstract NDProcess construction methods. + @discussion Most of the time you should use one of these methods to create NDProcess objects. + */ +@interface NDProcess (Construction) + +/*! + @method initWithCurrentProcess + @abstract Initialises a NDProcess. + @discussion Initialises the recevier for the current process. + @result A initialised NDProcess + */ +- (id)initWithCurrentProcess; + +/*! + @method initWithFrontProcess + @abstract Initialises a NDProcess. + @discussion Initialises the recevier for the front process. + @result A initialised NDProcess + */ +- (id)initWithFrontProcess; + +/*! + @method everyProcess + @abstract Get every process. + @discussion Returns a NSArray of NDProcesss for every process. + @result An NSArray of NDProcesss. + */ ++ (NSArray *)everyProcess; + +/*! + @method everyProcessNamed: + @abstract Get every process of supplied name. + @discussion Returns every process with a given name, the process name does not have to unique. + @param name The process name to find. + @result An NSArray of NDProcesss. + */ ++ (NSArray *)everyProcessNamed:(NSString *)name; + + +/*! + @method processWithProcessSerialNumber: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the process with the given process serial number. WARNING: this method returns an instance that will be reused unless you retain it. + @param processSerialNumber A valid process serial number. + @result A NDProcess object. + */ ++ (NDProcess *)processWithProcessSerialNumber:(ProcessSerialNumber)processSerialNumber; + +/*! + @method currentProcess + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the current process. WARNING: this method returns an instance that will be reused unless you retain it. + @result A NDProcess object. + */ ++ (NDProcess *)currentProcess; + +/*! + @method frontProcess + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the front process. WARNING: this method returns an instance that will be reused unless you retain it. + @result A NDProcess object. + */ ++ (NDProcess *)frontProcess; + +/*! + @method firstProcessNamed: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the first process with the supplied name. WARNING: this method returns an instance that will be reused unless you retain it. + @param name The name to look for. + @result A NDProcess object. + */ ++ (NDProcess *)firstProcessNamed:(NSString *)name; + +/*! + @method processForURL: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the process with the supplied url, the url can be to the executable file within an appication package. WARNING: this method returns an instance that will be reused unless you retain it. + @param URL The url of the process to return. + @result A NDProcess object. + */ ++ (NDProcess *)processForURL:(NSURL *)URL; + +/*! + @method processForPath: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the process with the supplied path, the path can be to the executable file within an appication package. WARNING: this method returns an instance that will be reused unless you retain it. + @param path The path of the process to return. + @result A NDProcess object. + */ ++ (NDProcess *)processForPath:(NSString *)path; + +/*! + @method processForApplicationURL: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the process with the supplied url, if the url is to an application package then the NDProcess returned is for the file identified by the CFBundleExecutable key int the Info.plist file. WARNING: this method returns an instance that will be reused unless you retain it. + @param URL The url of the process to return. + @result A NDProcess object. + */ ++ (NDProcess *)processForApplicationURL:(NSURL *)URL; + +/*! + @method processForApplicationPath: + @abstract Returns a new NDProcess. + @discussion Returns a NDProcess for the process with the supplied path, if the path is to an application package then the NDProcess returned is for the file identified by the CFBundleExecutable key int the Info.plist file. WARNING: this method returns an instance that will be reused unless you retain it. + @result A NDProcess object. + */ ++ (NDProcess *)processForApplicationPath:(NSString *)path; + + /*! + @method everyProcessForBeginingWithURL: + @abstract Returns a new NDProcess. + @discussion Returns a NSArray of NDProcess for the processes with in the supplied url, the url can be to the executable file within an appication package or a package its self or even a folder. + @param URL The url of the process to return. + @result A NDProcess object. + */ ++ (NSArray *)everyProcessBeginingWithURL:(NSURL *)URL; + +/*! + @method everyProcessBeginingWithPath: + @abstract Returns a NSArray of NDProcesss contained within the given path.. + @discussion Returns a NSArray of NDProcess for the processes with in the supplied path, the path can be to the executable file within an appication package or a package its self or even a folder. + @param path The path of the process to return. + @result A NDProcess object. + */ ++ (NSArray *)everyProcessBeginingWithPath:(NSString *)path; + +/*! + @method processesEnumerater + @abstract Returns a NSEnumerator for every process. + @discussion The NSEnumerator will step through every process. WARNING: the instances returned from this enumerator will be reuses unless you retain them, before calling nextObject again. + @result A NSEnumerator for every process. + */ ++ (NSEnumerator *)processesEnumerater; + +/*! + @method isNoProcess + @abstract Get type of process. + @discussion Is the process serial number kNoProcess. + @result Returns YES if process serial number is kNoProcess + */ +- (BOOL)isNoProcess; + +/*! + @method isSystemProcess + @abstract Get type of process. + @discussion Is the process serial number kSystemProcess. + @result Returns YES if process serial number is kSystemProcess + */ +- (BOOL)isSystemProcess; + +/*! + @method isValid + @abstract Is the process valid. + @discussion Attempts to get ProcessInfoRec and return true if no error. The process may not be running any more. + @result Returns YES if the is process valid. + */ +- (BOOL)isValid; + +@end + +/*! + @category NDProcess(ProcessInfoRec) + @abstract Methods to get additional process info. + @discussion These methods return information from the ProcessInfoRec sttruct. + */ +@interface NDProcess (ProcessInfoRec) + +/*! + @method name + @abstract Process name. + @discussion The name of the process. For applications, this field contains the name of the application as designated by the user at the time the application was opened. For example, for foreground applications, the name is the name as it appears in the Dock. + @result A NSString containing the name. + */ +- (NSString *)name; + +/*! + @method type + @abstract Process type + @discussion The file type of the application, generally 'APPL' for applications and 'appe' for background-only applications launched at startup. + @result A four char code. + */ +- (OSType)type; + +/*! + @method signature + @abstract Process signature + @discussion The signature of the file containing the process (for example, the signature of the TeachText application is 'ttxt'). + @result A four char code. + */ +- (OSType)signature; + +/*! + @method mode + @abstract Process mode + @discussion Process mode flags. These flags indicate whether the process is an application or desk accessory. For applications, this field also returns information specified in the application’s 'SIZE' resource. This information is returned as flags that can be combined with a bitwise or, though they probable are not all relevent to Mac OS X +
    +
  • modeReserved
  • +
  • modeControlPanel
  • +
  • modeDeskAccessory
  • +
  • modeMultiLaunch
  • +
  • modeNeedSuspendResume
  • +
  • modeCanBackground
  • +
  • modeDoesActivateOnFGSwitch
  • +
  • modeOnlyBackground
  • +
  • modeGetFrontClicks
  • +
  • modeGetAppDiedMsg
  • +
  • mode32BitCompatible
  • +
  • modeHighLevelEventAware
  • +
  • modeLocalAndRemoteHLEvents
  • +
  • modeStationeryAware
  • +
  • modeUseTextEditServices
  • +
  • modeDisplayManagerAware
  • +
+ @result A combination of the previously list values. + */ + +- (UInt32)mode; + +/*! + @method launcher + @abstract Process launcher + @discussion A NDProcess for the process that launched the application. If the original launcher of the process is no longer open, the NDProcess will have the process serial number kNoProcess. + @result A NDProcess for the receviers launching process. + */ +- (NDProcess *)launcher; + +/*! + @method launchTime + @abstract Launch time in seconds + @discussion The value of the Ticks global variable in secods at the time that the process was launched. + @result The time in NSTimeInterval (seconds). + */ +- (NSTimeInterval)launchTime; + +/*! + @method url + @abstract Process url. + @discussion The url for the receviers process, this may be within the contents of some application package. + @result A file url NSURL to a file containing the process. + */ +- (NSURL *)url; + +/*! + @method path + @abstract Process path. + @discussion The path for the receviers process, this may be within the contents of some application package. + @result A path NSString to a file containing the process. + */ +- (NSString *)path; + + +@end \ No newline at end of file -- cgit