]> err.no Git - sope/blob - sope-core/EOControl/EOKeyValueArchiver.h
renamed packages as discussed in the developer list
[sope] / sope-core / EOControl / EOKeyValueArchiver.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __EOControl_EOKeyValueArchiver_H__
24 #define __EOControl_EOKeyValueArchiver_H__
25
26 #import <Foundation/NSObject.h>
27
28 @class NSString, NSDictionary, NSMutableArray, NSMutableDictionary;
29 @class NSMutableSet;
30
31 @interface EOKeyValueArchiver : NSObject
32 {
33   NSMutableDictionary *plist;
34   id delegate; // non-retained
35 }
36
37 /* coding */
38
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;
43
44 - (NSDictionary *)dictionary;
45
46 /* delegate */
47
48 - (void)setDelegate:(id)_delegate;
49 - (id)delegate;
50
51 @end
52
53 @interface EOKeyValueUnarchiver : NSObject
54 {
55   NSDictionary   *plist;
56   NSMutableArray *unarchivedObjects;
57   NSMutableSet   *awakeObjects;
58   id parent;
59   
60   id delegate; // non-retained
61 }
62
63 - (id)initWithDictionary:(NSDictionary *)_dict;
64
65 /* decoding */
66
67 - (id)decodeObjectForKey:(NSString *)_key;
68 - (id)decodeObjectReferenceForKey:(NSString *)_key;
69 - (BOOL)decodeBoolForKey:(NSString *)_key;
70 - (int)decodeIntForKey:(NSString *)_key;
71
72 /* operations */
73
74 - (void)ensureObjectAwake:(id)_object;
75 - (void)finishInitializationOfObjects;
76 - (void)awakeObjects;
77 - (id)parent;
78
79 /* delegate */
80
81 - (void)setDelegate:(id)_delegate;
82 - (id)delegate;
83
84 @end
85
86 @protocol EOKeyValueArchiving
87
88 - (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
89 - (void)encodeWithKeyValueArchiver:(EOKeyValueArchiver *)_archiver;
90
91 @end
92
93 @interface NSObject(EOKeyValueArchivingAwakeMethods)
94
95 - (void)finishInitializationWithKeyValueUnarchiver:(EOKeyValueUnarchiver *)_una;
96 - (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver *)_unarchiver;
97
98 @end
99
100 /* delegates */
101
102 @interface NSObject(KVCArchiverDelegates)
103
104 - (id)archiver:(EOKeyValueArchiver *)_archiver
105   referenceToEncodeForObject:(id)_obj;
106
107 @end
108
109 @interface NSObject(KVCUnarchiverDelegates)
110
111 - (id)unarchiver:(EOKeyValueUnarchiver *)_unarchiver
112   objectForReference:(id)_obj;
113
114 @end
115
116 #endif /* __EOControl_EOKeyValueArchiver_H__ */