2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __EOControl_EOKeyValueArchiver_H__
24 #define __EOControl_EOKeyValueArchiver_H__
26 #import <Foundation/NSObject.h>
28 @class NSString, NSDictionary, NSMutableArray, NSMutableDictionary;
31 @interface EOKeyValueArchiver : NSObject
33 NSMutableDictionary *plist;
34 id delegate; // non-retained
39 - (void)encodeObject:(id)_obj forKey:(NSString *)_key;
40 - (void)encodeReferenceToObject:(id)_obj forKey:(NSString *)_key;
41 - (void)encodeBool:(BOOL)_flag forKey:(NSString *)_key;
42 - (void)encodeInt:(int)_value forKey:(NSString *)_key;
44 - (NSDictionary *)dictionary;
48 - (void)setDelegate:(id)_delegate;
53 @interface EOKeyValueUnarchiver : NSObject
56 NSMutableArray *unarchivedObjects;
57 NSMutableSet *awakeObjects;
60 id delegate; // non-retained
63 - (id)initWithDictionary:(NSDictionary *)_dict;
67 - (id)decodeObjectForKey:(NSString *)_key;
68 - (id)decodeObjectReferenceForKey:(NSString *)_key;
69 - (BOOL)decodeBoolForKey:(NSString *)_key;
70 - (int)decodeIntForKey:(NSString *)_key;
74 - (void)ensureObjectAwake:(id)_object;
75 - (void)finishInitializationOfObjects;
81 - (void)setDelegate:(id)_delegate;
86 @protocol EOKeyValueArchiving
88 - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
89 - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver;
93 @interface NSObject(EOKeyValueArchivingAwakeMethods)
95 - (void)finishInitializationWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_una;
96 - (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
102 @interface NSObject(KVCArchiverDelegates)
104 - (id)archiver:(EOKeyValueArchiver *)_archiver
105 referenceToEncodeForObject:(id)_obj;
109 @interface NSObject(KVCUnarchiverDelegates)
111 - (id)unarchiver:(EOKeyValueUnarchiver *)_unarchiver
112 objectForReference:(id)_obj;
116 #endif /* __EOControl_EOKeyValueArchiver_H__ */