sogo/SoObjects/SOGo/SOGoUserDefaults.h
Wolfgang Sourdeau c4f917942d Monotone-Parent: ab81a2b3344ce13069fdc2f4762e128a13136bb3
Monotone-Revision: 6f946a78a43cf1914cfbcff43562c9c0ed48a1b0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-07-25T17:52:49
Monotone-Branch: ca.inverse.sogo
2008-07-25 17:52:49 +00:00

90 lines
2.3 KiB
Objective-C

/*
Copyright (C) 2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#ifndef __SOGoUserDefaults_H_
#define __SOGoUserDefaults_H_
#import <Foundation/NSObject.h>
/*
SOGoUserDefaults
An object with the same API like NSUserDefaults which retrieves profile
information for users in the database.
*/
@class NSString, NSURL, NSUserDefaults, NSArray, NSDictionary, NSData;
@class NSCalendarDate, NSMutableDictionary;
@interface SOGoUserDefaults : NSObject
{
NSUserDefaults *parent;
NSURL *url;
NSString *uid;
NSString *fieldName;
NSArray *fieldNames;
NSMutableDictionary *values;
NSCalendarDate *lastFetch;
struct
{
int modified: 1;
int isNew: 1;
int reserved: 30;
} defFlags;
}
- (id) initWithTableURL: (NSURL *) url
uid: (NSString *) uid
fieldName: (NSString *) fieldName;
/* value access */
- (void) setObject: (id) value
forKey: (NSString *) key;
- (id) objectForKey: (NSString *) key;
- (void) removeObjectForKey: (NSString *) key;
/* typed accessors */
- (NSArray *) arrayForKey: (NSString *)key;
- (NSDictionary *) dictionaryForKey: (NSString *)key;
- (NSData *) dataForKey: (NSString *)key;
- (NSString *) stringForKey: (NSString *)key;
- (BOOL) boolForKey: (NSString *) key;
- (float) floatForKey: (NSString *) key;
- (int) integerForKey: (NSString *) key;
- (void) setBool: (BOOL) value forKey: (NSString *) key;
- (void) setFloat: (float) value forKey: (NSString *) key;
- (void) setInteger: (int) value forKey: (NSString *) key;
- (NSString *) jsonRepresentation;
/* saving changes */
- (BOOL) synchronize;
@end
#endif /* __SOGoUserDefaults_H__ */