GNUstep Core Data  0.1
NSManagedObjectModel.h
00001 /* Interface of the NSManagedObjectModel class for the GNUstep
00002    Core Data framework.
00003    Copyright (C) 2005 Free Software Foundation, Inc.
00004 
00005    Written by:  Saso Kiselkov <diablos@manga.sk>
00006    Date: August 2005
00007 
00008    This file is part of the GNUstep Core Data framework.
00009 
00010    This library is free software; you can redistribute it and/or
00011    modify it under the terms of the GNU Lesser General Public
00012    License as published by the Free Software Foundation; either
00013    version 2.1 of the License, or (at your option) any later version.
00014 
00015    This library is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018    Lesser General Public License for more details.
00019 
00020    You should have received a copy of the GNU Lesser General Public
00021    License along with this library; if not, write to the Free
00022    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
00023  */
00024 
00025 #ifndef _NSManagedObjectModel_h_
00026 #define _NSManagedObjectModel_h_
00027 
00028 #import <Foundation/NSObject.h>
00029 
00030 @class NSString, NSArray, NSDictionary, NSMutableDictionary, NSURL;
00031 @class NSFetchRequest, NSAttributeDescription;
00032 
00033 @interface NSManagedObjectModel : NSObject <NSCopying, NSCoding>
00034 {
00035   NSArray * _entities;
00036 
00041   NSMutableDictionary * _configurations;
00042   NSMutableDictionary * _fetchRequests;
00043 
00044   NSMutableDictionary * _defaultAttributeValues;
00045 
00054   unsigned _usedByPersistentStoreCoordinators;
00055 }
00056 
00057 // Initialization.
00058 + (NSManagedObjectModel *) mergedModelFromBundles: (NSArray *) someBundles;
00059 + (NSManagedObjectModel *) modelByMergingModels: (NSArray *) someModels;
00060 - initWithContentsOfURL: (NSURL *) aUrl;
00061 
00062 // Getting and setting entities and configurations.
00063 - (NSArray *) entities;
00064 - (NSDictionary *) entitiesByName;
00065 - (void) setEntities: (NSArray *) someEntities;
00066 - (NSArray *) configurations;
00067 - (NSArray *) entitiesForConfiguration: (NSString *) aConfiguration;
00068 // passing `nil' as the entities instead deletes the configuration
00069 - (void) setEntities: (NSArray *) someEntities
00070     forConfiguration: (NSString *) aConfiguration;
00071 
00072 // Getting and setting fetch request templates.
00073 - (NSFetchRequest *) fetchRequestTemplateForName: (NSString *) aName;
00074 - (NSFetchRequest *) fetchRequestFromTemplateWithName: (NSString *) aName
00075                          substitutionVariables: (NSDictionary *) someVariables;
00076 - (void) setFetchRequestTemplate: (NSFetchRequest *) aFetchRequest
00077                          forName: (NSString *) aName;
00078 
00079 // Localization.
00080 - (NSDictionary *) localizationDictionary;
00081 - (void) setLocalizationDictionary: (NSDictionary *) aLocalizationDictionary;
00082 
00083 @end
00084 
00085 #endif // _NSManagedObjectModel_h_