]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOModelGroup.h
removed subminor
[sope] / sope-gdl1 / GDLAccess / EOModelGroup.h
1 // $Id: EOModelGroup.h 1 2004-08-20 10:38:46Z znek $
2
3 #ifndef __EOAccess_EOModelGroup_H__
4 #define __EOAccess_EOModelGroup_H__
5
6 #import <Foundation/NSObject.h>
7
8 @class NSDictionary;
9 @class EOGlobalID, EOFetchSpecification;
10 @class EOModelGroup, EOModel, EOEntity, EORelationship;
11
12 @protocol EOModelGroupClassDelegation < NSObject >
13
14 - (EOModelGroup *)defaultModelGroup;
15
16 @end
17
18 @protocol EOModelGroupDelegation < NSObject >
19
20 - (Class)entity:(EOEntity *)_entity
21   classForObjectWithGlobalID:(EOGlobalID *)_oid;
22
23 - (Class)entity:(EOEntity *)_entity
24   failedToLookupClassNamed:(NSString *)_className;
25
26 - (EOEntity *)relationship:(EORelationship *)_relship
27   failedToLookupDestinationNamed:(NSString *)_entityName;
28
29 - (EOEntity *)subEntityForEntity:(EOEntity *)_entity
30   primaryKey:(NSDictionary *)_pkey
31   isFinal:(BOOL *)_flag;
32
33 - (EOModel *)modelGroup:(EOModelGroup *)_group
34   entityNamed:(NSString *)_name;
35
36 - (EORelationship *)entity:(EOEntity *)_entity
37   relationshipForRow:(NSDictionary *)_row
38   relationship:(EORelationship *)_relship;
39
40 @end
41
42 @class NSArray, NSMutableDictionary;
43
44 @interface EOModelGroup : NSObject
45 {
46   NSMutableDictionary        *nameToModel;
47   id<EOModelGroupDelegation> delegate; /* non-retained */
48 }
49
50 + (void)setDefaultGroup:(EOModelGroup *)_group;
51 + (EOModelGroup *)defaultGroup;
52
53 + (EOModelGroup *)globalModelGroup;
54
55 /* class delegate */
56
57 + (void)setClassDelegate:(id<EOModelGroupClassDelegation>)_delegate;
58 + (id<EOModelGroupClassDelegation>)classDelegate;
59
60 /* instance delegate */
61
62 - (void)setDelegate:(id<EOModelGroupDelegation>)_delegate;
63 - (id<EOModelGroupDelegation>)delegate;
64
65 /* models */
66
67 - (void)addModel:(EOModel *)_model;
68 - (void)removeModel:(EOModel *)_model;
69
70 - (EOModel *)modelNamed:(NSString *)_name;
71 - (NSArray *)modelNames;
72 - (NSArray *)models;
73 - (EOModel *)modelWithPath:(NSString *)_path;
74 - (EOModel *)addModelWithFile:(NSString *)_path;
75
76 - (void)loadAllModelObjects;
77
78 /* entities */
79
80 - (EOEntity *)entityForObject:(id)_object;
81 - (EOEntity *)entityNamed:(NSString *)_name;
82
83 - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name
84   entityNamed:(NSString *)_entityName;
85
86 @end
87
88 #endif /* __EOAccess_EOModelGroup_H__ */