Class CPPasteboard

CPObject
    extended byCPPasteboard

@implementation CPPasteboard : CPObject

CPPasteBoard is the object responsible for cut/copy/paste and drag&drop operations.


Method Summary
+(id)generalPasteboard
          Returns a new instance of a pasteboard.
+(id)pasteboardWithName:(CPString)aName
          Returns a pasteboard with the specified name.
-(unsigned)addTypes:(CPArray)types owner:(id)anOwner
          Adds supported data types to the pasteboard.
-(CPString)availableTypeFromArray:(CPArray)anArray
          Checks the pasteboard's types for a match with the types listen in the specified array.
-(unsigned)changeCount
          Returns the number of changes that have occurred to this pasteboard.
-(CPData)dataForType:(CPString)aType
          Returns the pasteboard data for the specified data type.
-(unsigned)declareTypes:(CPArray)types owner:(id)anOwner
          Sets the data types that this pasteboard will contain.
-(id)propertyListForType:(CPString)aType
          Returns the property list for the specified data type.
-(BOOL)setData:(CPData)aData forType:(CPString)aType
          Sets the pasteboard data for the specified type.
-(BOOL)setPropertyList:(id)aPropertyList forType:(CPString)aType
          Writes the specified property list as data for the specified type.
-(void)setString:(CPString)aString forType:(CPString)aType
          Sets the specified string as data for the specified type.
-(CPString)stringForType:(CPString)aType
          Returns the string for the specified data type.
-(CPArray)types
          Returns the pasteboards supported types.

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass


Method Detail

generalPasteboard

+(id)generalPasteboard
Returns a new instance of a pasteboard

pasteboardWithName

+(id)pasteboardWithName:(CPString)aName
Returns a pasteboard with the specified name. If the pasteboard doesn't exist, it will be created.
Parameters:
aName - the name of the pasteboard
Returns:
the requested pasteboard

addTypes

-(unsigned)addTypes:(CPArray)types owner:(id)anOwner
Adds supported data types to the pasteboard
Parameters:
types - the data types
anOwner - the object that contains the data types
Returns:
the pasteboard's change count

availableTypeFromArray

-(CPString)availableTypeFromArray:(CPArray)anArray
Checks the pasteboard's types for a match with the types listen in the specified array. The array should be ordered by the requestor's most preferred data type first.
Parameters:
anArray - an array of requested types ordered by preference
Returns:
the highest match with the pasteboard's supported types or nil if no match was found

changeCount

-(unsigned)changeCount
Returns the number of changes that have occurred to this pasteboard

dataForType

-(CPData)dataForType:(CPString)aType
Returns the pasteboard data for the specified data type
Parameters:
aType - the requested data type
Returns:
the requested data or nil if the data doesn't exist

declareTypes

-(unsigned)declareTypes:(CPArray)types owner:(id)anOwner
Sets the data types that this pasteboard will contain.
Parameters:
types
anOwner - the object that contains the the data
Returns:
the pasteboard's change count

propertyListForType

-(id)propertyListForType:(CPString)aType
Returns the property list for the specified data type
Parameters:
aType - the requested data type
Returns:
the property list or nil if the list was not found

setData

-(BOOL)setData:(CPData)aData forType:(CPString)aType
Sets the pasteboard data for the specified type
Parameters:
aData - the data
aType - the data type being set
Returns:
YES if the data was successfully written to the pasteboard

setPropertyList

-(BOOL)setPropertyList:(id)aPropertyList forType:(CPString)aType
Writes the specified property list as data for the specified type
Parameters:
aPropertyList - the property list to write
aType - the data type
Returns:
YES if the property list was successfully written to the pasteboard

setString

-(void)setString:(CPString)aString forType:(CPString)aType
Sets the specified string as data for the specified type
Parameters:
aString - the string to write
aType - the data type
Returns:
YES if the string was successfully written to the pasteboard

stringForType

-(CPString)stringForType:(CPString)aType
Returns the string for the specified data type
Parameters:
aType - the requested data type
Returns:
the string or nil if the string was not found

types

-(CPArray)types
Returns the pasteboards supported types

Created on Sat Sep 13 14:15:43 PDT 2008