2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __EOControl_EOKeyValueArchiver_H__
23 #define __EOControl_EOKeyValueArchiver_H__
25 #import <Foundation/NSObject.h>
27 @class NSString, NSDictionary, NSMutableArray, NSMutableDictionary;
30 @interface EOKeyValueArchiver : NSObject
32 NSMutableDictionary *plist;
33 id delegate; // non-retained
38 - (void)encodeObject:(id)_obj forKey:(NSString *)_key;
39 - (void)encodeReferenceToObject:(id)_obj forKey:(NSString *)_key;
40 - (void)encodeBool:(BOOL)_flag forKey:(NSString *)_key;
41 - (void)encodeInt:(int)_value forKey:(NSString *)_key;
43 - (NSDictionary *)dictionary;
47 - (void)setDelegate:(id)_delegate;
52 @interface EOKeyValueUnarchiver : NSObject
55 NSMutableArray *unarchivedObjects;
56 NSMutableSet *awakeObjects;
59 id delegate; // non-retained (eg a WOComponent)
62 - (id)initWithDictionary:(NSDictionary *)_dict;
66 - (id)decodeObjectForKey:(NSString *)_key;
67 - (id)decodeObjectReferenceForKey:(NSString *)_key; /* ask delegate for obj */
68 - (BOOL)decodeBoolForKey:(NSString *)_key;
69 - (int)decodeIntForKey:(NSString *)_key;
71 - (id)decodeObjectAtIndex:(unsigned)_idx;
75 - (void)ensureObjectAwake:(id)_object;
76 - (void)finishInitializationOfObjects;
82 - (void)setDelegate:(id)_delegate;
87 @protocol EOKeyValueArchiving
89 - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
90 - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver;
94 @interface NSObject(EOKeyValueArchivingAwakeMethods)
96 - (void)finishInitializationWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_un;
97 - (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
103 @interface NSObject(KVCArchiverDelegates)
105 - (id)archiver:(EOKeyValueArchiver *)_archiver
106 referenceToEncodeForObject:(id)_obj;
110 @interface NSObject(KVCUnarchiverDelegates)
112 - (id)unarchiver:(EOKeyValueUnarchiver *)_unarchiver
113 objectForReference:(id)_obj;
117 #endif /* __EOControl_EOKeyValueArchiver_H__ */