- (void)addFileFromData:(NSData *)theData fileName:(NSString *)theName;
This method will take the passed data, compress it, and then add it to the CSTheme.
Name Description theData The data of the file you wish to add. fileName The file name that the data should be refered to within the CSObject
- (void)addFileFromFile:(NSString *)thePath fileName:(NSString *)theName withHashForFile:(NSString *)hashFile;
This method is identical to addFileFromFile:theLocation fileName:theName but with one more argument.
Name Description hashFile The path to a file to be used as a checksum for the file being added to the theme. The generation of a checksum, or hash, allows you to track the changing of files on a users machine by generating a key from the current file and comparing that against the a later version of the file at a later point.
- (void)addFileFromFile:(NSString *)thePath fileName:(NSString *)theName;
This method will take the specified file, compress it, and then add it to the CSTheme.
Name Description thePath The location the file is currently located at as a string. fileName The file name that the file should be refered to within the CSObject
- (void)addFileFromFile:(NSString *)thePath fileName:(NSString *)theName withHashForData:(NSData *)hashFile;
This method is identical to addFileFromFile:theLocation fileName:theName but with one more argument.
Name Description hashFile The data of a file to be used as a checksum for the file being added to the theme. The generation of a checksum, or hash, allows you to track the changing of files on a users machine by generating a key from the current file and comparing that against the a later version of the file at a later point.
- (void)addLinkForVariation:(NSString *)theVariationName forFile:(NSString *)fileName forDestination:(NSString *)theDestination;
Use this method to add a file link to a theme variation using a file already added to the CSTheme.
Name Description theVariationName The variation to add the link to. fileName The file already present in the CSTheme to use. theDestination The destination to copy the file to on install.
- (void)addPreviewFromData:(NSData *)theData forVariation:(NSString *)theVariationName;
Use this method to assign a theme preview from tiff formatted data to a theme variation. Theme changer programs use the preview picture to display a preview of the theme for the user on screen. The picture will be compressed to save space.
Name Description theData The data containing the picture. theVariationName The variation to add the theme preview picture to.
- (void)addPreviewFromFile:(NSString *)thePath forVariation:(NSString *)theVariationName;
Use this method to assign a theme preview from a tiff formatted file to a theme variation. Theme changer programs use the preview picture to display a preview of the theme for the user on screen. The picture will be compressed to save space.
Name Description thePath The path to the file to be used as a preview. theVariationName The variation to add the theme preview picture to.
- (void)addVariationWithName:(NSString *)theName;
Use this method to create a new theme variation within the CSTheme to hold information such as file linkings, preview pictures, theme descriptions, etc.
Name Description theName The name to assign the variation
- (NSArray *)allDestinationsForVariation:(NSString *)theVariationName;
Both allDestinationsForVariation and allFilesForVariation return the same order, and have identical index numbers.
Name Description theVariationName The name of the variation to return all the destinations from.
- (NSArray *)allFilesForVariation:(NSString *)theVariationName;
Both allDestinationsForVariation and allFilesForVariation return the same order, and have identical index numbers.
Name Description theVariationName The name of the variation to return all the files from.
- (BOOL)compareHashForThemeFile:(NSString *)theThemeFile forFile:(NSString *)thePath;
Use this method to compare the checksum of a file in the theme to a theme on the local drive to track changes on the computer.
Name Description theThemeFile The file present within the CSTheme to read the hash from. theFile The file on the local computer to compare the hash to.
- (void)compressFiles;
This method will be executed automatically when doing any file I/O operations..
- (int)currentThemeType;
Returns what style of theme this object is currently using (CSDeploymentTheme or CSBackupStyleTheme). Use this method to check for Aqua backups that may be hiding. CSBackupStyleTheme types should be handled carefully, as you should not run into them under normal conditions.
- (NSData *)dataForFile:(NSString *)theName;
Use this method to retrieve the data of a file previously stored in the CSTheme
Name Description theName The name assigned to the file to be retrieved
- (NSString *)descriptionForVariation:(NSString *)theVariationName;
Use this method to return the description of a variation as a string.
Name Description theVariationName The variation to pull the description from.
- (NSDictionary *)dictionaryForVariation:(NSString *)theVariationName;
You can use this method to copy a variation from one CSTheme to another. addVariationFromDictionary is not yet implemented.
Name Description theVariationName The variation to pull the dictionary from.
- (BOOL)fileHasHash:(NSString *)theThemeFile;
This method will return true if the specified file within the theme has a hash set.
- (NSString *)getOSTagForVariation:(NSString *)theVariation;
Use this method to get the OS tag of a variation.
Name Description theVariation The variation to get the OS tag of.
- (id)init;
Initializes a new, non-Aqua backup CSTheme.
- (id)initWithNewAquaTheme;
Use this method to initialize a new CSTheme that is built to be an Aqua restore theme. Aqua restore themes should not be provided to the end user. Only use this method when creating a restore theme as part of a theme switch. Files are brough in as linked.
- (id)initWithContentsOfFile:(NSString *)theFile;
This function will allow you to work with XSchemes as CSObjects
Name Description theFile The location of an XScheme to initialize the reciever with
- (id)initWithDLTAFromFile:(NSString *)thePath theTags:(NSArray *)tags;
Import a theme using a DLTA bridge. You must specify an array of OS tags (e.g. 10.2) for the method to read the theme. This method is compatible with ThemeStep themes that use the
Name Description theFile A string specifying the DLTA bundle to be read theTags An array of tags for the bridge to use when reading the theme. Use tags for each OS you want support to be included for. theIndex The index number of the variation you wish to use within the DLTA.
- (id)initWithXMLBundle:(NSString *)thePath forLanguage:(NSString *)theLanguage;
Imports a theme using a Metamorphx style theme bundle with an info.plist file. This method will ignore any OS information. The developer should check using their own code in order to check for any prospective issues with the OS tag. Files are brough in as linked.
Name Description thePath A string specifying the XML bundle to be read theLanguage A string specifying the language to be used to read from the XML property list.
- (void)removeVariationWithName:(NSString *)theName;
This method removes a theme variation, and all associated links, names, descriptions, and preview pictures from the CSTheme.
Name Description theName The name assigned to the theme to be deleted
- (void)setHashForThemeFile:(NSString *)theThemeFile forData:(NSData *)thePath;
This method can be used to change the hash of a file after it has already been added to a CSTheme. The hash is generated by NSData.
Name Description theThemeFile The file to change the hash of. forData The data of a file to generate the hash from.
- (void)setHashForThemeFile:(NSString *)theThemeFile forFile:(NSString *)theFile;
This method enables checksum support for file theThemeFile that is present in the CSTheme.
Name Description theThemeFile The file present within the CSTheme to add the hash to/replace. theFile The file on the local computer to generate a checksum from.
- (void)setOSTag:(NSString *)theTag forVariation:(NSString *)theVariation;
Use this method to set the OS tag of a variation. This method is most useful for DLTA imports because DLTA imports do not contain OS tags.
Name Description theTag The tag you wish to set the variation to use as an NSString theVariation The variation to set the OS tag of.
- (void)setVariationDescriptionWithString:(NSString *)theDescription forVariation:(NSString *)theVariationName;
This method sets the description of a theme variation to theDescription
Name Description theDescription A string containing the description to set the variation equal to. theVariationName The variation to set the description of.
+ (id)themeWithDLTAFromFile:(NSString *)thePath theTags:(NSArray *)tags;
This method returns an autoreleased instance of a DLTA CSTheme. Pass the tags you want the parser to use via an NSArray passed using theTags.
+ (id)themeWithThemeFromFile:(NSString *)thePath;
This method returns an autoreleased instance of a CSTheme (XScheme).
+ (id)themeWithXMLBundle:(NSString *)thePath forLanguage:(NSString *)theLanguage;
This method returns an autoreleased instance of a MetaMorphX CSTheme. Pass the language you want the parser to use using theLanguage.
- (NSArray *)variations;
This method returns the theme variations present in the CSTheme as an array.
- (void)writeAsThemeToPath:(NSString *)thePath atomically:(BOOL)atomYN;
Allows a CSTheme to be saved to an XScheme.
Name Description thePath The path to save the XScheme to fileName Pass YES to write the XScheme atomically, and NO to not.
* @method compressLinkedFiles * @abstract Compresses all linked file in the CSTheme * @discussion Use this method to prepare the files in a CSTheme for advanced operations. Normally automatically run when needed. */ -(void)compressLinkedFiles; #define CSDeploymentStyleTheme 1 #define CSBackupStyleTheme 2 #define CSThemeKitVersion 3 @end
This is a list of various constants used.
Name Description CSDeploymentStyle A deployment style theme meant for the end user. CSBackupStyleTheme A aqua backup style theme meant for backing up the current setup. CSThemeKitVersion Contains the current version of ThemeKit. Developers should always check this against the build used for development.
(Last Updated 3/21/2003)