LOFixtureLibrary.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #import <Cocoa/Cocoa.h>
00037
00038 @class LOFixture;
00039 @class LOFixtureLibrary;
00040
00046 @interface NSObject (LOFixtureLibraryDelegate)
00047
00048
00054 - (void)unableToParseFixtureXML:(NSXMLElement *)XML withError:(NSError *)error inLibrary:(LOFixtureLibrary *)library;
00055
00056
00065 - (BOOL)loadFixture:(LOFixture *)newFixture withDuplicateFixture:(LOFixture *)existingFixture inLibrary:(LOFixtureLibrary *)library;
00066
00067
00080 - (BOOL)shouldRenameFixture:(LOFixture *)newFixture inLibrary:(LOFixtureLibrary *)library;
00081
00082
00093 - (NSString *)newNameForFixture:(LOFixture *)newFixture suggestedName:(NSString *)suggested inLibrary:(LOFixtureLibrary *)library;
00094
00095 @end;
00096
00097
00109 @interface LOFixtureLibrary : NSObject
00110 {
00111 NSMutableDictionary *manufacturers;
00112 NSMutableArray *sortedManufacturers;
00113 NSMutableArray *allFixtures;
00114 id delegate;
00115
00116 NSString *searchFilter;
00117 NSArray *filteredAllFixtures;
00118 NSArray *filteredManufacturers;
00119 }
00120
00121
00129 - (id)initWithDelegate:(id)aDelegate;
00130
00131
00139 + (LOFixtureLibrary *)defaultLibrary;
00140
00141
00152 - (id)delegate;
00153
00154
00165 - (void)setDelegate:(id)aDelegate;
00166
00167
00175 - (NSXMLElement *)exportLibraryXML;
00176
00177
00186 - (NSXMLElement *)exportLibraryXMLForManufacturer:(NSString *)theManufacturer;
00187
00188
00206 - (BOOL)importFixtureXML:(NSXMLElement *)XMLElement;
00207
00208
00229 - (int)importLibraryXML:(NSXMLElement *)XMLElement;
00230
00231
00239 - (LOFixture *)fixtureNamed:(NSString *)name fromManufacturer:(NSString *)manufacturer;
00240
00241
00251 - (LOFixture *)fixtureMatching:(LOFixture *)theFixture;
00252
00253
00263 - (LOFixture *)fixtureMatchingXML:(NSXMLElement *)XMLElement;
00264
00265
00273 - (NSArray *)manufacturers;
00274
00275
00283 - (NSArray *)namesForManufacturer:(NSString *)manufacturer;
00284
00285
00293 - (NSString *)commentForFixtureNamed:(NSString *)name fromManufacturer:(NSString *)manufacturer;
00294
00295
00302 - (LOFixture *)fixtureSelectedInBrowser:(NSBrowser *)browser;
00303
00304
00312 - (NSString *)searchFilter;
00313
00314
00323 - (void)setSearchFilter:(NSString *)search;
00324
00325
00333 - (void)filter;
00334
00335
00336 @end
00337
00338
00339 static int caseInsensativeStringSort(NSString *str1, NSString *str2, void *context);
00340 static int fixtureNameSort(LOFixture *fix1, LOFixture *fix2, void *context);
00341 static int fixtureXMLNameSort(NSXMLElement *XML1, NSXMLElement *XML2, void *context);
00342
00343
00350 static BOOL __XML_Entries_Match(NSXMLElement *e1XML, NSXMLElement *e2XML);
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363