]> err.no Git - sope/blob - sope-xml/SaxObjC/SaxObjectModel.h
removed NGCString
[sope] / sope-xml / SaxObjC / SaxObjectModel.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 __SaxObjC_SaxObjectModel_H__
24 #define __SaxObjC_SaxObjectModel_H__
25
26 #import <Foundation/NSObject.h>
27
28 @class NSDictionary, NSString, NSArray;
29 @class SaxTagModel;
30
31 @interface SaxObjectModel : NSObject
32 {
33   NSDictionary *nsToModel;
34 }
35
36 + (id)modelWithName:(NSString *)_name;
37 + (id)modelWithContentsOfFile:(NSString *)_path;
38
39 - (id)initWithDictionary:(NSDictionary *)_dict;
40
41 /* queries */
42
43 - (SaxTagModel *)modelForTag:(NSString *)_localName namespace:(NSString *)_ns;
44
45 @end
46
47 @interface SaxNamespaceModel : NSObject
48 {
49   NSDictionary *tagToModel;
50 }
51
52 /* queries */
53
54 - (SaxTagModel *)modelForTag:(NSString *)_localName;
55
56 @end
57
58 @interface SaxTagModel : NSObject
59 {
60   NSString     *className;
61   NSString     *key;
62   NSString     *tagKey;       /* the key to store the tag name under */
63   NSString     *namespaceKey; /* the key to store the namespace uri under */
64   NSString     *parentKey;    /* the key to store the parent object under */
65   NSString     *contentKey;   /* the key to store the cdata content under */
66   NSArray      *toManyRelationshipKeys;
67   NSDictionary *defaultValues;
68   NSDictionary *tagToKey;
69   NSDictionary *attrToKey;
70 }
71
72 /* accessors */
73
74 - (NSString *)className;
75 - (NSString *)key;
76 - (NSString *)tagKey;
77 - (NSString *)namespaceKey;
78 - (NSString *)parentKey;
79 - (NSString *)contentKey;
80 - (NSDictionary *)defaultValues;
81
82 - (NSString *)propertyKeyForChildTag:(NSString *)_tag;
83
84 - (BOOL)isToManyKey:(NSString *)_key;
85 - (NSArray *)toManyRelationshipKeys;
86
87 - (NSArray *)attributeKeys;
88 - (NSString *)propertyKeyForAttribute:(NSString *)_attr;
89
90 /* object operations */
91
92 - (void)addValue:(id)_val toPropertyWithKey:(NSString *)_key ofObject:(id)_obj;
93
94 @end
95
96 #endif /* __SaxObjC_SaxObjectModel_H__ */