]> err.no Git - scalable-opengroupware.org/blob - SoObjects/SOGo/AgenorUserDefaults.h
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1031 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / SoObjects / SOGo / AgenorUserDefaults.h
1 /*
2   Copyright (C) 2005 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
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
22 #ifndef __AgenorUserDefaults_H_
23 #define __AgenorUserDefaults_H_
24
25 #import <Foundation/NSObject.h>
26
27 /*
28   AgenorUserDefaults
29   
30   An object with the same API like NSUserDefaults which retrieves profile
31   information for users in the database.
32 */
33
34 @class NSString, NSURL, NSUserDefaults, NSArray, NSDictionary, NSData;
35 @class NSCalendarDate, NSMutableDictionary;
36
37 @interface AgenorUserDefaults : NSObject
38 {
39   NSUserDefaults *parent;
40   NSURL    *url;
41   NSString *uid;
42   
43   NSArray             *fieldNames;
44   NSDictionary        *attributes;
45   NSMutableDictionary *values;
46   NSCalendarDate      *lastFetch;
47
48   struct {
49     int modified:1;
50     int isNew:1;
51     int reserved:30;
52   } defFlags;
53 }
54
55 - (id)initWithTableURL:(NSURL *)_url uid:(NSString *)_uid;
56
57 /* value access */
58
59 - (void)setObject:(id)_value forKey:(NSString *)_key;
60 - (id)objectForKey:(NSString *)_key;
61 - (void)removeObjectForKey:(NSString *)_key;
62
63 /* typed accessors */
64
65 - (NSArray *)arrayForKey:(NSString *)_key;
66 - (NSDictionary *)dictionaryForKey:(NSString *)_key;
67 - (NSData *)dataForKey:(NSString *)_key;
68 - (NSArray *)stringArrayForKey:(NSString *)_key;
69 - (NSString *)stringForKey:(NSString *)_key;
70 - (BOOL)boolForKey:(NSString *)_key;
71 - (float)floatForKey:(NSString *)_key;
72 - (int)integerForKey:(NSString *)_key;
73
74 - (void)setBool:(BOOL)value   forKey:(NSString *)_key;
75 - (void)setFloat:(float)value forKey:(NSString *)_key;
76 - (void)setInteger:(int)value forKey:(NSString *)_key;
77
78 /* saving changes */
79
80 - (BOOL)synchronize;
81
82 @end
83
84 #endif /* __AgenorUserDefaults_H_ */