/usr/include/GNUstep/EOControl/EOEditingContext.h is in libgnustep-dl2-dev 0.12.0-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | /* -*-objc-*-
EOEditingContext.h
Copyright (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.
Date: June 2000
This file is part of the GNUstep Database Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __EOControl_EOEditingContext_h__
#define __EOControl_EOEditingContext_h__
#ifdef GNUSTEP
#include <Foundation/NSHashTable.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSLock.h>
#else
#include <Foundation/Foundation.h>
#endif
#include <EOControl/EOObjectStore.h>
#include <EOControl/EOObserver.h>
#include <EOControl/EODefines.h>
@class NSArray;
@class NSMutableArray;
@class NSDictionary;
@class NSMutableDictionary;
@class NSAutoreleasePool;
@class NSUndoManager;
@class EOSharedEditingContext;
@interface EOEditingContext : EOObjectStore <EOObserving>
{
EOObjectStore *_objectStore;
NSUndoManager *_undoManager;
NSHashTable *_unprocessedChanges;
NSHashTable *_unprocessedDeletes;
NSHashTable *_unprocessedInserts;
NSHashTable *_insertedObjects;
NSHashTable *_deletedObjects;
NSHashTable *_changedObjects;
NSMapTable *_globalIDsByObject;
NSMapTable *_objectsByGID;
NSMutableDictionary *_snapshotsByGID;
NSMutableDictionary *_eventSnapshotsByGID;
id _delegate;
NSMutableArray *_editors;
id _messageHandler;
unsigned short _undoTransactionID;
struct {
unsigned registeredForCallback:1;
unsigned propagatesDeletesAtEndOfEvent:1;
unsigned ignoreChangeNotification:1;
unsigned exhaustiveValidation:1; /* unsigned stopsValidation:1; */
unsigned autoLocking:1;
unsigned processingChanges:1; /* unsigned savingChanges:1; */
unsigned skipInvalidateOnDealloc:1;
unsigned useCommittedSnapshot:1;
unsigned registeredUndoTransactionID:1;
unsigned retainsAllRegisteredObjects:1;
unsigned lockUsingParent:1;
unsigned ignoreSharedContextNotifications:1;
unsigned isSharedContextLocked:1;
unsigned unused:3;
} _flags;
struct {
unsigned willRunLoginPanel:1;
unsigned shouldFetchObjects:1;
unsigned shouldInvalidateObject:1;
unsigned shouldMergeChanges:1;
unsigned shouldPresentException:1;
unsigned shouldUndoUserActions:1;
unsigned shouldValidateChanges:1;
unsigned willSaveChanges:1;
} _delegateRespondsTo;
NSRecursiveLock *_lock;
EOSharedEditingContext *_sharedContext;
int _lockCount;
id _notificationQueue;
NSAutoreleasePool * _lockPool;
NSTimeInterval fetchTimestamp;
}
+ (void)setDefaultFetchTimestampLag: (NSTimeInterval)lag;
+ (NSTimeInterval)defaultFetchTimestampLag;
+ (void)setInstancesRetainRegisteredObjects: (BOOL)flag;
+ (BOOL)instancesRetainRegisteredObjects;
- (id)initWithParentObjectStore: (EOObjectStore *)parentObjectStore;
- (NSArray *)objectsWithFetchSpecification: (EOFetchSpecification *)fetchSpecification;
- (void)insertObject: (id)object;
- (void)insertObject: (id)object
withGlobalID: (EOGlobalID *)gid;
-(void)setLevelsOfUndo: (int)levels;
- (void)deleteObject: (id)object;
- (void)lockObject: (id)object;
- (BOOL)hasChanges;
- (void)saveChanges;
- (void)revert;
- (id)objectForGlobalID: (EOGlobalID *)globalID;
- (EOGlobalID *)globalIDForObject: (id)object;
- (void)setDelegate: (id)delegate;
- (id)delegate;
- (EOObjectStore *)parentObjectStore;
- (EOObjectStore *)rootObjectStore;
- (void)setUndoManager: (NSUndoManager *)undoManager;
- (NSUndoManager *)undoManager;
- (void)objectWillChange: (id)object;
- (void)recordObject: (id)object
globalID: (EOGlobalID *)globalID;
- (void)forgetObject: (id)object;
- (void)registerUndoForModifiedObject: (id)object;
- (NSArray *)registeredObjects;
- (NSArray *)updatedObjects;
- (NSArray *)insertedObjects;
- (NSArray *)deletedObjects;
- (void)propagatesDeletesUsingTable: (NSHashTable *)deleteTable;
- (void)validateDeletesUsingTable: (NSHashTable *)deleteTable;
- (BOOL)validateTable: (NSHashTable *)table
withSelector: (SEL)sel
exceptionArray: (NSMutableArray**)exceptionArrayPtr
continueAfterFailure: (BOOL)continueAfterFailure;
- (void)processRecentChanges;
- (BOOL)propagatesDeletesAtEndOfEvent;
- (void)setPropagatesDeletesAtEndOfEvent: (BOOL)propagatesDeletesAtEndOfEvent;
- (BOOL)stopsValidationAfterFirstError;
- (void)setStopsValidationAfterFirstError: (BOOL)flag;
- (BOOL)locksObjectsBeforeFirstModification;
- (void)setLocksObjectsBeforeFirstModification: (BOOL)flag;
- (EOSharedEditingContext *)sharedEditingContext;
- (void)setSharedEditingContext:(EOSharedEditingContext *)sharedEditingContext;
/** Returns a dictionary containing a snapshot of object
that reflects its committed values (last values putted in
the database; i.e. values before changes were made on the
object).
It is updated after commiting new values.
**/
- (NSDictionary *)committedSnapshotForObject: (id)object;
/** Returns a dictionary containing a snapshot of object
with its state as it was at the beginning of the current
event loop.
After the end of the current event, upon invocation of
processRecentChanges, the snapshot is updated to hold the
modified state of the object.**/
- (NSDictionary *)currentEventSnapshotForObject: (id)object;
- (NSDictionary *)uncommittedChangesForObject: (id)object;
- (void)refaultObjects;
- (void)setInvalidatesObjectsWhenFreed: (BOOL)flag;
- (BOOL)invalidatesObjectsWhenFreed;
- (void)addEditor: (id)editor;
- (void)removeEditor: (id)editor;
- (NSArray *)editors;
- (void)setMessageHandler: (id)handler;
- (id)messageHandler;
- (id)faultForGlobalID: (EOGlobalID *)globalID
editingContext: (EOEditingContext *)context;
- (id)faultForRawRow: (NSDictionary *)row
entityNamed: (NSString *)entityName
editingContext: (EOEditingContext *)context;
- (id)faultForRawRow: (NSDictionary *)row
entityNamed: (NSString *)entityName;
- (NSArray *)arrayFaultWithSourceGlobalID: (EOGlobalID *)globalID
relationshipName: (NSString *)name
editingContext: (EOEditingContext *)context;
- (void)initializeObject: (id)object
withGlobalID: (EOGlobalID *)globalID
editingContext: (EOEditingContext *)context;
- (NSArray *)objectsForSourceGlobalID: (EOGlobalID *)globalID
relationshipName: (NSString *)name
editingContext: (EOEditingContext *)context;
- (void)refaultObject: (id)object
withGlobalID: (EOGlobalID *)globalID
editingContext: (EOEditingContext *)context;
- (void)saveChangesInEditingContext: (EOEditingContext *)context;
- (NSArray *)objectsWithFetchSpecification: (EOFetchSpecification *)fetchSpecification
editingContext: (EOEditingContext *)context;
- (void)lockObjectWithGlobalID: (EOGlobalID *)gid
editingContext: (EOEditingContext *)context;
- (BOOL)isObjectLockedWithGlobalID: (EOGlobalID *)gid
editingContext: (EOEditingContext *)context;
- (void)clearOriginalSnapshotForObject: (id)object;
@end
/* To be used with NSRunLoop's performSelector:target:argument:order:modes: */
enum {
EOEditingContextFlushChangesRunLoopOrdering = 300000
};
GDL2CONTROL_EXPORT NSString *EOObjectsChangedInEditingContextNotification;
GDL2CONTROL_EXPORT NSString *EOEditingContextDidSaveChangesNotification;
@interface NSObject (EOEditingContext)
- (EOEditingContext *)editingContext;
@end
/*
* Methods implemented by the delegate.
*/
@interface NSObject (EOEditingContextDelegation)
- (BOOL)editingContext: (EOEditingContext *)editingContext
shouldPresentException: (NSException *)exception;
- (BOOL)editingContextShouldValidateChanges: (EOEditingContext *)editingContext;
- (void)editingContextWillSaveChanges: (EOEditingContext *)editingContext;
- (BOOL)editingContext: (EOEditingContext *)editingContext
shouldInvalidateObject: (id)object
globalID: (EOGlobalID *)gid;
- (BOOL)editingContextShouldUndoUserActionsAfterFailure: (EOEditingContext *)context;
- (NSArray *)editingContext: (EOEditingContext *)editingContext
shouldFetchObjectsDescribedByFetchSpecification: (EOFetchSpecification *)fetchSpecification;
- (BOOL)editingContext: (EOEditingContext *)editingContext
shouldMergeChangesForObject: (id)object;
- (void)editingContextDidMergeChanges: (EOEditingContext *)editingContext;
@end
/*
* Informal protocol for EOEditors.
*/
@interface NSObject (EOEditors)
- (BOOL)editorHasChangesForEditingContext: (EOEditingContext *)editingContext;
- (void)editingContextWillSaveChanges: (EOEditingContext *)editingContext;
@end
/*
* Informal protocol for EOMessageHandlers.
*/
@interface NSObject (EOMessageHandlers)
- (void)editingContext: (EOEditingContext *)editingContext
presentErrorMessage: (NSString *)message;
- (BOOL)editingContext: (EOEditingContext *)editingContext
shouldContinueFetchingWithCurrentObjectCount: (unsigned)count
originalLimit: (unsigned)limit
objectStore: (EOObjectStore *)objectStore;
@end
@interface EOEditingContext (EORendezvous)
+ (void)setSubstitutionEditingContext: (EOEditingContext *)ec;
+ (EOEditingContext *)substitutionEditingContext;
+ (void)setDefaultParentObjectStore: (EOObjectStore *)store;
+ (EOObjectStore *)defaultParentObjectStore;
@end
@interface EOEditingContext (EOStateArchiving)
+ (void)setUsesContextRelativeEncoding: (BOOL)flag;
+ (BOOL)usesContextRelativeEncoding;
+ (void)encodeObject: (id)object withCoder: (NSCoder *)coder;
+ (id)initObject: (id)object withCoder: (NSCoder *)coder;
@end
@interface EOEditingContext (EOTargetAction)
- (void)saveChanges: (id)sender;
- (void)refault: (id)sender;
- (void)revert: (id)sender;
- (void)refetch: (id)sender;
- (void)undo: (id)sender;
- (void)redo: (id)sender;
/*
* Private
*/
-(NSString *)objectsDescription;
-(NSString *)unprocessedDescription;
@end
@interface EOEditingContext (EOMultiThreaded) <NSLocking>
+ (void)setEOFMultiThreadedEnabled: (BOOL)flag;
- (void)lock;
- (void)unlock;
- (BOOL)tryLock;
@end
#endif
|